gdb  User: guest  Access: viewconf gnatsweb
MAIN PAGECREATEQUERYADV. QUERYLOGIN AGAINHELP

View Problem Report: 1505

or add note or send email to interested parties


Reporter's email: mec.gnu@mindspring.com
CC these people
on PR status email:
   
Number: 1505
Category: backtrace
Synopsis: [regression] gdb prints a bad backtrace for a thread
Confidential: no
Severity: serious
Priority: high
Responsible: unassigned
State: closed
Class: change-request
Submitter-Id: net
Arrival-Date: Sat Jan 10 13:58:00 UTC 2004
Closed-Date: Fri Aug 06 14:13:21 UTC 2004
Last-Modified: Fri Aug 06 14:13:21 UTC 2004
Originator: mec.gnu@mindspring.com
Release: gdb HEAD 2004-01-09 22:05:53 UTC
Organization:
Environment: target=native, host=i686-pc-linux-gnu, osversion=red-hat-8.0
gdb=HEAD 2004-01-09 22:05:53 UTC
gcc=3.3.2, binutils=2.14, glibc=2.2.93-5-rh
gformat=dwarf-2, glevel=2
Description: When backtracing a thread, gdb doesn't stop until it hits garbage.  This caused a FAIL result with gdb.threads/pthreads.exp: apply backtrace command to all three threads.

(gdb) PASS: gdb.threads/pthreads.exp: check backtrace from thread 2
thread apply 1 3 4 bt^M
^M
Thread 1 (Thread 8192 (LWP 4157)):^M
#0  0x420ae561 in nanosleep () from /lib/i686/libc.so.6^M
#1  0x4002883c in nanosleep () from /lib/i686/libpthread.so.0^M
#2  0x420ae439 in sleep () from /lib/i686/libc.so.6^M
#3  0x08048927 in main (argc=1, argv=0xbffff774) at /berman/fsf/_today_/source/gdb/HEAD/src/gdb/testsuite/gdb.threads/pthreads.c:166^M
^M
Thread 3 (Thread 8194 (LWP 4160)):^M
#0  common_routine (arg=1) at /berman/fsf/_today_/source/gdb/HEAD/src/gdb/testsuite/gdb.threads/pthreads.c:53^M
#1  0x08048691 in thread1 (arg=0xfeedface) at /berman/fsf/_today_/source/gdb/HEAD/src/gdb/testsuite/gdb.threads/pthreads.c:82^M
#2  0x40024941 in pthread_start_thread () from /lib/i686/libpthread.so.0^M
#3  0x00000000 in ?? ()^M
#4  0x40270cf8 in ?? ()^M
#5  0x40026108 in __pthread_wait_for_restart_signal () from /lib/i686/libpthread.so.0^M
Cannot access memory at address 0xfeedfad2^M

This is a regression versus gdb 6.0.
This worked with gdb HEAD 2003-12-24 07:13:44 UTC.

It looks like a consequence of the recent "don't treat zero specially" change.

For your convenience, a pre-built executable of gdb.threads/pthtreads is attached.  Source available on request.  :)
File Attachments:
download filename size
pthreads 20k
How-To-Repeat: gdb pthreads
break common_routine
run
thread apply all backtrace
Fix:
Release-Note:
Unformatted:

or send email to interested parties

Audit Trail:

From: Mark Kettenis <kettenis@chello.nl>
To: gdb-gnats@sources.redhat.com
Cc:  
Subject: Re: backtrace/1505: [regression] gdb prints a bad backtrace for a thread
Date: Sat, 10 Jan 2004 21:20:27 +0100 (CET)

 This is pretty weird given the fact that the clone() syscall stub in
 glibc explicitly clears %ebp to mark the outermost frame.  I'll see if
 I can reproduce this.
 
 Mark

From: Mark Kettenis <kettenis@chello.nl>
To: gdb-gnats@sources.redhat.com
Cc:  
Subject: Re: backtrace/1505: [regression] gdb prints a bad backtrace for a thread
Date: Sun, 11 Jan 2004 15:10:48 +0100 (CET)

 I can't reproduce this on any (SuSE 7.2, RedHat 9) system :-(.  It
 occurs to me that it is pretty weird that frame #3 has a zero PC at
 all.  I'd expect that the PC for this frame would be somewhere in
 clone(), which is indeed what I see on RedHat 9.
 
 It'd be interesting to see the output from "info frame" for frames #2
 and #3.  I'm also curious about the value of $eip, $esp and $ebp in
 those frames.
 
 I really suspect that this is a problem with libc.so or libpthread.so
 on your system.
 
 Mark

From: mec.gnu@mindspring.com (Michael Elizabeth Chastain)
To: kettenis@chello.nl
Cc: gdb-gnats@sources.redhat.com
Subject: Re: backtrace/1505: [regression] gdb prints a bad backtrace for a thread
Date: Sun, 11 Jan 2004 17:31:33 -0500 (EST)

 First, just for information, are the shared library versions
 on my system (i686-pc-linux-gnu red hat 8.0).
 
   [mec.gnu@berman tmp]$ ldd pthreads
 	  libpthread.so.0 => /lib/i686/libpthread.so.0 (0x4001e000)
 	  libm.so.6 => /lib/i686/libm.so.6 (0x4004f000)
 	  libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
 	  /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
 
   [mec.gnu@berman tmp]$ ls -l /lib/i686/libpthread.so.0
   /lib/i686/libm.so.6 /lib/i686/libc.so.6 /lib/ld-linux.so.2 lrwxrwxrwx    1 root     root           14 Jan 29  2003
   /lib/i686/libc.so.6 -> libc-2.2.93.so lrwxrwxrwx    1 root     root           14 Jan 29  2003
   /lib/i686/libm.so.6 -> libm-2.2.93.so lrwxrwxrwx    1 root     root           18 Jan 29  2003
   /lib/i686/libpthread.so.0 -> libpthread-0.10.so lrwxrwxrwx    1 root     root           12 Jan 29  2003
   /lib/ld-linux.so.2 -> ld-2.2.93.so
 
 And here is a backtrace with 'info frame' and the register values
 in each frame and a memory dump of the stack.
 
   Script started on Sun Jan 11 17:21:24 2004
 
   [mec.gnu@berman tmp]$ /berman/fsf/_today_/berman/install/target/native/gdb/HEAD/bin/REAL-gdb pthreads 
   GNU gdb 2004-01-09-cvs
   Copyright 2004 Free Software Foundation, Inc.
   GDB is free software, covered by the GNU General Public License, and you are
   welcome to change it and/or distribute copies of it under certain conditions.
   Type "show copying" to see the conditions.
   There is absolutely no warranty for GDB.  Type "show warranty" for details.
   This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".
 
   (gdb) break common_routine
   Breakpoint 1 at 0x804859a: file /berman/fsf/_today_/source/gdb/HEAD/src/gdb/testsuite/gdb.threads/pthreads.c, line 53.
 
   (gdb) run
   Starting program: /berman/home/mec.gnu/tmp/pthreads 
   [Thread debugging using libthread_db enabled]
   [New Thread 8192 (LWP 7313)]
   [New Thread 16385 (LWP 7315)]
   [New Thread 8194 (LWP 7316)]
   [Switching to Thread 8194 (LWP 7316)]
 
   Breakpoint 1, common_routine (arg=1)
       at /berman/fsf/_today_/source/gdb/HEAD/src/gdb/testsuite/gdb.threads/pthreads.c:53
   53	  if (verbose) printf("common_routine (%d)\n", arg);
 
   (gdb) thread apply all backtrace
 
   Thread 3 (Thread 8194 (LWP 7316)):
   #0  common_routine (arg=1)
       at /berman/fsf/_today_/source/gdb/HEAD/src/gdb/testsuite/gdb.threads/pthreads.c:53
   #1  0x08048691 in thread1 (arg=0xfeedface)
       at /berman/fsf/_today_/source/gdb/HEAD/src/gdb/testsuite/gdb.threads/pthreads.c:82
   #2  0x40024941 in pthread_start_thread () from /lib/i686/libpthread.so.0
   #3  0x00000000 in ?? ()
   #4  0x40270cf8 in ?? ()
   #5  0x40026108 in __pthread_wait_for_restart_signal ()
      from /lib/i686/libpthread.so.0
   Cannot access memory at address 0xfeedfad2
 
   (gdb) thread 3
   [Switching to thread 3 (Thread 8194 (LWP 7316))]#0  common_routine (arg=1)
       at /berman/fsf/_today_/source/gdb/HEAD/src/gdb/testsuite/gdb.threads/pthreads.c:53
   53	  if (verbose) printf("common_routine (%d)\n", arg);
 
   (gdb) frame 0
   #0  common_routine (arg=1)
       at /berman/fsf/_today_/source/gdb/HEAD/src/gdb/testsuite/gdb.threads/pthreads.c:53
   53	  if (verbose) printf("common_routine (%d)\n", arg);
 
   (gdb) info frames
   Undefined info command: "frames".  Try "help info".
 
   (gdb) info frame
   Stack level 0, frame at 0x40270a7c:
    eip = 0x804859a in common_routine
       (/berman/fsf/_today_/source/gdb/HEAD/src/gdb/testsuite/gdb.threads/pthreads.c:53); saved eip 0x8048691
    called by frame at 0x40270a9c
    source language c.
    Arglist at 0x40270a74, args: arg=1
    Locals at 0x40270a74, Previous frame's sp is 0x40270a7c
    Saved registers:
     ebp at 0x40270a74, eip at 0x40270a78
 
   (gdb) print $eip
   $1 = (void *) 0x804859a
 
   (gdb) print $esp
   $2 = (void *) 0x40270a5c
 
   (gdb) print $ebp
   $3 = (void *) 0x40270a74
 
   (gdb) frame 1
   #1  0x08048691 in thread1 (arg=0xfeedface)
       at /berman/fsf/_today_/source/gdb/HEAD/src/gdb/testsuite/gdb.threads/pthreads.c:82
   82	      common_routine (1);
 
   (gdb) info frame
   Stack level 1, frame at 0x40270a9c:
    eip = 0x8048691 in thread1
       (/berman/fsf/_today_/source/gdb/HEAD/src/gdb/testsuite/gdb.threads/pthreads.c:82); saved eip 0x40024941
    called by frame at 0x40270aa4, caller of frame at 0x40270a7c
    source language c.
    Arglist at 0x40270a94, args: arg=0xfeedface
    Locals at 0x40270a94, Previous frame's sp is 0x40270a9c
    Saved registers:
     ebp at 0x40270a94, eip at 0x40270a98
 
   (gdb) print $eip
   $4 = (void *) 0x8048691
 
   (gdb) print $esp
   $5 = (void *) 0x40270a7c
 
   (gdb) print $ebp
   $6 = (void *) 0x40270a94
 
   (gdb) frame 2
   #2  0x40024941 in pthread_start_thread () from /lib/i686/libpthread.so.0
 
   (gdb) info frame
   Stack level 2, frame at 0x40270aa4:
    eip = 0x40024941 in pthread_start_thread; saved eip 0x0
    called by frame at 0x40270aa8, caller of frame at 0x40270a9c
    Arglist at 0x40270a9c, args: 
    Locals at 0x40270a9c, Previous frame's sp is 0x40270aa4
    Saved registers:
     ebp at 0x40270a9c, eip at 0x40270aa0
 
   (gdb) print $eip
   $7 = (void *) 0x40024941
 
   (gdb) print $esp
   $8 = (void *) 0x40270a9c
 
   (gdb) print $ebp
   $9 = (void *) 0x40270b94
 
   (gdb) frame 3
   #3  0x00000000 in ?? ()
 
   (gdb) info frame
   Stack level 3, frame at 0x40270aa8:
    eip = 0x0; saved eip 0x40270cf8
    called by frame at 0x40270aac, caller of frame at 0x40270aa4
    Arglist at 0x40270aa0, args: 
    Locals at 0x40270aa0, Previous frame's sp is 0x40270aa8
    Saved registers:
     ebp at 0x40270a9c, eip at 0x40270aa4
 
   (gdb) print $eip
   $10 = (void *) 0x0
 
   (gdb) print $esp
   $11 = (void *) 0x40270aa4
 
   (gdb) print $ebp
   $12 = (void *) 0xfeedface
 
   (gdb) frame 4
   #4  0x40270cf8 in ?? ()
 
   (gdb) info frame
   Stack level 4, frame at 0x40270aac:
    eip = 0x40270cf8; saved eip 0x40026108
    called by frame at 0xfeedfad6, caller of frame at 0x40270aa8
    Arglist at 0x40270aa4, args: 
    Locals at 0x40270aa4, Previous frame's sp is 0x40270aac
    Saved registers:
     ebp at 0x40270a9c, eip at 0x40270aa8
 
   (gdb) print $eip
   $13 = (void *) 0x40270cf8
 
   (gdb) print $esp
   $14 = (void *) 0x40270aa8
 
   (gdb) print $ebp
   $15 = (void *) 0xfeedface
 
   (gdb) frame 0
   #0  common_routine (arg=1)
       at /berman/fsf/_today_/source/gdb/HEAD/src/gdb/testsuite/gdb.threads/pthreads.c:53
   53	  if (verbose) printf("common_routine (%d)\n", arg);
 
   (gdb) print $esp
   $16 = (void *) 0x40270a5c
 
   (gdb) x/200w $esp
   0x40270a5c:	0x4001e000	0x4002dc64	0x000000fc	0x40020a00
   0x40270a6c:	0x42008318	0x4212a2d0	0x40270a94	0x08048691
   0x40270a7c:	0x00000001	0x42118dc0	0x42126a40	0x4002db44
   0x40270a8c:	0x00000001	0x00000001	0x40270b94	0x40024941
   0x40270a9c:	0xfeedface	0x00000000	0x40270cf8	0x40026108
   0x40270aac:	0x40270abc	0x00000020	0x40270abc	0x00000000
   0x40270abc:	0x00000002	0x40270be0	0x00000420	0x00000041
   0x40270acc:	0x00000002	0x40270be0	0x00000420	0x00000041
   0x40270adc:	0x00000000	0x00000000	0x00000000	0x00000000
   0x40270aec:	0x00000000	0x00000000	0x00000000	0x00000000
   0x40270afc:	0x00000000	0x00000000	0x00000000	0x00000000
   0x40270b0c:	0x00000000	0x00000000	0x00000000	0x00000000
   0x40270b1c:	0x00000000	0x00000000	0x00000000	0x00000000
   0x40270b2c:	0x00000000	0x00000000	0x00000000	0x00000000
   0x40270b3c:	0x00000000	0x00000000	0x400260b1	0x4002db44
   0x40270b4c:	0x4002de40	0x40270be0	0x40270b94	0x40027f48
   0x40270b5c:	0x40270be0	0x00000000	0x00000000	0x00000001
   0x40270b6c:	0x00000001	0x00000000	0x00000000	0x00000000
   0x40270b7c:	0x00000000	0x00000000	0x400247a5	0x4002db44
   0x40270b8c:	0x40270be0	0x40270be0	0x40270bd4	0x40024a45
   0x40270b9c:	0x40270be0	0x40270bbc	0x00000010	0x00000000
   0x40270bac:	0x00000002	0x40270be0	0x00000420	0x00000041
   0x40270bbc:	0x00000002	0x40270be0	0x00000420	0x00000041
   0x40270bcc:	0x40024990	0x40270be0	0x00000000	0x420da1ca
   0x40270bdc:	0x40270be0	0x40270be0	0x00000000	0x40270be0
   0x40270bec:	0x00000000	0x00000000	0x00000000	0x00000000
   0x40270bfc:	0x00000000	0x00000000	0x00000000	0x00000000
   0x40270c0c:	0x00000000	0x00000000	0x00000000	0x00000000
   0x40270c1c:	0x00000000	0x4002b080	0x4002b080	0x00000000
   0x40270c2c:	0x00000000	0x00002002	0x00001c94	0x00000000
   0x40270c3c:	0x4002de40	0x00000020	0x00000000	0x00000000
   0x40270c4c:	0x00000000	0x00000000	0x00000000	0x00000000
   0x40270c5c:	0x00000000	0x00000000	0x00000000	0x00000000
   0x40270c6c:	0x0804861b	0xfeedface	0x80000000	0x00000000
   0x40270c7c:	0x00000003	0x4004e548	0x00000000	0x00000001
   0x40270c8c:	0x00000000	0x40006d9f	0x400124b8	0x0000014f
   0x40270c9c:	0x40012be0	0x40006d9f	0x400124b8	0x00000005
   0x40270cac:	0x400126e0	0xbffff7d0	0x4000a01f	0x4001287c
   0x40270cbc:	0x4004e538	0x00000001	0x00000000	0xbffff7c0
   0x40270ccc:	0x40028427	0x4001e000	0x4002dd00	0x0000014f
   0x40270cdc:	0x400205e8	0x00000000	0x08049b94	0x00000005
   0x40270cec:	0x08048277	0x4001f67c	0x00000000	0x00000000
   0x40270cfc:	0x00000000	0x00000000	0x00000000	0x00000000
   0x40270d0c:	0x00000000	0x00000000	0x00000000	0x00000000
   0x40270d1c:	0x00000000	0x00000000	0x00000000	0x00000000
   0x40270d2c:	0x00000000	0x00000000	0x00000000	0x00000000
   0x40270d3c:	0x00000000	0x00000000	0x00000000	0x00000000
   0x40270d4c:	0x00000000	0x00000000	0x00000000	0x00000000
   0x40270d5c:	0x00000000	0x00000000	0x00000000	0x00000000
   0x40270d6c:	0x00000000	0x00000000	0x00000000	0x00000000
   (gdb) quit
   The program is running.  Exit anyway? (y or n) y
 
   [mec.gnu@berman tmp]$ exit
   exit
 
   Script done on Sun Jan 11 17:24:00 2004

From: mec.gnu@mindspring.com (Michael Elizabeth Chastain)
To: kettenis@chello.nl
Cc: gdb-gnats@sources.redhat.com
Subject: Re: backtrace/1505: [regression] gdb prints a bad backtrace for a thread
Date: Mon, 12 Jan 2004 07:10:53 -0500 (EST)

 The HP test drive cluster has a bunch of Linux systems.  After getting
 all of them to build gdb (some of them don't have ncurses installed!),
 here are the results for backtracing the three threads:
 
   gcc -g -o pthreads.$machine pthreads.c -lpthread
   gdb pthreads.$machine
   (gdb) break common_routine
   (gdb) run
   (gdb) thread apply all backtrace
 
 This is with gdb HEAD 2004-01-09 22:05:53 UTC.
 
 These platforms worked:
 
   debian woody, red hat 2.1 es, red hat 2.1 as, slackware 9.1.0, suse 8.1
   some stop at "clone"
   some stop at "thread_start"
 
 This platform had an unrelated problem:
 
   mandrake 9.2
 
 So I would ask, check once more on red hat linux 9, because my
 original problem was on red hat linux 8.  Then close the bug.
 
 ===
 
 Details
 
 ===
 
 Debian Woody
 
   Thread 3 (Thread 1026 (LWP 11897)):
   #0  common_routine (arg=1) at pthreads.c:53
   #1  0x08048711 in thread1 (arg=0xfeedface) at pthreads.c:82
   #2  0x4001f0ba in pthread_start_thread () from /lib/libpthread.so.0
   #3  0x4001f101 in pthread_start_thread_event () from /lib/libpthread.so.0
   #4  0x400fcd6a in clone () from /lib/libc.so.6
 
   Thread 2 (Thread 2049 (LWP 11896)):
   #0  0x400f5bb0 in poll () from /lib/libc.so.6
   #1  0x4001ed96 in __pthread_manager () from /lib/libpthread.so.0
   #2  0x4001efc0 in __pthread_manager_event () from /lib/libpthread.so.0
   #3  0x400fcd6a in clone () from /lib/libc.so.6
 
   Thread 1 (Thread 1024 (LWP 11894)):
   #0  0x400cdde1 in nanosleep () from /lib/libc.so.6
   #1  0x400cdd78 in sleep () from /lib/libc.so.6
   #2  0x08048917 in main (argc=1, argv=0xbffffb74) at pthreads.c:151
   53        if (verbose) printf("common_routine (%d)\n", arg);
 
 Mandrake 9.2
 
   *** gdb on threaded program does not work ***
 
   (gdb) break common_routine
   Breakpoint 1 at 0x80485a2: file pthreads.c, line 53.
   (gdb) run
   Starting program:
   /house/chastain/gdb/pthread.i686-pc-linux-gnu.mandrake-9.2.exe
 
   Program received signal SIG32, Real-time event 32.
   0x40028714 in pthread_getconcurrency () from /lib/i686/libpthread.so.0
   (gdb) cont
   Continuing.
 
   Program received signal SIGTRAP, Trace/breakpoint trap.
   0x40027de0 in pthread_yield () from /lib/i686/libpthread.so.0
 
 Red Hat 2.1 Enterprise Server
 
   Thread 3 (Thread 8194 (LWP 10657)):
   #0  common_routine (arg=1) at pthreads.c:53
   #1  0x08048781 in thread1 (arg=0xfeedface) at pthreads.c:82
   #2  0x40029c6f in pthread_start_thread (arg=0x4038fbe0) at manager.c:279
   #3  0x40029d5f in pthread_start_thread_event (arg=0x4038fbe0) at manager.c:303
   #4  0x40141cca in thread_start () from /lib/i686/libc.so.6
 
   Thread 2 (Thread 16385 (LWP 10656)):
   #0  0x4013a467 in __poll (fds=0x804bb74, nfds=1, timeout=2000)
   at ../sysdeps/unix/sysv/linux/poll.c:63
   #1  0x40029920 in __pthread_manager (arg=0x5) at manager.c:135
   #2  0x4002a509 in __pthread_manager_event (arg=0x5) at manager.c:226
   #3  0x40141cca in thread_start () from /lib/i686/libc.so.6
 
   Thread 1 (Thread 8192 (LWP 10654)):
   #0  0x40082be5 in __sigsuspend (set=0xbffec5b0)
   at ../sysdeps/unix/sysv/linux/sigsuspend.c:45
   #1  0x4002c2b9 in __pthread_wait_for_restart_signal (self=0x40031020) at pthread.c:1027
   #2  0x4002c38c in __pthread_create_2_1 (thread=0xbffec76c, attr=0xbffec720, start_routine=0x80486fc <thread1>, arg=0xfeedface) at restart.h:34
   #3  0x08048933 in main (argc=1, argv=0xbffec7e4) at pthreads.c:145
   53        if (verbose) printf("common_routine (%d)\n", arg);
 
 Red Hat 2.1 Advanced Server
 
   Thread 3 (Thread 8194 (LWP 11402)):
   #0  common_routine (arg=1) at pthreads.c:53
   #1  0x08048781 in thread1 (arg=0xfeedface) at pthreads.c:82
   #2  0x40029c6f in pthread_start_thread (arg=0x4038fbe0) at manager.c:279
   #3  0x40029d5f in pthread_start_thread_event (arg=0x4038fbe0) at manager.c:303
   #4  0x40141cca in thread_start () from /lib/i686/libc.so.6
 
   Thread 2 (Thread 16385 (LWP 11401)):
   #0  0x4013a467 in __poll (fds=0x804bb74, nfds=1, timeout=2000) at ../sysdeps/unix/sysv/linux/poll.c:63
   #1  0x40029920 in __pthread_manager (arg=0x5) at manager.c:135
   #2  0x4002a509 in __pthread_manager_event (arg=0x5) at manager.c:226
   #3  0x40141cca in thread_start () from /lib/i686/libc.so.6
 
   Thread 1 (Thread 8192 (LWP 11400)):
   #0  0x40082be5 in __sigsuspend (set=0xbffed200) at ../sysdeps/unix/sysv/linux/sigsuspend.c:45
   #1  0x4002c2b9 in __pthread_wait_for_restart_signal (self=0x40031020) at pthread.c:1027
   #2  0x4002c38c in __pthread_create_2_1 (thread=0xbffed3bc, attr=0xbffed370, start_routine=0x80486fc <thread1>, arg=0xfeedface) at restart.h:34
   #3  0x08048933 in main (argc=1, argv=0xbffed434) at pthreads.c:145
   53        if (verbose) printf("common_routine (%d)\n", arg);
 
 Slackware 9.1.0
 
   Thread 3 (Thread 16386 (LWP 30899)):
   #0  common_routine (arg=1) at pthreads.c:53
   #1  0x08048681 in thread1 (arg=0xfeedface) at pthreads.c:82
   #2  0x4002cca3 in pthread_start_thread () from /lib/libpthread.so.0
   #3  0x4002cd1f in pthread_start_thread_event () from /lib/libpthread.so.0
   #4  0x4015ac97 in clone () from /lib/libc.so.6
 
   Thread 2 (Thread 32769 (LWP 30898)):
   #0  0x40151f32 in loser_poll () from /lib/libc.so.6
   #1  0x40151ffe in poll () from /lib/libc.so.6
   #2  0x4002c9ae in __pthread_manager () from /lib/libpthread.so.0
   #3  0x4002cba7 in __pthread_manager_event () from /lib/libpthread.so.0
   #4  0x4015ac97 in clone () from /lib/libc.so.6
 
   Thread 1 (Thread 16384 (LWP 30896)):
   #0  0x401299a6 in nanosleep () from /lib/libc.so.6
   #1  0x00000000 in ?? ()
   #2  0x40129809 in sleep () from /lib/libc.so.6
   #3  0x08048873 in main (argc=1, argv=0xbffff7b4) at pthreads.c:151
   53        if (verbose) printf("common_routine (%d)\n", arg);
 
 
 SusE 8.1
 
   Thread 3 (Thread 1026 (LWP 31784)):
   #0  common_routine (arg=1) at pthreads.c:53
   #1  0x08048682 in thread1 (arg=0xfeedface) at pthreads.c:82
   #2  0x400281b0 in pthread_start_thread () from /lib/libpthread.so.0
   #3  0x4002822f in pthread_start_thread_event () from /lib/libpthread.so.0
   #4  0x40102e4a in thread_start () from /lib/libc.so.6
 
   Thread 2 (Thread 2049 (LWP 31783)):
   #0  0x400fb6cb in poll () from /lib/libc.so.6
   #1  0x40027ec8 in __pthread_manager () from /lib/libpthread.so.0
   #2  0x400280bd in __pthread_manager_event () from /lib/libpthread.so.0
   #3  0x40102e4a in thread_start () from /lib/libc.so.6
 
   Thread 1 (Thread 1024 (LWP 31781)):
   #0  0x40060cce in sigaction () from /lib/libc.so.6
   #1  0x4002b33a in sigaction () from /lib/libpthread.so.0
   #2  0x400d4b92 in sleep () from /lib/libc.so.6
   #3  0x08048875 in main (argc=1, argv=0xbffff324) at pthreads.c:151
   53        if (verbose) printf("common_routine (%d)\n", arg);
 

From: mec.gnu@mindspring.com (Michael Elizabeth Chastain)
To: eliz@gnu.org
Cc: gdb-gnats@sources.redhat.com
Subject: Re: backtrace/1505: [regression] gdb prints a bad backtrace for a thread
Date: Mon, 19 Jul 2004 17:06:26 -0400 (EDT)

 Eli Zaretskii writes:
 eliz> FWIW, I've seen similar problems without any threading, in the DJGPP
 eliz> port (when debugging Emacs).  GDB 5.x doesn't have problems with the
 eliz> same debuggee.  I originally thought that it is specific to DJGPP
 eliz> (perhaps because the DJGPP port of Emacs is compiled with -gcoff and
 eliz> the line number table overflows the 64K limit inherent to COFF debug
 eliz> info), but now that I see this PR, I begin to think that it's not
 eliz> DJGPP-specific.
 
 Can you grab a gdb session (somehow) and cut the part where you actually
 type 'backtrace' and add that to pr 1505?
 
 Just replying to this mail ought to do that (mail to gdb-gnats@,
 with subject 'Re: backtrace/1505: ...).
 
 Michael C
State-Changed-From-To: open->closed
State-Changed-By: chastain
State-Changed-When: Fri Aug  6 14:13:21 2004
State-Changed-Why:
    
    This bug has been fixed in gdb HEAD 2004-08-01.
    Stack backtraces in threads terminate properly now, on my test system at least (native i686-pc-linux-gnu, red hat 8, glibc 2.2.93-5-rh).