using gdb 5.3 to debug threads

using gdb 5.3 to debug threads

Post by kamal » Thu, 06 May 2004 03:41:33


I am using gdb 5.3 on Redhat linux 9. I have a multi-threaded
application to debug. It seems to be getting a SIGKILL out of nowhere.
I tried doing a

(gdb) handle SIGKILL nopass

but it insists on killing my process and not letting me investigate
Id appreciate any help on this.


using gdb 5.3 to debug threads

Post by stev » Thu, 06 May 2004 04:14:26

In article < XXXX@XXXXX.COM >,

Check your system log. The kernel will send an unsolicited SIGKILL for
a number of reasons, the most obvious being when the system runs completely
out of memory, and the oom killer runs.

There are a number of other places in the Linux kernel that issue a SIGKILL,
though, and I can't say that I know every one of them logs something.
Steve Watt KD6GGD PP-ASEL-IA ICBM: 121W 56' 57.8" / 37N 20' 14.9"
Internet: steve @ Watt.COM Whois: SW32
Free time? There's no such thing. It just comes in varying prices...


using gdb 5.3 to debug threads

Post by kamal » Fri, 07 May 2004 01:18:13

I saw a message in syslog stating that an attempt was made to
de-reference un-available virtual memory.

But besides that, if I say handle SIGKILL nopass -it should block the
signal from reaching the process.

Also, how stable is this NPTL on Linux?
It doesn't look like gdb is anywere close to helping debug
multi-threaded applications.


using gdb 5.3 to debug threads

Post by bji-g » Fri, 07 May 2004 09:07:25

For what it's worth, I've used gdb pretty extensively in debugging
multithreaded code on RedHat 9. I'm not sure what version of gdb it
was; it was whatever came with RedHat, although I did upgrade to a
more recent version of glibc to fix some pthreads errors.

gdb worked pretty well for me. Sometimes it had difficulties, and
occasionally would crash or give errors on every command (so that even
"quit" did not work). It wasn't perfect, but overall it worked well

Perhaps you have a different, buggier version of gdb than I had. Or
maybe you need to upgrade to the latest glibc.

Best wishes,