Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Phil Muldoon <pmuldoon@redhat.com>
To: Simeon S <simeon.simeonov.s@gmail.com>, gdb@sourceware.org
Subject: Re: GDB Frame Filter - handling corrupt stack
Date: Tue, 09 Sep 2014 15:48:00 -0000	[thread overview]
Message-ID: <540F2160.3010705@redhat.com> (raw)
In-Reply-To: <CAGwyPpEkdfuwFiS_afffoHk_1nGjMFjG+v3yKLhioiRyasdYyQ@mail.gmail.com>

On 09/09/14 13:26, Simeon S wrote:


It's a fairly simple filter, so I don't see much wrong with that.
 
>
> When the gdb "backtrace" command is issued, frames are decorated
> followed by a gdb crash. This is what the last output from gdb is:
>
>     UNIX ERR:tcsetattr:Input/output error
>     Segmentation fault (core dumped)

I'd love to see a backtrace of this.  It is not related to your issue,
but it is a bug in the frame filters.  It should print the error
message below:

> The stack seems to be corrupt which is what I suspect is causing the
> crash. If the frame filter is disabled, the last line of the
> "backtrace" command is:
>
>     Backtrace stopped: previous frame inner to this frame (corrupt stack?)

Yeah at this point the stack looks clobbered, or some kind of bug
internal to GDB has occurred.

> I haven't looked into why the stack is corrupt - all the frames of
> interest to me are there.  Is there a way to catch this condition to
> avoid crashing? I am not interested in any of the corrupt frames -
> what is in the stack is enough.

No not really.  Someone else may have an idea.

> I guess I am looking for a mechanism to stop gdb iterating over
> further frames if it detects a corrupt/invalid frame.  The
> documentation does say that gdb has to iterate over all stack frames
> though.

Even though the documentation does indeed say that, you can always
slice/trim the iterator that is handed to the frame filter and return
the sliced iterator.  The trick is finding which frame would be the
corrupted one and slicing appropriately.  See the itertools Python
module for iterator tools (including slicing).

Cheers

Phil



  reply	other threads:[~2014-09-09 15:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-09 12:26 Simeon S
2014-09-09 15:48 ` Phil Muldoon [this message]
2014-09-09 21:37   ` Simeon S

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=540F2160.3010705@redhat.com \
    --to=pmuldoon@redhat.com \
    --cc=gdb@sourceware.org \
    --cc=simeon.simeonov.s@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox