Debugging and NPTL

Ali Ijaz Sheikh ali at binish.com
Mon May 17 19:11:45 UTC 2004


Hi,

I have recently started seeing some problems with debugging of multithreaded
applications with NPTL on 2.6 series kernels.  It seems that GDB is no longer
being informed of the events occurring in the child threads because
create_thread (nptl/sysdeps/pthread/create_thread.c) routine does not pass the
CLONE_PTRACE flag to the clone system call.  For example, if the child thread
gets a SEGV, the whole thread group is terminated without GDB ever being told.

When creating a thread in a thread group that is being ptraced, shouldn't the
child thread be created with a CLONE_PTRACE?  It this a nptl bug?  Or is this
GDB's fault?

A simple program that creates a thread and does raise(SIGSEGV) in the child
thread can be used to reproduce this problem.  Try running that in gdb.

-Ali
ali at binish.com





More information about the Phil-list mailing list