Bug 283154 - debuginfo not found because of unaligned CRC
Summary: debuginfo not found because of unaligned CRC
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.7 SVN
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-01 20:14 UTC by John Reiser
Modified: 2011-10-02 10:27 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Reiser 2011-10-01 20:14:43 UTC
Version:           3.7 SVN (using Devel) 
OS:                Linux

Running "valgrind -v -v -d ..." on armv5tel, which garbles mis-aligned memory fetch, I see:
--2939--   Considering /usr/lib/debug/lib/arm-linux-gnueabi/librt-2.13.so ..
--2939--   .. CRC mismatch (computed 9ca1b344 wanted 0000b344)
which obviously is a bug: the top 16 bits of a true match have been zeroed.

The fix is:
--- coregrind/m_debuginfo/readelf.c     (revision 12072)
             /* Extract the CRC from the debuglink section */
-            crc = *(UInt *)(debuglink_img + crc_offset);
+            crc = read_UInt(debuglink_img + crc_offset);
and copy read_UInt() and host_is_little_endian() from readdwarf.c.

Reproducible: Always

Steps to Reproduce:
Run "valgrind -v -v -d /bin/date" on armv5tel (sheevaplug, nslu2, ...).

Actual Results:  
--2939--   Considering /usr/lib/debug/lib/arm-linux-gnueabi/librt-2.13.so ..
--2939--   .. CRC mismatch (computed 9ca1b344 wanted 0000b344)

Expected Results:  
No complaint.

Similar to bug 282527, but that concentrates on DWARFn, while this is plain ELF.
Comment 1 Tom Hughes 2011-10-02 10:27:14 UTC
Committed as r12081 and r12082.