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: [PATCH 1/8] gdb.threads/{siginfo-thread.c,watchthreads-reorder.c,ia64-sigill.c} races with GDB


Pedro Alves <palves@redhat.com> writes:

> The issue is that the test program stops GDB before it had a chance of
> processing the new thread's clone event:
>
>   (gdb) PASS: gdb.threads/siginfo-threads.exp: get pid
>   continue
>   Continuing.
>   Stopping GDB PID 21541.
>   Waiting till the threads initialize their TIDs.
>   FAIL: gdb.threads/siginfo-threads.exp: catch signal 0 (timeout)
>
> On Linux (at least), new threads start stopped, and the debugger must
> resume them.  The fix is to make the test program wait for the new
> threads to be running before stopping GDB.

Looks there is a deadlock.  main thread sends SIGSTOP to gdb and calls
pthread_cond_wait to wait for being notified by child thread.  Child
thread is stopped (should be resumed by gdb) and can't notify main
thread.  The patch looks right to me.

-- 
Yao (éå)


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