This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

Re: [RFA/hpux] acknowledging TTEVT_LWP_EXIT


> Date: Tue, 18 Sep 2007 11:48:06 +0200
> From: Jerome Guitton <guitton@adacore.com>
> 
> 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  <guitton@adacore.com>
> 
> 	* 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.

Looks ok to me.


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