Regression: GDB stopped on run with attached process (PR 17347) [Re: [pushed+7.8] Re: [PATCH] Fix "attach" command vs user input race [Re: Regression for attach from stdin [Re: [pushed] Re: [PATCH v6 0/2] enable target-async by default]]]

Jan Kratochvil
2014-09-03T07:59:08Z

On Wed, 09 Jul 2014 19:09:29 +0200, Pedro Alves wrote:
> Here's what I pushed to both master and gdb-7.8-branch.

https://sourceware.org/bugzilla/show_bug.cgi?id=17347

sleep 1h&p=$!;sleep 0.1;gdb -batch sleep $p -ex r

PASS:
[2] 22970
0x0000003fdf8bc780 in __nanosleep_nocancel () at ../sysdeps/unix/syscall-template.S:81
81 T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
/usr/bin/sleep: missing operand
Try '/usr/bin/sleep --help' for more information.
[Inferior 1 (process 23030) exited with code 01]
[2]+ Killed sleep 1h

FAIL:
[2] Killed sleep 1h
[3]+ Stopped ./gdb/gdb -batch sleep $! -ex r

7180e04a36d812bbea2c280f2db33a7e8ce6b07b is the first bad commit
commit 7180e04a36d812bbea2c280f2db33a7e8ce6b07b
Author: Pedro Alves <palves@redhat.com>
Date: Wed Jul 9 15:59:02 2014 +0100

Fix "attach" command vs user input race

private Red Hat reference: https://bugzilla.redhat.com/show_bug.cgi?id=1136704