Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* gdb stack trace shows only those frames after the signal
@ 2003-12-23 14:56 srikrish
  2003-12-23 15:02 ` Daniel Jacobowitz
  2003-12-23 15:03 ` srikrish
  0 siblings, 2 replies; 5+ messages in thread
From: srikrish @ 2003-12-23 14:56 UTC (permalink / raw)
  To: gdb

Hi,After handling a signal the previous stack trace is lost. Is this a known problem? Any fixes?Hardware Environment: Intel
x86Software Environment:Linux RHEL 3; gdb-5.3.90-0.20030710.40rh; glibc 2.3.2-95.6; gcc 3.2.3 20030502 Also occurs with SuSE
Linux.Steps to Reproduce:1. compile the testcase (under Additinal Info below) with "gcc -o t mytrap.c"2. run "t"3. attach gdb to the
"t"'s PID and type "where"Actual Results:[root@localhost root]# gdbGNU gdb Red Hat Linux (5.3.90-0.20030710.40rh)This GDB was
configured as "i386-redhat-linux-gnu".(gdb) attach 2032Attaching to process 2032Reading symbols from /home/krishna/t...done.Using
host libthread_db library "/lib/libthread_db.so.1".Reading symbols from /lib/libc.so.6...done.Loaded symbols for
/lib/libc.so.6Reading symbols from /lib/ld-linux.so.2...done.Loaded symbols for /lib/ld-linux.so.20xb755d8cb in pause () from
/lib/libc.so.6(gdb) where#0  0xb755d8cb in pause () from /lib/libc.so.6#1  0x0804840f in function2 () at mytrap.c:8#2  0x0804842c in
function1 () at mytrap.c:15#3  0x08048449 in SIGSEGVhandler (sig=11, info=0xbfffa5a0, ucontext=0xbfffa620)    at mytrap.c:22#4
<signal handler called>(gdb) frame 5#0  0x00000000 in ?? ()(gdb)Expected Results:the stack traceback should display functionb,
functiona, and main for this testcasemytrap.c:#include <stdio.h>#include <signal.h>#include <unistd.h>void function2( void ){
printf( "Now in function2.. pausing.. pid = %d\n", getpid() );   pause();}void function1( void ){   printf( "Now in function1\n" );
function2();}void SIGSEGVhandler( int sig, siginfo_t *info, void *ucontext ){   printf( "Now in SIGSEGVhandler\n" );
function1();}void functionb( void ){   char *p = NULL;   printf( "Now in functionb... causing sig11...\n" );   *p = 'x';  /* forcing
SEGFAULT */}void functiona( void ){   printf( "Now in functiona\n" );   functionb();}int main( void ){   struct sigaction newact;
struct sigaction oldact;   newact.sa_sigaction = SIGSEGVhandler;   newact.sa_flags = SA_SIGINFO;   sigaction( SIGSEGV, &newact,
&oldact );   printf( "About to call functiona\n" );   functiona();   return 0;}Srikrishnan


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gdb stack trace shows only those frames after the signal
  2003-12-23 14:56 gdb stack trace shows only those frames after the signal srikrish
@ 2003-12-23 15:02 ` Daniel Jacobowitz
  2003-12-23 15:03 ` srikrish
  1 sibling, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2003-12-23 15:02 UTC (permalink / raw)
  To: srikrish; +Cc: gdb

Please fix your line wrapping if you expect anyone to read your e-mail.

This is a known problem on recent systems; search the archives for
information about the vsyscall DSO.  At least I believe that will show
up in signal backtraces also.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gdb stack trace shows only those frames after the signal
  2003-12-23 14:56 gdb stack trace shows only those frames after the signal srikrish
  2003-12-23 15:02 ` Daniel Jacobowitz
@ 2003-12-23 15:03 ` srikrish
  2003-12-24  7:03   ` Joel Brobecker
  1 sibling, 1 reply; 5+ messages in thread
From: srikrish @ 2003-12-23 15:03 UTC (permalink / raw)
  To: gdb

Hi - I'm sorry for the formatting problems in my previous post.

After handling a signal the previous stack trace is lost. Is this a known problem? Any fixes?
Hardware Environment: Intel x86

Software Environment:
RHEL 3; gdb-5.3.90-0.20030710.40rh; glibc 2.3.2-95.6; gcc 3.2.3 20030502 
Steps to Reproduce:
1. compile the testcase (under Additinal Info below) with "gcc -o t mytrap.c"
2. run "t"
3. attach gdb to the "t"'s PID and type "where"

Actual Results:

[root@localhost root]# gdb
GNU gdb Red Hat Linux (5.3.90-0.20030710.40rh)
This GDB was configured as "i386-redhat-linux-gnu".
(gdb) attach 2032
Attaching to process 2032
Reading symbols from /home/krishna/t...done.
Using host libthread_db library "/lib/libthread_db.so.1".
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
0xb755d8cb in pause () from /lib/libc.so.6
(gdb) where
#0  0xb755d8cb in pause () from /lib/libc.so.6
#1  0x0804840f in function2 () at mytrap.c:8
#2  0x0804842c in function1 () at mytrap.c:15
#3  0x08048449 in SIGSEGVhandler (sig=11, info=0xbfffa5a0, ucontext=0xbfffa620)
    at mytrap.c:22
#4  <signal handler called>
(gdb) frame 5
#0  0x00000000 in ?? ()
(gdb)

Expected Results:
the stack traceback should display functionb, functiona, and main for this 
testcase


mytrap.c:
#include <stdio.h>
#include <signal.h>
#include <unistd.h>

void function2( void )
{
   printf( "Now in function2.. pausing.. pid = %d\n", getpid() );
   pause();
}

void function1( void )
{
   printf( "Now in function1\n" );
   function2();
}

void SIGSEGVhandler( int sig, siginfo_t *info, void *ucontext )
{
   printf( "Now in SIGSEGVhandler\n" );
   function1();
}

void functionb( void )
{
   char *p = NULL;
   printf( "Now in functionb... causing sig11...\n" );
   *p = 'x';  /* forcing SEGFAULT */
}

void functiona( void )
{
   printf( "Now in functiona\n" );
   functionb();
}

int main( void )
{
   struct sigaction newact;
   struct sigaction oldact;
   newact.sa_sigaction = SIGSEGVhandler;
   newact.sa_flags = SA_SIGINFO;
   sigaction( SIGSEGV, &newact, &oldact );
   printf( "About to call functiona\n" );
   functiona();
   return 0;
}

Srikrishnan



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gdb stack trace shows only those frames after the signal
  2003-12-23 15:03 ` srikrish
@ 2003-12-24  7:03   ` Joel Brobecker
  2003-12-24 14:16     ` srikrish
  0 siblings, 1 reply; 5+ messages in thread
From: Joel Brobecker @ 2003-12-24  7:03 UTC (permalink / raw)
  To: srikrish; +Cc: gdb

> After handling a signal the previous stack trace is lost. Is this a
> known problem? Any fixes?

Try GDB 6.0, or GDB from CVS. The symptoms are identical to a problem
that I have seen before which were fixed in GDB 6.0.

-- 
Joel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gdb stack trace shows only those frames after the signal
  2003-12-24  7:03   ` Joel Brobecker
@ 2003-12-24 14:16     ` srikrish
  0 siblings, 0 replies; 5+ messages in thread
From: srikrish @ 2003-12-24 14:16 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb

The problem is still there with gdb-20031224. (current snapshot)
How ever, the error does not occur when I use gdb-6.0post-0.20031117.5.i386.rpm which is shipped with RedHat Enterprise Linux 3
update beta.

Srikrishnan


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-12-24 14:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-23 14:56 gdb stack trace shows only those frames after the signal srikrish
2003-12-23 15:02 ` Daniel Jacobowitz
2003-12-23 15:03 ` srikrish
2003-12-24  7:03   ` Joel Brobecker
2003-12-24 14:16     ` srikrish

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox