Bug 2090744 - glibc: missing .gnu_debuglink section in libc.so.6, redundant debuginfo for ld-*.so.2
Summary: glibc: missing .gnu_debuglink section in libc.so.6, redundant debuginfo for l...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: rawhide
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Arjun Shankar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2115830 2115831
TreeView+ depends on / blocked
 
Reported: 2022-05-26 13:21 UTC by Benjamin Herrenschmidt
Modified: 2022-09-20 12:42 UTC (History)
11 users (show)

Fixed In Version: glibc-2.34-42.fc35 glibc-2.35-17.fc36 glibc-2.36-3.fc37 glibc-2.36.9000-5.fc38
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2115830 2115831 (view as bug list)
Environment:
Last Closed: 2022-09-10 20:51:11 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Copy debuglink section to final binaries (1.52 KB, patch)
2022-05-26 13:21 UTC, Benjamin Herrenschmidt
no flags Details | Diff
Copy debuglink section to final libc.so.6 (1.20 KB, patch)
2022-06-03 04:54 UTC, Benjamin Herrenschmidt
no flags Details | Diff

Description Benjamin Herrenschmidt 2022-05-26 13:21:31 UTC
Created attachment 1883840 [details]
Copy debuglink section to final binaries

The ld-*.so.2 and libc.so.6 binaries generated by the Fedora package are missing the .gnu_debuglink section. This causes gdb to fail to display the message about running debuginfo-install in asence of debuginfod, among others possible issues.

The problem is caused by the wrap-find-debuginfo.sh script which is run as part of the rpmbuild process. The script saves the original libraries before the real find-debuginfo.sh is run, and replaces them back, thus losing the changes the script did such as adding that section. Losing most of those changes is done on purpose but not the loss of that specific section.

The problem happens on all current versions of Fedora.

The attached patch against that script is my dumb attempt at fixing it (seems to work so far.... objcopy is a pain).

Comment 1 Florian Weimer 2022-05-26 15:19:01 UTC
Thanks for the patch. I think for ld.so, we should not restore the debuglink because ld.so does not have separated debuginfo. It always has full debuginfo to aid with dynamic loader introspection.

What do you think?

Comment 2 Benjamin Herrenschmidt 2022-05-26 22:10:23 UTC
Hrm possibly. We do install /usr/lib/debug/lib64/ld-linux-x86-64.so.2-2.35-9.fc36.x86_64.debug as part of glibc-debuginfo, so that's probably what confused me ?

Interestingly it looks like dnf happily leaves the old debuginfo around, and won't update them on either dnf update or debuginfo-install, I have to explicitely remove the old
packages and re-install the debuginfo for the udpate to happen. I wonder if there's a purpose here or if it's a bug. IE, my f36 machine has things like:

-rw-r--r--. 1 root root   245384 Jul 28  2020 libbz2.so.1.0.8-1.0.8-4.fc33.x86_64.debug
-rw-r--r--. 1 root root  1485520 Jul 28  2020 libfontconfig.so.1.12.0-2.13.92-12.fc33.x86_64.debug
-rw-r--r--. 1 root root  4120072 Oct 23  2020 libfreetype.so.6.17.4-2.10.4-1.fc33.x86_64.debug

 ...

Sitting there and debuginfo-install or dnf won't update them unless I first take them out. Is this a known issue ? On purpose ?

I can change the script to avoid preserving the .gnu_debuglink in ld.so if you prefer, though the debug info file does exist.

Comment 3 Florian Weimer 2022-05-27 08:26:09 UTC
(In reply to Benjamin Herrenschmidt from comment #2)
> Hrm possibly. We do install
> /usr/lib/debug/lib64/ld-linux-x86-64.so.2-2.35-9.fc36.x86_64.debug as part
> of glibc-debuginfo, so that's probably what confused me ?

Yes, this file is unnecessary.

> Interestingly it looks like dnf happily leaves the old debuginfo around, and
> won't update them on either dnf update or debuginfo-install,

It's probably related to the feature that you can install arbitrary debuginfo packages, e.g. for investigating coredumps.

Comment 6 Benjamin Herrenschmidt 2022-06-03 04:53:32 UTC
Sorry for the delay, I took some time off and got swamped by a number of other things as I returned. Attaching an updated patch which only handles libc.so.6

Comment 7 Benjamin Herrenschmidt 2022-06-03 04:54:27 UTC
Created attachment 1886258 [details]
Copy debuglink section to final libc.so.6

Comment 11 Ben Cotton 2022-08-09 13:16:53 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 37 development cycle.
Changing version to 37.

Comment 12 Arjun Shankar 2022-08-30 13:38:27 UTC
I'm working on getting this fixed. Benjamin, would it be okay with you if I mentioned your name and email address in the RPM changelog in order to attribute the wrap-find-debuginfo patch to you?

Comment 13 Benjamin Herrenschmidt 2022-08-31 05:43:33 UTC
Of course. I suggest that you use benh to reflect that this was done on my employer's time :-)

Comment 14 Arjun Shankar 2022-09-07 11:53:50 UTC
Thanks! I've pushed the fixes and built packages for Fedora 35, 36, 37, and Rawhide. I'll be filing a bodhi update in a bit.

Comment 15 Fedora Update System 2022-09-08 13:31:10 UTC
FEDORA-2022-403dca5e92 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-403dca5e92

Comment 16 Fedora Update System 2022-09-08 13:31:26 UTC
FEDORA-2022-9471e772b5 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-9471e772b5

Comment 17 Fedora Update System 2022-09-10 20:51:11 UTC
FEDORA-2022-9471e772b5 has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 18 Fedora Update System 2022-09-14 00:20:42 UTC
FEDORA-2022-403dca5e92 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.


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