Bug 1761318

Summary: .gnu_debugdata section for "minidebuginfo" is missing from many binaries in Fedora 29+
Product: [Fedora] Fedora Reporter: Dan Callaghan <djc>
Component: rpmAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: igor.raits, mjw, packaging-team-maint, pmatilai, pmoravco, vmukhame
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-10-14 06:39:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dan Callaghan 2019-10-14 06:07:18 UTC
Description of problem:
I was recently learning about "minidebuginfo", which is a neat feature:
https://sourceware.org/gdb/onlinedocs/gdb/MiniDebugInfo.html
but I was surprised to find a lot of binaries on my Fedora 29 system lack the .gnu_debugdata section described in that doc. I eventually figured out it is because of a problem in RPM's find-debuginfo.sh.

Version-Release number of selected component (if applicable):
rpm-4.14.2.1-2.fc29.x86_64
file-5.34-13.fc29.x86_64

How reproducible:
easily

Steps to Reproduce:
1. $ eu-readelf -Ws --elf-section /usr/bin/ls | grep FUNC.*LOCAL

Actual results:
eu-readelf: No such section '.gnu_debugdata' in '/usr/bin/ls'

Expected results:
List of local symbols, obtained from the minidebuginfo in .gnu_debugdata.

Additional info:
The section is missing from some binaries but not others. For example it is absent from /usr/bin/ls and /bin/bash but present in /usr/bin/zip.

I was looking into how the minidebuginfo is injected in find-debuginfo.sh and I noticed this block:

    skip_mini=true
    case "$(file -bi "$f")" in
      application/x-sharedlib*) skip_mini=false ;;
      application/x-executable*) skip_mini=false ;;
    esac

And indeed, the MIME type of some binaries is different (I'm not sure why):

$ file -bi /usr/bin/ls
application/x-pie-executable; charset=binary
$ file -bi /usr/bin/zip
application/x-executable; charset=binary

I did a bit of bisecting using old coreutils builds in Koji and found that the .gnu_debugdata is present in /usr/bin/ls up to coreutils-8.29-9.fc29 (2018-03-23) but absent from coreutils-8.29-10.fc29 (2018-04-20). So I guess something around that timeframe caused the output of file to change.

Comment 1 Mark Wielaard 2019-10-14 06:39:50 UTC
This was fixed as bug #1714804 but it would need a full rebuild of all packages missing the .gnu_debugdata to get it all back. Sorry.

*** This bug has been marked as a duplicate of bug 1714804 ***