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

            Bug ID: 109719
           Summary: Truncated frame-pointer unwinding via Linux perf with
                    g++
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chergert at redhat dot com
  Target Milestone: ---

On Fedora 38, frame-pointers are enabled by default. Caveats of course.

However, I noticed that clang++ is generating code that can unwind with
frame-pointers just fine where as g++ is generating code that fails to unwind
past a single frame for some projects.

Where I've noticed this is when profiling GTK/GNOME applications. Harfbuzz,
which is C++ (no-rtti, no-exceptions, no-threadsafe-statics, and no stdlibc++),
regularly results in stacktraces from Linux perf containing 2 frames. One of
them looks corrupted, and the second to a Harfbuzz function.

When I recompile the project with clang++ instead (leaving the rest of the
system still compiled with gcc) I get proper stacktraces from Linux perf
showing how the Harfbuzz API was called (via GLib/GTK/Pango/etc).

Happy to provide more information and/or be remote hands/eyes.

Thanks!

Reply via email to