This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Backtrace oddity with verbose on


On Tuesday 30 January 2007 14:16, Fred Fish wrote:
> If a stack backtrace triggers one of the "corrupt stack" errors like
> the following:
> 
>     Previous frame identical to this frame (corrupt stack?)
> 
> the backtrace command will print nothing except this message the first
> time a backtrace is done, if verbose is on.

BTW, here is an easy way to reproduce this.

$ cat x.c
int sub2 ()
{
}

int sub ()
{
  sub2 ();
}

int main ()
{
  sub ();
}

$ cat .gdbinit
set verbose on
br sub2
run
set ***(int *)$sp=0
set **(int *)$sp=0
set *(int *)$sp=0
echo Doing first backtrace\n
bt
echo Doing second backtrace\n
bt

Now compile 'x' and run gdb.  Here is the relevant output for Fedora Core 6's gdb:

    $ /usr/bin/gdb x
    GNU gdb Red Hat Linux (6.5-15.fc6rh)
     ...
    Doing first backtrace
    Previous frame inner to this frame (corrupt stack?)
    Doing second backtrace
    #0  sub2 () at x.c:3
    #1  0x08048331 in sub () at x.c:7
    (gdb) 

Here is the relevant output for gdb 6.6:

    $ /tmp/gdb x
    GNU gdb 6.6 broadcom_2007a_411
    ...
    Doing first backtrace
    #0  sub2 () at x.c:3
    #1  0x08048331 in sub () at x.c:7
    Backtrace stopped: previous frame inner to this frame (corrupt stack?)
    Doing second backtrace
    #0  sub2 () at x.c:3
    #1  0x08048331 in sub () at x.c:7
    Backtrace stopped: previous frame inner to this frame (corrupt stack?)

So the problem is now fixed apparently.

-Fred
    


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]