Bug 881369

Summary: Dwarf Compression breaks .gnu_debuglink crc32 reference
Product: [Fedora] Fedora Reporter: Brent Baude <bbaude>
Component: rpmAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 18CC: alexl, ffesti, jakub, jnovy, jzeleny, karsten, maynardj, packaging-team, pknirsch, pmatilai
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-11-29 02:31:13 EST Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description Brent Baude 2012-11-28 14:29:59 EST
Description of problem:

Whenever we create a separate debug info file we record a reference
to the separate debug info file in a .gnu_debuglink section in the
original binary. This contains the filename of the debug file and the
crc32 checksum (so that we can ensure it matches the real file and not
some other version). (Additionally we record a build id in the main
binary and allow lookup of debuginfo via that, but some things like
oprofile still rely on the old crc32 version).

With the addition of the new dwarf compression we (optionally) run a
debug info compression utility on the separate debuginfo files (as
part of the /usr/lib/rpm/find-debuginfo.sh script). This makes them a
lot smaller and thus gives smaller debuginfo packages.

However, this also modifies the separate debug info files giving them
different crc32 checksums than what was originally stored in the main
binary in the .gnu_debuglink section. This means that separate
debuginfo lookup via this is broken. After compressing the debug info
we need to update the crc32 value in the main binary to the the new

How reproducible:

If we take a sample binary to peek at, like ls, we can obtain what the stripped binary thinks is the crc32.

[]# readelf -x .gnu_debuglink /usr/bin/ls

Hex dump of section '.gnu_debuglink':
  0x00000000 6c732e64 65627567 00000000 a9a5c382 ls.debug........

Then if we look at the debuginfo file, it doesn't match.

[]# crc32 /usr/lib/debug/usr/bin/ls.debug

Also note, there is a separate bug filed for openprofile. The current thinking there is to resolve debuginfo by build-id like gdb.  But the crc method needs to be fixed as it is a fallback for things like gdb as well.
Comment 1 Panu Matilainen 2012-11-29 02:25:40 EST
Reassigning to dwarf compression feature owner.
Comment 2 Jakub Jelinek 2012-11-29 02:31:13 EST
There is nothing that can be done about that, the compressor has access just to the separate debug file, not the original file, thus it can't modify the corresponding .gnu_debuglink section.  But it is not a big deal, just ignore the crc32 and use build-id.  Doing crc32 of the whole debug file is extremely slow anyway.