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: ttrace: Protocal error


On Sat, 09 Aug 2008, Pedro Alves wrote:

> If I'm analising the race correctly, an alternative simpler solution
> to the above, would be to just ignore a failed resume on a
> dying thread, but still try to resume it.  Not resuming dying threads
> may be a problem.

It occured to me that my suggested change wasn't going to handle the
race associated with threads dying, although it improves the situation.

The ttrace documentation suggested that only stopped threads should
be resumed.  The thread info indicated the thread in question was
running.  I changed the code to only check for thread stopped.  However,
this didn't work.  My testcase hangs when run under gdb:

(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y

Starting program: /mnt/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libgomp/testsuite/vla6.x3g 
warning: Private mapping of shared library text was not specified
by the executable; setting a breakpoint in a shared library which
is not privately mapped will not work.  See the HP-UX 11i v3 chatr
manpage for methods to privately map shared library text.
[New process 2316, lwp 7552188]
[process 2316, lwp 7552188 exited]
[New process 2316, lwp 7552189]
[process 2316, lwp 7552189 exited]
[New process 2316, lwp 7552190]
[process 2316, lwp 7552190 exited]
[New process 2316, lwp 7552191]
[process 2316, lwp 7552191 exited]
[New process 2316, lwp 7552192]
[New process 2316, lwp 7552193]
[New process 2316, lwp 7552194]
[New process 2316, lwp 7552195]
[New process 2316, lwp 7552196]

Program received signal SIGINT, Interrupt.
[Switching to process 2316, lwp 7552196]
0xc03bea58 in __lwp_sema_wait () from /usr/lib/librt.2

So, there's apparently a race in detection when a program is stopped.
It looks like we need to try your suggestion(s).

Attached same with debug infrun 1.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

Attachment: vla6.dbg
Description: Text document


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