Bug 351692 - Dumps created by valgrind are not readable by gdb
Summary: Dumps created by valgrind are not readable by gdb
Status: CLOSED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.10.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-24 13:06 UTC by Mikhail Baikov
Modified: 2017-03-18 13:42 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
This core was created by valgrind (1.16 MB, application/x-core)
2015-08-24 13:06 UTC, Mikhail Baikov
Details
This core was created by system (200.00 KB, application/octet-stream)
2015-08-24 13:11 UTC, Mikhail Baikov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Baikov 2015-08-24 13:06:41 UTC
Created attachment 94197 [details]
This core was created by valgrind

I've got a problem while reading core dumps created by valgrind. I compiled code that causes segfault and ran the output binary with valgrind and without it (setting ulimit -c unlimited).
The code is
int main()
{
    const char *str = "segfault";
    *(char *)str = 'a';
    return 1;
}

Core dumps were created in both cases, one by valgrind and another by system
When I read the system created core dump it's readable
Core was generated by `./seg'.
Program terminated with signal 11, Segmentation fault.
#0  0x004006d0 in main () at ./seg.c:4

When I try to read the core dump created by valgrind, gdb is unable to read it
warning: Couldn't find general-purpose registers in core file.

warning: Could not load shared library symbols for 5 libraries, e.g. /bin/valgrind/lib/valgrind/vgpreload_core-mips32-linux.so.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
Core was generated by `'.

warning: Couldn't find general-purpose registers in core file.
../../gdb-7.3.1/gdb/frame-unwind.c:133: internal-error: frame_unwind_find_by_frame failed
A problem internal to GDB has been detected,
further debugging may prove unreliable.

One of the important things is that valgrind was compiled for mipsel. I see that gdb can't find general-purpose registers in core file so maybe valgrind compiled for mipsel CPU adds these registers with some wrong offset?
Comment 1 Mikhail Baikov 2015-08-24 13:11:44 UTC
Created attachment 94198 [details]
This core was created by system
Comment 2 Petar Jovanovic 2016-10-19 17:52:03 UTC
This should have been fixed by r16080. Thanks for reporting this problem.
Comment 3 Petar Jovanovic 2017-03-17 12:54:13 UTC
This issue should be closed now.
Comment 4 Mikhail Baikov 2017-03-18 13:42:52 UTC
Yep. It has been fixed in VG 3.12. Fixed. Closed