Bug 1110598 - kernel-3.16 breaks gdb vdso debugging
Summary: kernel-3.16 breaks gdb vdso debugging
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: binutils
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nick Clifton
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-18 04:19 UTC by Andy Lutomirski
Modified: 2014-07-09 01:14 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-07-09 01:14:26 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Andy Lutomirski 2014-06-18 04:19:29 UTC
For Linux 3.16, the vdso is heavily stripped.  Specifically, on x86_64, there's a fake section table that contains only one entry of type SHT_DYNSYM (to work around a Go bug).  On i386 and x32, there is no section table at all.  For now, e_shstrndx == 0.

This ought to be fine: things that read ELF files from memory have no business looking at the section table at all.  Unfortunately, symbol_file_add_from_memory (which is the function responsible for digging up the vdso symbols) doesn't ever call any of the section_from_phdr functions, which means that it doesn't try to load the segment table, and it never notices the PT_NOTE segment.  That, in turn, prevents it from detecting the build-id and finding the real symbol file.

I'd be happy to help (a bit) and to make hopefully minimal changes to the kernel to make this better.

I have a prototype patch to add a more complete fake section table, and it works, but this approach sucks.  Not only is it a lie, but it wastes a bunch of space in the vdso image in memory.

Comment 1 Andy Lutomirski 2014-06-18 04:42:07 UTC
Upstream bug here: https://sourceware.org/bugzilla/show_bug.cgi?id=17064

Comment 2 Andy Lutomirski 2014-07-09 01:14:26 UTC
Closing for now -- the relevant kernel change was mostly reverted.


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