[lkml]   [2000]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Pthreads, linux, gdb, oh my! (fwd)
Peter Berger <> writes:
> Hi. I have the following tiny test program which fails dramatically,
> using pthreads, in a number of fascinating ways on various version of
> linux, using various versions of glibc, under various (current) versions
> of GDB.

It looks like a GDB bug. GDB contains code to recognize when the
"pthreads" shared library has been loaded. When this happens, it sets
itself up to properly handle threads (including setting up correct
SIG32 signal handling). If you trick GDB into thinking "pthreads"
hasn't been loaded and set the SIG32 stuff up yourself, like so:

buhr@saurus:~/src$ gdb thread-test
GNU gdb 19990928
Copyright 1998 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"...
(gdb) set auto-solib-add 0
(gdb) handle SIG32 nostop noprint pass
Signal Stop Print Pass to program Description
SIG32 No No Yes Real-time event 32
(gdb) run

then your program works fine. Ergo, this is strong evidence that
GDB's thread handling is broken. Presumably, it's simply not reaping
threads when they exit.

I don't know if Petr just happened to run his GDB 5.0 with "set
auto-solib-add 0" in his ".gdbinit" (a rather necessary precaution if
you're hacking on, say, Mozilla) and didn't see any problem for that
reason, or if some aspect of his configuration has fixed the problem.
Alternatively, maybe Petr is using a GDB that doesn't actually support
threads---if so, he'd *have* to set the SIG32 stuff up manually, and
he wouldn't notice any problem.

Kevin <>
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:51    [W:0.075 / U:0.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site