Hi. Trying to get valgrind to attach to GDB at run-time -- which fails. I'm=20 suspecting i need to specify the string "gdb" somewhere for it to find=20 gdb -- since runnin 'gdb -nw /proc/13594/exe 13594' does what I want it t= o. Log follows: pvz@tanya:~/src/tvtime-0.9.11/src$ valgrind --skin=3Dmemcheck=20 --gdb-attach=3Dyes ./tvtime =3D=3D13594=3D=3D Memcheck, a.k.a. Valgrind, a memory error detector for = x86-linux. =3D=3D13594=3D=3D Copyright (C) 2002-2003, and GNU GPL'd, by Julian Sewar= d. =3D=3D13594=3D=3D Using valgrind-20031012, a program supervision framewor= k for=20 x86-linux. =3D=3D13594=3D=3D Copyright (C) 2000-2003, and GNU GPL'd, by Julian Sewar= d. =3D=3D13594=3D=3D Estimated CPU clock rate is 1207 MHz =3D=3D13594=3D=3D For more details, rerun with: -v =3D=3D13594=3D=3D K=F6r tvtime 0.9.11. =3D=3D13594=3D=3D Conditional jump or move depends on uninitialised value= (s) =3D=3D13594=3D=3D at 0x40008ABA: _dl_relocate_object_internal (in=20 /lib/ld-2.3.2.so) =3D=3D13594=3D=3D by 0x406B1CF0: (within /lib/libc-2.3.2.so) =3D=3D13594=3D=3D by 0x4000B115: _dl_catch_error_internal (in /lib/ld-= 2.3.2.so) =3D=3D13594=3D=3D by 0x406B1F5B: _dl_open (in /lib/libc-2.3.2.so) =3D=3D13594=3D=3D =3D=3D13594=3D=3D ---- Attach to GDB ? --- [Return/N/n/Y/y/C/c] ---- y =3D=3D13594=3D=3D starting GDB with cmd: -nw /proc/13594/exe 13594 /bin/sh: line 1: -nw: command not found =3D=3D13594=3D=3D =3D=3D13594=3D=3D GDB has detached. Valgrind regains control. We contin= ue. =3D=3D13594=3D=3D =3D=3D13594=3D=3D Conditional jump or move depends on uninitialised value= (s) =3D=3D13594=3D=3D at 0x40008B05: _dl_relocate_object_internal (in=20 /lib/ld-2.3.2.so) =3D=3D13594=3D=3D by 0x406B1CF0: (within /lib/libc-2.3.2.so) =3D=3D13594=3D=3D by 0x4000B115: _dl_catch_error_internal (in /lib/ld-= 2.3.2.so) =3D=3D13594=3D=3D by 0x406B1F5B: _dl_open (in /lib/libc-2.3.2.so) =3D=3D13594=3D=3D =3D=3D13594=3D=3D ---- Attach to GDB ? --- [Return/N/n/Y/y/C/c] ---- |
|
From: Dan K. <da...@ke...> - 2003-11-18 00:54:08
|
Per von Zweigbergk wrote: > Hi. > > Trying to get valgrind to attach to GDB at run-time -- which fails. I'm > suspecting i need to specify the string "gdb" somewhere for it to find > gdb -- since runnin 'gdb -nw /proc/13594/exe 13594' does what I want it to. > ... > ==13594== starting GDB with cmd: -nw /proc/13594/exe 13594 > /bin/sh: line 1: -nw: command not found FWIW, here are the hoops I had to jump through to get valgrind to let me launch gdb when valgrinding openoffice: http://kegel.com/openoffice/#valgrind.gdb Hopefully you won't have to do all that junk, but maybe it'll give you an idea. - Dan --- snip --- You can have valgrind launch gdb when it runs into an error; then you can do all the backtracing and printing of variabls you like. To do this, add the option --gdb-attach=yes. This doesn't work quite right, since OpenOffice appears to close stdin. Here's one way to work around that: 1. Create a little script named ~/rungdb containing #!/bin/sh XAUTHORITY=~/.Xauthority DISPLAY=127.0.0.1:0.0 /usr/X11R6/bin/xterm -e gdb "$@" Be sure to chmod +x ~/rungdb. The script is started without the normal environment variables, so you need to explicitly set any that are needed. The above is for Red Hat Linux 8.0. If the crash you're seeing happens to happen while the X display lock is held, you'll probably want to set DISPLAY to some other host's X display... that actually happened to me once. Then run OpenOffice with the command #!/bin/sh bin=/opt/OpenOffice.org1.1.0/program LD_LIBRARY_PATH=$bin valgrind -v --skin=addrcheck \ --gdb-attach=yes --gdb-command=~/rungdb \ $bin/soffice.bin That will pop up an xterm with a gdb inside it every time you say 'yes' when valgrind asks whether to start gdb. Note that all you can do in that gdb is get a backtrace; you can't continue the program. You must quit gdb before valgrind will continue. --- snip --- |
|
From: Dirk M. <dm...@gm...> - 2003-11-18 01:38:13
|
On Tuesday 18 November 2003 01:43, Per von Zweigbergk wrote: > Trying to get valgrind to attach to GDB at run-time -- which fails. I'm > suspecting i need to specify the string "gdb" somewhere for it to find > gdb -- since runnin 'gdb -nw /proc/13594/exe 13594' does what I want it to. apparently the package was miscompiled, report to the debian maintainer. it uses the path it found during ./configure. |
|
From: <ar...@de...> - 2003-11-18 01:39:35
|
Upgrade to the new valgrind version (1:2.0.0-3) of debian. Thanks. Per von Zweigbergk <pvz@e.kth.se> writes: > Hi. > > Trying to get valgrind to attach to GDB at run-time -- which > fails. I'm suspecting i need to specify the string "gdb" somewhere for > it to find gdb -- since runnin 'gdb -nw /proc/13594/exe 13594' does > what I want it to. > > > Log follows: > > pvz@tanya:~/src/tvtime-0.9.11/src$ valgrind --skin=memcheck > --gdb-attach=yes ./tvtime > ==13594== Memcheck, a.k.a. Valgrind, a memory error detector for x86-linux. > ==13594== Copyright (C) 2002-2003, and GNU GPL'd, by Julian Seward. > ==13594== Using valgrind-20031012, a program supervision framework for > x86-linux. > ==13594== Copyright (C) 2000-2003, and GNU GPL'd, by Julian Seward. > ==13594== Estimated CPU clock rate is 1207 MHz > ==13594== For more details, rerun with: -v > ==13594== > Kör tvtime 0.9.11. > ==13594== Conditional jump or move depends on uninitialised value(s) > ==13594== at 0x40008ABA: _dl_relocate_object_internal (in > /lib/ld-2.3.2.so) > ==13594== by 0x406B1CF0: (within /lib/libc-2.3.2.so) > ==13594== by 0x4000B115: _dl_catch_error_internal (in /lib/ld-2.3.2.so) > ==13594== by 0x406B1F5B: _dl_open (in /lib/libc-2.3.2.so) > ==13594== > ==13594== ---- Attach to GDB ? --- [Return/N/n/Y/y/C/c] ---- y > ==13594== starting GDB with cmd: -nw /proc/13594/exe 13594 > /bin/sh: line 1: -nw: command not found > ==13594== > ==13594== GDB has detached. Valgrind regains control. We continue. > ==13594== > ==13594== Conditional jump or move depends on uninitialised value(s) > ==13594== at 0x40008B05: _dl_relocate_object_internal (in > /lib/ld-2.3.2.so) > ==13594== by 0x406B1CF0: (within /lib/libc-2.3.2.so) > ==13594== by 0x4000B115: _dl_catch_error_internal (in /lib/ld-2.3.2.so) > ==13594== by 0x406B1F5B: _dl_open (in /lib/libc-2.3.2.so) > ==13594== > ==13594== ---- Attach to GDB ? --- [Return/N/n/Y/y/C/c] ---- > > > > > ------------------------------------------------------- > This SF. Net email is sponsored by: GoToMyPC > GoToMyPC is the fast, easy and secure way to access your computer from > any Web browser or wireless device. Click here to Try it Free! > https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users -- Andres Roldan Fluidsignal Group <ar...@fl...> The Debian Project <ar...@de...> GIGAX <ar...@gi...> GPG Key-ID 0xB29396EB Home Page http://people.fluidsignal.com/~aroldan |