While running the gdb testsuite for gdb-12-branch on openSUSE Tumbleweed, I ran into: ... FAIL: gdb.mi/mi-cmd-user-context.exp: frame 1 (unexpected output) FAIL: gdb.mi/mi-cmd-user-context.exp: frame 2 (unexpected output) FAIL: gdb.mi/mi-cmd-user-context.exp: frame 3 (unexpected output) ... I tried to reproduce, and managed by running in parallel with "stress -c 5", 4 times in a run of 25. The first FAIL looks like this in more detail: ... PASS: gdb.mi/mi-cmd-user-context.exp: info thread 5 Expecting: ^(frame[^M ]+)?(.*#0 .*child_sub_function .*[^M ]+[(]gdb[)] ^M [ ]*) frame^M &"frame\n"^M ~"#0 0x00007ffff7d3049a in pthread_barrier_wait@GLIBC_2.2.5 () from /lib64/libc.so.6\n"\ ^M ^done^M (gdb) ^M FAIL: gdb.mi/mi-cmd-user-context.exp: frame 1 (unexpected output) ... Reading through the source code, the behaviour makes sense. A breakpoint is set in main, after the call to pthread_barrier_wait. This guarantees that when the breakpoint is hit, all threads have reached the barrier, and guarantees that the main thread has left the barrier, but not that the other threads have left the barrier. So at first glance this looks like a testsuite problem.
(In reply to Tom de Vries from comment #0) > While running the gdb testsuite for gdb-12-branch on openSUSE Tumbleweed, I > ran into: > ... > FAIL: gdb.mi/mi-cmd-user-context.exp: frame 1 (unexpected output) > FAIL: gdb.mi/mi-cmd-user-context.exp: frame 2 (unexpected output) > FAIL: gdb.mi/mi-cmd-user-context.exp: frame 3 (unexpected output) > ... > Hm, actually the original FAIL was a reproduction of the problem fixed by this ( https://sourceware.org/pipermail/gdb-patches/2022-April/187319.html ): ... PASS: gdb.mi/mi-cmd-user-context.exp: info thread 5 Expecting: ^(frame[^M ]+)?(.*#0 0x.*[^M ]+[(]gdb[)] ^M [ ]*) frame^M &"frame\n"^M ~"#0 child_sub_function () at /data/vries/gdb_versions/devel/src/gdb/testsuite/gdb.mi/u\ ser-selected-context-sync.c:33\n"^M ~"33\t dummy = !dummy; /* thread loop line */\n"^M ^done^M (gdb) ^M FAIL: gdb.mi/mi-cmd-user-context.exp: frame 1 (unexpected output) ... The detailed FAIL listed in comment 0, is what I got when trying reproduce.
https://sourceware.org/pipermail/gdb-patches/2022-April/187353.html
Fixed: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=9b571e28984a7fb757962be477322f89d2366c80