In inf-ttrace, when a TTEVT_LWP_EXIT event is received (thread exiting), the corresponding thread is removed from the thread list and never resumed. Which is wrong ; the ttrace man page reads: TTEVT_LWP_EXIT This event flag indicates that the debugger wants to be notified when a thread is exiting via the lwp_exit() system call. The thread stops upon entry to the system call. So the dying thread is stopped, it should be resumed one last time. Otherwise, any other thread waiting for its death on pthread_join would be blocked forever (e.g. in attachment, a simple program which freezes when it is run under GDB). Also in attachement, a patch that fixes this issue. It also fixes 3 unexpected failures of the testsuite on HPUX 11.11. 2007-09-18 Jerome Guitton * inf-ttrace.c (inf_ttrace_private_thread_info): New structure type. (inf_ttrace_delete_dying_threads_callback): New function. (inf_ttrace_resume): After resuming the execution, iterate over the dying threads to delete them for the thread list. (inf_ttrace_wait): on TTEVT_LWP_EXIT and TTEVT_LWP_TERMINATE, mark the corresponding thread as dying instead of removing it from the thread list. (inf_ttrace_thread_alive): return 0 for dying threads.