Bug 1761318 - .gnu_debugdata section for "minidebuginfo" is missing from many binaries in Fedora 29+
Summary: .gnu_debugdata section for "minidebuginfo" is missing from many binaries in F...
Keywords:
Status: CLOSED DUPLICATE of bug 1714804
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 29
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-10-14 06:07 UTC by Dan Callaghan
Modified: 2019-10-14 06:39 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-14 06:39:50 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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 ***


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