On Fri, Jan 29, 2021 at 12:22:41PM +0100, Mark Wielaard wrote: > On Thu, Jan 28, 2021 at 08:25:20PM -0600, Paul A. Clarke wrote: > > The subject commit, 3804e937b0e252a7e42632fe6d9f898f1851a49c, causes a > > failure in the test suite for the IBM Advance Toolchain. The test in > > question uses "perf probe" to set a tracepoint at "main" in a newly built > > (with GCC 11) binary of "/bin/ld". With the patch applied, the command > > enters an infinte loop, calling libdw1 functions but making no progress. > > > > The infinite loop can be found in the Linux kernel > > tools/perf/utils/probe-finder.c: > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/perf/util/probe-finder.c?h=v5.11-rc5#n1190 > > > > > > The infinite loop is because off isn't updated to noff before calling > continue in the while loop. Moving the last line of the loop off = > noff; to the start of the loop should fix that.
I noticed that, too. I'll report that over on linux-perf-users. (That code is about 10 years old, surprisingly.) > Why the call to dwarf_offdie fails is unclear. Try printing the error > using dwarf_errmsg (-1) when it returns NULL. The message is not terribly helpful, to me anyway: invalid DWARF > If you also print out > off (in hex) and the filename the dbg was created from you can inspect > the file using [eu-]readelf --debug-dump=info to see how the DIEs look > at that offset. I'm not a DWARF/DIE expert at this point to know what to look for. -- Contents of the .debug_info section: Compilation Unit @ offset 0x0: Length: 0x24 (32-bit) Version: 5 Abbrev Offset: 0x0 Pointer Size: 8 <0><c>: Abbrev Number: 1 (DW_TAG_compile_unit) <d> DW_AT_stmt_list : 0x0 <11> DW_AT_low_pc : 0x100089d4 <19> DW_AT_high_pc : 68 <1a> DW_AT_name : (indirect string, offset: 0x0): start.S <1e> DW_AT_comp_dir : (indirect string, offset: 0x8): /path/to/AT.../sources/glibc/csu <22> DW_AT_producer : (indirect string, offset: 0x5c): GNU AS 2.36.50 <26> DW_AT_language : 32769 (MIPS assembler) ... Is there an incompatibility introduced with DWARF5? > BTW. Make sure you have elfutils libdw version 0.172 or newer when > dealing with DWARF5. Latest elfutils release is 0.182. SLES15SP2 has an older version: $ rpm -qi libdw1 Name : libdw1 Version : 0.168 Release : 4.5.3 PC