Is the current gdb 5.1 broken for Linuxthreads?

H . J . Lu hjl@lucon.org
Mon Sep 17 16:13:00 GMT 2001


On Mon, Sep 17, 2001 at 12:47:10PM -0700, H . J . Lu wrote:
> Here is a modified example from glibc.
> 
> # gcc -g ex11.c -lpthread -lrt -D_GNU_SOURCE
> # ./a.out&
> # ps -xal | grep a.out
> 000  1103 27904  3705   9   0 247300 600 rt_sig S    pts/17     0:00 ./a.out
> 040  1103 27905 27904  11   0 247300 600 do_pol S    pts/17     0:00 ./a.out
> 040  1103 27906 27905   9   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 040  1103 27907 27905   9   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 040  1103 27908 27905   9   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 040  1103 27909 27905   9   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 040  1103 27910 27905   9   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 040  1103 27911 27905   9   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 040  1103 27912 27905   9   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 040  1103 27913 27905   9   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 040  1103 27914 27905   9   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 040  1103 27915 27905   9   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 040  1103 27916 27905   9   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 040  1103 27917 27905   9   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 040  1103 27918 27905   9   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 040  1103 27919 27905   9   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 040  1103 27920 27905   9   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 040  1103 27921 27905   9   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 040  1103 27922 27905   9   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 040  1103 27923 27905   9   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 040  1103 27924 27905   9   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 040  1103 27925 27905   9   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 040  1103 27926 27905   9   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 040  1103 27927 27905   9   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 040  1103 27928 27905   9   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 040  1103 27929 27905   9   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 040  1103 27930 27905  10   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 040  1103 27931 27905  10   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 040  1103 27932 27905  10   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 040  1103 27933 27905  11   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 040  1103 27934 27905  10   0 247300 600 nanosl S    pts/17     0:00 ./a.out
> 
> # gdb a.out
> ...
> (gdb) att 27934
> Attaching to program: /home/hjl/bugs/gdb/thread/./a.out, process 27934
> Child process unexpectedly missing: No child processes.
> 
> Program terminated with signal ?, Unknown signal.
> The program no longer exists.
> (gdb)
> 
> But
> 
> (gdb) att 27904
> 
> worked fine. It is a serious regression from gdb 4.18 from RedHat
> 6.2.
> 

The more I looked at it, the more borken gdb is with linuxthreads:

# gcc -g ex11.c -lpthread -lrt -D_GNU_SOURCE -static
# a.out
# gdb a.out
...
(gdb) att 14226
Attaching to program: /home/hjl/bugs/gdb/thread/a.out, process 14226
...
lin-lwp.c:620: gdb-internal-error: stop_wait_callback: Assertion `pid ==
GET_LWP (lp->ptid)' failed.
An internal GDB error was detected.  This may make further



H.J.



More information about the Gdb mailing list