Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 190815 - sys-devel/gdb "Failed to read valid object file image from memory" with some kernels
Summary: sys-devel/gdb "Failed to read valid object file image from memory" with some ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
: 191631 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-08-30 20:40 UTC by John Brooks
Modified: 2007-09-07 22:20 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
gdb_access_vsyscall_page_with_compat_vdso.patch (gdb_access_vsyscall_page_with_compat_vdso.patch,412 bytes, patch)
2007-08-30 23:29 UTC, Maarten Bressers (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Brooks 2007-08-30 20:40:56 UTC
As reported on the bug trackers for some other linux distributions, certain kernels (after 2.6.18) will not work with GDB, giving the message "Failed to read valid object file image from memory" and providing very broken backtraces or not working at all. There is lots of detail on the suse bug at https://bugzilla.novell.com/show_bug.cgi?id=258433

I was having this issue with a fresh gentoo install on the 2.6.22-gentoo-r5 kernel, using both normally emerged GDB and a USE="vanilla" GDB.

I applied a patch found in the bug I linked above (patch is at https://bugzilla.novell.com/attachment.cgi?id=159330) to the kernel, which seems to have worked (I no longer get the message, backtraces are fine, etc).

Reproducible: Always

Steps to Reproduce:
1. Run any program in GDB
2. The "failed to read valid object file image from memory" message is displayed
3. Halt the execution of the program, or crash it
4. Get a backtrace; the symbols will be extremely broken.
Comment 1 SpanKY gentoo-dev 2007-08-30 21:56:34 UTC
not a bug in the toolchain
Comment 2 Maarten Bressers (RETIRED) gentoo-dev 2007-08-30 22:17:12 UTC
Just to be sure, you're using COMPAT_VDSO=y, right? Can you test with the latest kernel prepatch, 2.6.23_rc4? That should fix it, since the required patch has been in since 2.6.23_rc1.
Comment 3 John Brooks 2007-08-30 22:23:24 UTC
Yes, I have COMPAT_VDSO=y. The patch I linked works; if that's the one or similar to the one in 2.6.23, it should work fine. I'll test it anyway if you want, although i've got no idea how to get that kernel version; it doesn't seem to be in portage anywhere.
Comment 4 Maarten Bressers (RETIRED) gentoo-dev 2007-08-30 22:35:28 UTC
Yes, the patch you linked to is the same one that's in rc4 now. Please test it, you can get that kernel like this:
# ACCEPT_KEYWORDS="~x86" emerge =sys-kernel/vanilla-sources-2.6.23_rc4
Comment 5 John Brooks 2007-08-30 22:56:01 UTC
influence ~ # uname -a
Linux influence 2.6.23-rc4 #1 Thu Aug 30 18:50:38 EDT 2007 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz GenuineIntel GNU/Linux

GDB starts without complaint, reads all of the symbols properly, and can read core dumps. Seems to fully work.
Comment 6 Maarten Bressers (RETIRED) gentoo-dev 2007-08-30 23:29:06 UTC
Please apply the attached patch to your gentoo-sources-2.6.22-r5, that should work as well. If it does, we'll incorporate it into the next version of gentoo-sources. Thank you for testing this.
Comment 7 Maarten Bressers (RETIRED) gentoo-dev 2007-08-30 23:29:56 UTC
Created attachment 129646 [details, diff]
gdb_access_vsyscall_page_with_compat_vdso.patch
Comment 8 John Brooks 2007-08-31 00:04:38 UTC
Yup; that fixes the issue on 2.6.22 as well. Glad to help ;)
Comment 9 Daniel Drake (RETIRED) gentoo-dev 2007-09-01 03:07:03 UTC
Maarten, please include the full patch header when attaching and committing, even if you modified or remade it yourself

(if you used quilt it would take care of this for you)
Comment 10 Maarten Bressers (RETIRED) gentoo-dev 2007-09-01 20:51:10 UTC
The patch has been included in gentoo-sources-2.6.22-r6.
Comment 11 Jakub Moc (RETIRED) gentoo-dev 2007-09-07 22:20:05 UTC
*** Bug 191631 has been marked as a duplicate of this bug. ***