|
From: Peter S. <Pet...@gm...> - 2003-10-17 14:40:45
|
> > We know about the problem, but there is no fix yet. As we play some
nasty
> > tricks with the stack, it is "okay" that gdb feels confused. It worked
> > before because gdb wasn't able to correctly disassemble the method in
older
> versions. Now it can, and we cannot trick it into unwinding the stack
> > correctly anymore. Another solution has to be found.
>
> Ok, it was easier than I thought, and I committed this patch, which makes
it
> work for me. let me know if you experience problems.
[snip patch]
The Patch worked partly, gdb is now able to show the stacktrace, plus the
one
extra frame with invalid data (see the following gdb trace of the example
programm given on the gdb-bug database).
The other problem was, with your patch on valgrind-20031012I needed the
latet snapshot release of the
gnu-assamler gas, because the installed version on Suse-8.2 (GNU assembler
2.13.90.0.18 20030121)
did not have the CFI support (even not the new 2.14 release).
~/valgrind_test> valgrind --gdb-attach=yes ./t
==3945== Memcheck, a.k.a. Valgrind, a memory error detector for x86-linux.
==3945== Copyright (C) 2002-2003, and GNU GPL'd, by Julian Seward.
==3945== Using valgrind-20031012, a program supervision framework for
x86-linux.
==3945== Copyright (C) 2000-2003, and GNU GPL'd, by Julian Seward.
==3945== Estimated CPU clock rate is 3119 MHz
==3945== For more details, rerun with: -v
==3945==
==3945== Invalid read of size 1
==3945== at 0x8048363: coin (t.c:4)
==3945== by 0x8048378: coincoin (t.c:7)
==3945== by 0x804838F: main (t.c:9)
==3945== by 0x4025C8AD: __libc_start_main (in /lib/libc.so.6)
==3945== Address 0x411BC029 is 0 bytes after a block of size 5 alloc'd
==3945== at 0x400299D8: malloc (vg_replace_malloc.c:153)
==3945== by 0x402C266F: __GI___strdup (in /lib/libc.so.6)
==3945== by 0x8048356: coin (t.c:3)
==3945== by 0x8048378: coincoin (t.c:7)
==3945==
==3945== ---- Attach to GDB ? --- [Return/N/n/Y/y/C/c] ---- y
==3945== starting GDB with cmd: /usr/bin/gdb -nw /proc/3945/exe 3945
GNU gdb 6.0
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
Attaching to program: /proc/3945/exe, process 3945
Reading symbols from /usr/local/lib/valgrind/vgskin_memcheck.so...done.
Loaded symbols for /usr/local/lib/valgrind/vgskin_memcheck.so
Reading symbols from /usr/local/lib/valgrind/valgrind.so...done.
Loaded symbols for /usr/local/lib/valgrind/valgrind.so
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
vg_do_syscall3 (syscallno=4294966784, arg1=3948, arg2=0, arg3=0)
at vg_mylibc.c:92
92 }
(gdb) bt
#0 vg_do_syscall3 (syscallno=4294966784, arg1=3948, arg2=0, arg3=0)
at vg_mylibc.c:92
#1 0x4018ba75 in vgPlain_system (
cmd=0xbfffde70 "/usr/bin/gdb -nw /proc/3945/exe 3945") at
vg_mylibc.c:1277
#2 0x4018828d in vgPlain_start_GDB_whilst_on_client_stack () at
vg_main.c:1816
#3 0x4018e6f0 in vgPlain_swizzle_esp_then_start_GDB ()
from /usr/local/lib/valgrind/valgrind.so
#4 0x08048363 in coin () at t.c:4
#5 0x08048363 in coin () at t.c:4
#6 0x08048379 in coincoin () at t.c:7
#7 0x08048390 in main () at t.c:9
(gdb) frame 5
#5 0x08048363 in coin () at t.c:4
4 int i = s[5];
(gdb) p s
$1 = 0x411bc024 "plop"
(gdb) frame 4
#4 0x08048363 in coin () at t.c:4
4 int i = s[5];
(gdb) p s
$2 = 0x4018e6f0
"\213-º¡\035@\213%¾¡\035@aÃ\220\220\203ì\024\211\\$\020\213\\$\0
30\205Ûu$ÇD$\ff\b\035@ÇD$\b\205"
(gdb)
--
NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService
Jetzt kostenlos anmelden unter http://www.gmx.net
+++ GMX - die erste Adresse für Mail, Message, More! +++
|