RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1924068 - binutils debuginfo misses code for bfd functions
Summary: binutils debuginfo misses code for bfd functions
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: binutils
Version: 8.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: Nick Clifton
QA Contact: Miloš Prchlík
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-02 14:26 UTC by Michael Petlan
Modified: 2021-11-10 07:05 UTC (History)
3 users (show)

Fixed In Version: binutils-2.30-100.el8
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-09 19:31:20 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2021:4364 0 None None None 2021-11-09 19:31:50 UTC

Description Michael Petlan 2021-02-02 14:26:57 UTC
Description of problem:

There seems to be no debuginfo for functions from libbfd.so (installed by binutils package) in binutils-debuginfo and binutils-debugsource packages.

Version-Release number of selected component (if applicable):
binutils-debuginfo-2.30-90.el8.aarch64

How reproducible:
100%

Steps to Reproduce:
1. try to debug something that uses bfd (e.g. perf-4.18.0-280.el8 and newer):

yum -y install perf
debuginfo-install -y perf binutils
... install all the debuginfo packages gdb suggests you to install

run perf under gdb:
gdb /usr/bin/perf -ex 'b bfd_check_format' -ex "r test -F 'PE file'"

run "bt" command after reaching the breakpoint

Actual results:

(gdb) bt
#0  0x0000aaaaaad4edcc in bfd_check_format ()
#1  0x0000aaaaaaceade4 in filename__read_build_id (filename=filename@entry=0xffffffff90e8 "/usr/libexec/perf-core/tests/pe-file.exe", bid=bid@entry=0xffffffff90b0) at util/symbol-elf.c:547
#2  0x0000aaaaaac25448 in run_dir (d=d@entry=0xffffffffd1a8 "/usr/libexec/perf-core/tests") at tests/pe-file-parsing.c:39
#3  0x0000aaaaaac25780 in test__pe_file_parsing (test=<optimized out>, subtest=<optimized out>) at tests/pe-file-parsing.c:85
#4  0x0000aaaaaabfa3a4 in run_test (subtest=-1, test=0xaaaaab06fff8 <generic_tests+4288>) at tests/builtin-test.c:418
#5  test_and_print (t=t@entry=0xaaaaab06fff8 <generic_tests+4288>, force_skip=force_skip@entry=false, subtest=subtest@entry=-1) at tests/builtin-test.c:448
#6  0x0000aaaaaabfb4dc in __cmd_test (skiplist=0x0, argv=0xffffffffe940, argc=1) at tests/builtin-test.c:669
#7  cmd_test (argc=1, argv=0xffffffffe940) at tests/builtin-test.c:815
#8  0x0000aaaaaac2695c in run_builtin (p=0xaaaaab0702e0 <commands+552>, argc=3, argv=0xffffffffe940) at perf.c:312
#9  0x0000aaaaaab9c6f8 in handle_internal_command (argv=0xffffffffe940, argc=3) at perf.c:364
#10 run_argv (argcp=<synthetic pointer>, argv=<synthetic pointer>) at perf.c:408
#11 main (argc=<optimized out>, argv=0xffffffffe940) at perf.c:538



Expected results:

There should be debuginfo for bfd_check_format() function as well.

Additional info:

Comment 1 Nick Clifton 2021-02-04 14:13:21 UTC
Hi Micahel,

  This is a strange one.  The binutils-debuginfo rpm does exist, and it does contain debug information for some functions, but not all.  GCC is responsible for generating the debug info and I am wondering if this is an artifact of the recent adoption of LTO compilation by default ...

 Cheers
  Nick

Comment 2 Nick Clifton 2021-02-04 15:16:06 UTC
OK, I have found the problem, but not the cause.  The static version of the bfd library (libbfd.a) contains object files that are stripped of debug information.  This looks like a build issue.

Investigating....

Comment 3 Jeff Law 2021-02-04 19:09:14 UTC
So one of the things I'd recommend is looking at the libbfd.a in the build directory ie /build/builddir/BUILD first to see if it has the debuginfo.  Then I'd look at the install directory (/build/builddir/BUILDROOT) to see if it was stripped away.

Or it might just be a case where optimizing with LTO is losing some of the debuginfo.  I could see that happening with aggressive inlining at LTO time, though it's *supposed* to work with debuginfo generation.

Comment 4 Florian Weimer 2021-02-04 19:18:05 UTC
Is this about the static library?

All installed *.a libraries are stripped, so that linking with them produces stripped binaries. I proposed to change that in

  <https://fedoraproject.org/wiki/Changes/StaticLibraryDebuginfo>

but it was rejected.

Comment 5 Nick Clifton 2021-02-05 10:33:20 UTC
(In reply to Florian Weimer from comment #4)
> Is this about the static library?

Yes - this is exactly the problem.

> All installed *.a libraries are stripped, so that linking with them produces
> stripped binaries. I proposed to change that in

Michael - this is the source of the problem.  The RHEL build system strips debug information from static archives and perf is linked against the static bfd library.

Since *all* apps that use the bfd library are forced to link against the static version (the libbfd.so file is just a linker script fragement that causes the static version to be used) I have gone ahead and created a patch to the binutils.spec file that disables the debug info stripping.  The patch is currently in rawhide (binutils-2.35.1-33.fc34) and it will be in RHEL-9 shortly.  I do not however plan on updating binutils for RHEL-8.4.0  Instead I think that it would be better to fix this in RHEL-8.5.0.

Comment 7 Nick Clifton 2021-03-24 11:57:59 UTC
Fixed in binutils-2.30-98.el8.

Comment 13 Miloš Prchlík 2021-04-29 12:44:04 UTC
Verified with binutils-devel-2.30-101.el8.

Comment 16 errata-xmlrpc 2021-11-09 19:31:20 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: binutils security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:4364


Note You need to log in before you can comment on or make changes to this bug.