public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/98875] New: DWARF5 as default causes perf probe to hang
@ 2021-01-29  2:35 pc at us dot ibm.com
  2021-01-29  7:49 ` [Bug debug/98875] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: pc at us dot ibm.com @ 2021-01-29  2:35 UTC (permalink / raw)
  To: gcc-bugs

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug debug/98875] DWARF5 as default causes perf probe to hang
  2021-01-29  2:35 [Bug debug/98875] New: DWARF5 as default causes perf probe to hang pc at us dot ibm.com
@ 2021-01-29  7:49 ` rguenth at gcc dot gnu.org
  2021-02-18 19:28 ` mark at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-01-29  7:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98875

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
With perf you'll have to use -gdwarf-4 anyway since otherwise it cannot parse
debug in my experience.  Quite some tools need to be brought up-to-date with
DWARF5 yet.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug debug/98875] DWARF5 as default causes perf probe to hang
  2021-01-29  2:35 [Bug debug/98875] New: DWARF5 as default causes perf probe to hang pc at us dot ibm.com
  2021-01-29  7:49 ` [Bug debug/98875] " rguenth at gcc dot gnu.org
@ 2021-02-18 19:28 ` mark at gcc dot gnu.org
  2021-02-19  1:41 ` pc at us dot ibm.com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mark at gcc dot gnu.org @ 2021-02-18 19:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98875

Mark Wielaard <mark at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mark at gcc dot gnu.org

--- Comment #2 from Mark Wielaard <mark at gcc dot gnu.org> ---
I didn't realize this was also posted as a bug. There was some discussion on
the gcc-patches mailinglist here:
https://gcc.gnu.org/pipermail/gcc-patches/2021-January/thread.html#564485

The conclusion was that this was simply because of some ancient installation of
elfutils/libdw (0.168, which is from before the DWARF5 spec was released). Make
sure you have elfutils libdw version 0.172 or newer when dealing with DWARF5.
Latest elfutils release is 0.183.

I believe this issue can be closed, or are there any other issues with perf?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug debug/98875] DWARF5 as default causes perf probe to hang
  2021-01-29  2:35 [Bug debug/98875] New: DWARF5 as default causes perf probe to hang pc at us dot ibm.com
  2021-01-29  7:49 ` [Bug debug/98875] " rguenth at gcc dot gnu.org
  2021-02-18 19:28 ` mark at gcc dot gnu.org
@ 2021-02-19  1:41 ` pc at us dot ibm.com
  2021-02-19 16:04 ` [Bug web/98875] " mark at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pc at us dot ibm.com @ 2021-02-19  1:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98875

--- Comment #3 from Paul Clarke <pc at us dot ibm.com> ---
The IBM Advance Toolchain supports SLES 15, where the latest version of libdw
is 0.168. We'll work around the issue by reverting the commit for the version
of GCC included with the Advance Toolchain.

I didn't see any update to the GCC documentation regarding the disruptive
nature of the change causing the problem other than "[DWARF] Version 5 requires
GDB 8.0 or higher".

Should there be something about libdw as well?  Anything else?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug web/98875] DWARF5 as default causes perf probe to hang
  2021-01-29  2:35 [Bug debug/98875] New: DWARF5 as default causes perf probe to hang pc at us dot ibm.com
                   ` (2 preceding siblings ...)
  2021-02-19  1:41 ` pc at us dot ibm.com
@ 2021-02-19 16:04 ` mark at gcc dot gnu.org
  2021-02-19 17:04 ` mark at gcc dot gnu.org
  2021-03-02 18:37 ` mark at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: mark at gcc dot gnu.org @ 2021-02-19 16:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98875

Mark Wielaard <mark at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
           Assignee|unassigned at gcc dot gnu.org      |mark at gcc dot gnu.org
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2021-02-19
          Component|debug                       |web

--- Comment #4 from Mark Wielaard <mark at gcc dot gnu.org> ---
(In reply to Paul Clarke from comment #3)
> The IBM Advance Toolchain supports SLES 15, where the latest version of
> libdw is 0.168. We'll work around the issue by reverting the commit for the
> version of GCC included with the Advance Toolchain.

Yes, that is probably reasonable when targetting a distro that is so old that
it doesn't have any tooling to support DWARF5.

Still you might want to request that the perf tool be fixed to simply skip the
DWARF5 data instead of going into an infinite loop. That bug could trigger for
any DWARF that old perf/libdw doesn't know about and it really should just skip
it. The fix for that really is just a oneliner.

> I didn't see any update to the GCC documentation regarding the disruptive
> nature of the change causing the problem other than "[DWARF] Version 5
> requires GDB 8.0 or higher".
> 
> Should there be something about libdw as well?  Anything else?

You are right. I'll submit an update for the GCC 11 Release Notes to document
things.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug web/98875] DWARF5 as default causes perf probe to hang
  2021-01-29  2:35 [Bug debug/98875] New: DWARF5 as default causes perf probe to hang pc at us dot ibm.com
                   ` (3 preceding siblings ...)
  2021-02-19 16:04 ` [Bug web/98875] " mark at gcc dot gnu.org
@ 2021-02-19 17:04 ` mark at gcc dot gnu.org
  2021-03-02 18:37 ` mark at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: mark at gcc dot gnu.org @ 2021-02-19 17:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98875

--- Comment #5 from Mark Wielaard <mark at gcc dot gnu.org> ---
https://gcc.gnu.org/pipermail/gcc-patches/2021-February/565587.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug web/98875] DWARF5 as default causes perf probe to hang
  2021-01-29  2:35 [Bug debug/98875] New: DWARF5 as default causes perf probe to hang pc at us dot ibm.com
                   ` (4 preceding siblings ...)
  2021-02-19 17:04 ` mark at gcc dot gnu.org
@ 2021-03-02 18:37 ` mark at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: mark at gcc dot gnu.org @ 2021-03-02 18:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98875

Mark Wielaard <mark at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #6 from Mark Wielaard <mark at gcc dot gnu.org> ---
Hopefully https://gcc.gnu.org/gcc-11/changes.html now lists the DWARF5
requirements correctly.

gcc-wwwdocs
commit 80dc53f6b38d697b169fad9ce3b8787ce1c6768c (HEAD -> master, origin/master,
origin/HEAD)
Author: Mark Wielaard <mark@klomp.org>
Date:   Fri Feb 19 18:02:19 2021 +0100

    Document the GCC11 change to DWARF5 default.

            * gcc-11/changes.html (General Improvements): Add a section on
            the DWARF version 5 default.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-03-02 18:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-29  2:35 [Bug debug/98875] New: DWARF5 as default causes perf probe to hang pc at us dot ibm.com
2021-01-29  7:49 ` [Bug debug/98875] " rguenth at gcc dot gnu.org
2021-02-18 19:28 ` mark at gcc dot gnu.org
2021-02-19  1:41 ` pc at us dot ibm.com
2021-02-19 16:04 ` [Bug web/98875] " mark at gcc dot gnu.org
2021-02-19 17:04 ` mark at gcc dot gnu.org
2021-03-02 18:37 ` mark at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).