https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98875
Bug ID: 98875 Summary: DWARF5 as default causes perf probe to hang Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug Assignee: unassigned at gcc dot gnu.org Reporter: pc at us dot ibm.com Target Milestone: --- I sent this to gcc-patches, but realized I should open a bug report: -- 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 Reverting this patch permits the command to succeed. -- $ grep VERSION= /etc/os-release VERSION="15-SP2" $ uname -r 5.3.18-22-default $ perf --version perf version 5.3.18 Top of the GCC tree used: ATSRC_PACKAGE_REV=eb9883c1312c Reversion patch: -- $ cat ~/projects/gcc/gcc/gcc-revert-dwarf-5.patch diff --git a/gcc/common.opt b/gcc/common.opt index a8a2b67a99d..7aff4ac6079 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -3179,7 +3179,7 @@ Common Driver JoinedOrMissing Negative(gdwarf-) Generate debug information in default version of DWARF format. gdwarf- -Common Driver Joined UInteger Var(dwarf_version) Init(5) Negative(gstabs) +Common Driver Joined UInteger Var(dwarf_version) Init(4) Negative(gstabs) Generate debug information in DWARF v2 (or later) format. gdwarf32 -- Failing command: $ perf probe -v -x /path/to/AT/at-next-15.0-0-alpha/bin/ld ldmain=main