This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] testsuite: MI: racy results in async mode #2
On Sat, 29 Oct 2011 14:09:52 +0200, Marek Polacek wrote:
> Well I've run $ runtest -a gdb.mi/*.exp with read1 10+ times and didn't find
> any race failures.
Unfortunately this problem is unrelated to "read1".
The problem is GDB will:
write: *stopped,reason...
write: =breakpoint-deleted,...
read: <waits for input>
while expect will:
read: *stopped,reason... + everything available incl. =breakpoint-deleted
write: 222-break-insert break_at_me
read: ... now either =breakpoint-deleted is read or local 222-break-insert pty echo
In normal cases the first expect's read will read even =breakpoint-deleted.
With the read1 hack =breakpoint-deleted is not read in, it is kept in some
internal pty buffer. But it is already in that pty buffer so when expect
sends 222-break-insert the pty echoes 222-break-insert already _after_ the
=breakpoint-deleted string so no reproducibility changes with read1.
One can reproduce it by delaying all the writes from GDB. This way everything
gets processed on the expect side (incl. pty write + read of its echo) and
only afterwars =breakpoint-deleted finally arrives.
I have attached this different kind of reproducer to the Bug:
http://sourceware.org/bugzilla/show_bug.cgi?id=12649#c6
Thanks,
Jan