I see: FAIL: gdb.base/unwind-on-each-insn-amd64.exp: foo: instruction 6: $fba_value == $fn_fba FAIL: gdb.base/unwind-on-each-insn-amd64.exp: foo: instruction 6: check frame-id matches FAIL: gdb.base/unwind-on-each-insn-amd64.exp: foo: instruction 6: bt 2 FAIL: gdb.base/unwind-on-each-insn-amd64.exp: foo: instruction 6: up FAIL: gdb.base/unwind-on-each-insn-amd64.exp: foo: instruction 6: $sp_value == $::main_sp FAIL: gdb.base/unwind-on-each-insn-amd64.exp: foo: instruction 6: $fba_value == $::main_fba FAIL: gdb.base/unwind-on-each-insn-amd64.exp: foo: instruction 6: [string equal $fid $::main_fid] Tom Tromey said he was only able to reproduce with an ASan build, so it might be important here, even though gdb.log doesn't contain an ASan error. The first error is: 380 (gdb) PASS: gdb.base/unwind-on-each-insn-amd64.exp: foo: instruction 6: get $sp and frame base for fn: get hexadecimal valueof "$sp" 381 info frame^M 382 Stack level 0, frame at 0x7fffffffd5a0:^M 383 rip = 0x40112f in foo (/home/vries/gdb_versions/devel/src/gdb/testsuite/gdb.base/unwind-on-each-insn-foo.c:22); saved rip = 0x7ffff7df01ca^M 384 called by frame at 0x7fffffffd640^M 385 source language c.^M 386 Arglist at 0x7fffffffd590, args: s=0x401114 <main+14> "\277\b @"^M 387 Locals at 0x7fffffffd590, Previous frame's sp is 0x7fffffffd5a0^M 388 Saved registers:^M 389 rbp at 0x7fffffffd590, rip at 0x7fffffffd598^M 390 (gdb) FAIL: gdb.base/unwind-on-each-insn-amd64.exp: foo: instruction 6: $fba_value == $fn_fba
(In reply to Simon Marchi from comment #0) > Tom Tromey said he was only able to reproduce with an ASan build +1.
Created attachment 15314 [details] gdb.fail.log (with asan)
Created attachment 15315 [details] gdb.pass.log (without asan)
Bisects to: ... commit 528b729be1a293a21f44149351f3eba5b4e2d870 Author: Guinevere Larsen <blarsen@redhat.com> Date: Wed Nov 1 17:25:32 2023 +0100 gdb/dwarf2: Add support for DW_LNS_set_epilogue_begin in line-table ...
Hmm, I'm running into this now after installing package gcc-PIE on my system. It's a hardcoded .S file, maybe nopie is required?
(In reply to Tom de Vries from comment #5) > Hmm, I'm running into this now after installing package gcc-PIE on my system. > > It's a hardcoded .S file, maybe nopie is required? Though when running with target board unix/-fPIE/-pie, it passes.
This patch ( https://sourceware.org/pipermail/gdb-patches/2024-March/207709.html ) was submitted, that seems to address this PR.
I'd like the fix (currently discussed on the ml) for this PR to be included in the 15.1 release.
Hi Tom, > I'd like the fix for this PR to be included in the 15.1 release. For the record, can you say which consideration(s?) made you reach this assessment? Looking at the fix, and in particular the title of the fix (out of bounds array access), I'm guessing that the out-of-bound condition is considered sufficiently critical that the fix should be in the release.
(In reply to Joel Brobecker from comment #9) > Hi Tom, > > > I'd like the fix for this PR to be included in the 15.1 release. > > For the record, can you say which consideration(s?) made you reach this > assessment? > > Looking at the fix, and in particular the title of the fix (out of bounds > array access), I'm guessing that the out-of-bound condition is considered > sufficiently critical that the fix should be in the release. Hi Joel, indeed, it's the fact that's it's an out-of-bound condition.
The master branch has been updated by Bernd Edlinger <edlinger@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=63ddc8af5d7d3ad909aad66291f23507ba987bb4 commit 63ddc8af5d7d3ad909aad66291f23507ba987bb4 Author: Bernd Edlinger <bernd.edlinger@hotmail.de> Date: Tue Apr 9 09:27:52 2024 +0000 Fix an out of bounds array access in find_epilogue_using_linetable An out of bounds array access in find_epilogue_using_linetable causes random test failures like these: FAIL: gdb.base/unwind-on-each-insn-amd64.exp: foo: instruction 6: $fba_value == $fn_fba FAIL: gdb.base/unwind-on-each-insn-amd64.exp: foo: instruction 6: check frame-id matches FAIL: gdb.base/unwind-on-each-insn-amd64.exp: foo: instruction 6: bt 2 FAIL: gdb.base/unwind-on-each-insn-amd64.exp: foo: instruction 6: up FAIL: gdb.base/unwind-on-each-insn-amd64.exp: foo: instruction 6: $sp_value == $::main_sp FAIL: gdb.base/unwind-on-each-insn-amd64.exp: foo: instruction 6: $fba_value == $::main_fba FAIL: gdb.base/unwind-on-each-insn-amd64.exp: foo: instruction 6: [string equal $fid $::main_fid] Here the read happens below the first element of the line table, and the test failure depends on the value that is read from there. It also happens that std::lower_bound returns a pointer exactly at the upper bound of the line table, also here the read value is undefined, that happens in this test: FAIL: gdb.dwarf2/dw2-epilogue-begin.exp: confirm watchpoint doesn't trigger Fixes: 528b729be1a2 ("gdb/dwarf2: Add support for DW_LNS_set_epilogue_begin in line-table") Co-Authored-By: Tom de Vries <tdevries@suse.de> PR symtab/31268 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31268
Fixed.