Bug 881369 - Dwarf Compression breaks .gnu_debuglink crc32 reference
Summary: Dwarf Compression breaks .gnu_debuglink crc32 reference
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 18
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-28 19:29 UTC by Brent Baude
Modified: 2012-11-29 07:31 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-11-29 07:31:13 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Brent Baude 2012-11-28 19:29:59 UTC
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
value.



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
63574eb1


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 07:25:40 UTC
Reassigning to dwarf compression feature owner.

Comment 2 Jakub Jelinek 2012-11-29 07:31:13 UTC
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.


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