]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Fix timeout in gdb.base/async-shell.exp
authorTom de Vries <tdevries@suse.de>
Fri, 12 Dec 2025 08:35:23 +0000 (09:35 +0100)
committerTom de Vries <tdevries@suse.de>
Fri, 12 Dec 2025 08:35:23 +0000 (09:35 +0100)
For test-case gdb.base/async-shell.exp, I usually get:
...
(gdb) run &^M
Starting program: async-shell ^M
(gdb) PASS: $exp: run &
[Thread debugging using libthread_db enabled]^M
Using host libthread_db library "/lib64/libthread_db.so.1".^M
shell echo foo^M
foo^M
(gdb) PASS: $exp: shell echo foo
...

And with taskset -c 11, I get instead:
...
(gdb) run &^M
Starting program: async-shell ^M
(gdb) PASS: $exp: run &
shell echo foo^M
foo^M
(gdb) PASS: $exp: shell echo foo
[Thread debugging using libthread_db enabled]^M
Using host libthread_db library "/lib64/libthread_db.so.1".^M
...

With a gdb 16.3 based package I ran into:
...
(gdb) run &
Starting program: async-shell
(gdb) PASS: $exp: run &
shell echo foo
foo
(gdb) [Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
FAIL: $exp: shell echo foo (timeout)
...

I have tried to reproduce this using various timing tricks, but haven't
managed.  Nevertheless, I believe this can reproduced with trunk, so fix this
using -no-prompt-anchor.

PR testsuite/33667
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33667

gdb/testsuite/gdb.base/async-shell.exp

index 228ed10008fa84a5cde98fc0443bcce1d8fb02dd..95d6cc28b99b1f2b9c7f4a09ca24b7d7aa5fee19 100644 (file)
@@ -34,7 +34,7 @@ gdb_test -no-prompt-anchor "run &" "Starting program: \[^\r\n\]*(\r\n$gdbindex_w
 # `sleep 5' here would workaround the bug, do not sleep here.
 # "shell" could eat waitpid event from the asynchronous inferior process.
 
-gdb_test "shell echo foo" "foo"
+gdb_test -no-prompt-anchor "shell echo foo" "foo"
 
 set test "interrupt"
 gdb_test_multiple $test $test {