Red Hat Bugzilla – Bug 151568
gdb breaks valgrind
Last modified: 2007-11-30 17:11:02 EST
Description of problem:
When valgrind is run under gdb, it does not work
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. gdb --args /usr/bin/valgrind --tool=memcheck ls
==10187== Memcheck, a memory error detector for x86-linux.
==10187== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward et al.
==10187== Using valgrind-2.2.0, a program supervision framework for x86-linux.
==10187== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward et al.
==10187== For more details, rerun with: -v
Program received signal SIGSEGV, Segmentation fault.
0xb0892c03 in ?? ()
Should work as normal
Additional info: valgrind-2.2.0-8
This issue also occurs on a fresh install on FC3 with all updates applied.
The same thing happens to me. I bounced a message about this to the
valgrind-users list, and no one had any ideas. I was able to work around it by
compiling my own gdb (v 6.3) from the original gnu source, and then forcing
valgrind to use that (which you probably already thought of, but it was worth
mentioning just in case). So, presumably the problem lies in redhat's patches
Also, when you run `valgrind --attach-db=yes --tool=memcheck ./foo`, when
valgrind hits a fault and attaches gdb, then the debugging symbols are all
trashed. Presumably these are symptoms to the same problem.
Created attachment 131436 [details]
.gdbinit script configuring SIGSEGV handling for gdb(1)
Tested on Fedora Core 5 gdb-126.96.36.199-1.122 and valgrind-3.1.0-2.
While I do not find much useful to debug the whole valgrind(1) wrapper you need
to configure SIGSEGV handling for gdb as it is used internally by valgrind.
Attached script (non)reproducibility by: gdb -nx
You're right - I just didn't configure SIGSEGV handling.