This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

lin-thread cannot handle thread exit


Hi Michael,

The thread_db assisted debugging code doesn't handle exiting threads
properly, at least in combination with glibc 2.1.3.  There are at
least two problems that prevent this from working:

1. In lin-thread.c:enable_thread_event_reporting(), GDB requests
   TD_DEATH events to be reported, and sets a breakpoint at the
   appropriate location.  The problem is that the LinuxThreads
   implementation included with glibc 2.1.3 triggers that breakpoint
   after it has flagged the thread as terminated.  As a conseuqence
   when GDB tries to fetch the registers for that thread it doesn't
   succeed, and GDB complains about a breakpoint at location 0x0 that
   it doesn't know of.

2. If I disable the reporting of TD_DEATH events, things still don't
   work.  The problem is that when the thread really exits, a
   TARGET_WAITKIND_EXITED event is reported to GDB in.  So the answer to
   the question ``Can I get this event mistakenly from a thread?'' in
   lin-thread.c:thread_db_wait() is ``Yes''.  Since the
   TARGET_WAITKIND_EXITED event is passed on to other code in GDB, GDB
   thinks that the entire process has died.

Ignoring those "spurious" TARGET_WAITKIND_EXITED events doesn't help
since some parts of GDB still think that the thread is still alive
then.

Looking through the code, it seems that there quite a few "loose
ends".  Is this still "work in progress"?

Mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]