|
From: John G. <jg...@gm...> - 2005-01-19 19:50:49
|
Valgrind version is 2.0.0
I'm consistently getting a seg fault and core dump while running this
vsimple code:
#include<stdio.h>
int main(void) {
printf("hello\n");
return 0;
}
(tried both with and without --alignment flag to the same effect).
[jgoebel@yakut03 tmp]$ valgrind -v --alignment=16 ./foo
==8877== Memcheck, a.k.a. Valgrind, a memory error detector for x86-linux.
==8877== Copyright (C) 2002-2003, and GNU GPL'd, by Julian Seward.
==8877== Using valgrind-2.0.0, a program supervision framework for x86-linux.
==8877== Copyright (C) 2000-2003, and GNU GPL'd, by Julian Seward.
==8877== Command line:
==8877== ./foo
==8877== Startup, with flags:
==8877== --suppressions=/afs/slac.stanford.edu/package/valgrind/2.0.0/i386_rh
el30/lib/valgrind/default.supp
==8877== -v
==8877== --alignment=16
==8877== Reading syms from /afs/slac.stanford.edu/package/valgrind/2.0.0/i386_rh
el30/lib/valgrind/valgrind.so
==8877== Reading syms from /lib/libc-2.3.2.so
==8877== object doesn't have any debug info
==8877== Reading syms from /lib/ld-2.3.2.so
==8877== object doesn't have any debug info
==8877== Reading syms from /afs/slac.stanford.edu/package/valgrind/2.0.0/i386_rh
el30/lib/valgrind/vgskin_memcheck.so
==8877== Reading syms from /tmp/foo
==8877== Reading suppressions file: /afs/slac.stanford.edu/package/valgrind/2.0.
0/i386_rhel30/lib/valgrind/default.supp
==8877== Estimated CPU clock rate is 1796 MHz
==8877==
Segmentation fault (core dumped)
[jgoebel@yakut03 tmp]$ gdb -c core.8877 ./foo
GNU gdb Red Hat Linux (6.1post-1.20040607.17rh)
Copyright 2004 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 "i386-redhat-linux-gnu"...Using host libthread_db lib
rary "/lib/tls/libthread_db.so.1".
Core was generated by `./foo'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from
/afs/slac.stanford.edu/package/valgrind/2.0.0/i386_rhel30/lib/valgrind/vgskin_memcheck.so...done.
Loaded symbols for
/afs/slac.stanford.edu/package/valgrind/2.0.0/i386_rhel30/lib/valgrind/vgskin_memcheck.so
Reading symbols from
/afs/slac.stanford.edu/package/valgrind/2.0.0/i386_rhel30/lib/valgrind/valgrind.so...done.
Loaded symbols for
/afs/slac.stanford.edu/package/valgrind/2.0.0/i386_rhel30/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
#0 0x00217838 in vgPlain_stack ()
from /afs/slac.stanford.edu/package/valgrind/2.0.0/i386_rhel30/lib/valgrind/valgrind.so
(gdb) where
#0 0x00217838 in vgPlain_stack ()
from /afs/slac.stanford.edu/package/valgrind/2.0.0/i386_rhel30/lib/valgrind/valgrind.so
#1 0x0019bce7 in vgPlain_vprintf (send=0x19c031 <vgPlain_sprintf+58>,
format=0x1d6dc0 "after allocation of sector %d (size %d)",
vargs=0x1d6dc0 "after allocation of sector %d (size %d)")
at vg_mylibc.c:523
#2 0x0019c031 in vgPlain_sprintf (buf=0x21786c "`\002\036",
format=0x1ef9c0 "") at vg_mylibc.c:677
#3 0x001bc2ba in maybe_commission_sector () at vg_transtab.c:384
#4 0x001bc376 in allocate (nBytes=84) at vg_transtab.c:422
#5 0x001bc4e6 in vgPlain_add_to_trans_tab (orig_addr=97, orig_size=1701780,
trans_addr=1, trans_size=70, jumps=0x217934) at vg_transtab.c:508
#6 0x00182664 in create_translation_for (tid=8851480, orig_addr=1701780)
at vg_scheduler.c:344
#7 0x001842e8 in vgPlain_scheduler () at vg_scheduler.c:1407
#8 0x00198ff6 in vgPlain_main () at vg_main.c:1552
#9 0x00000000 in ?? ()
#10 0xabec3a59 in ?? ()
#11 0xabec3a5d in ?? ()
#12 0xabec3aa1 in ?? ()
#13 0xabec3aa5 in ?? ()
#14 0xabec3aa9 in ?? ()
#15 0xabec3aad in ?? ()
#16 0xabec3ab1 in ?? ()
#17 0xabec3ab5 in ?? ()
#18 0xabec3ab9 in ?? ()
#19 0xabec3abd in ?? ()
#20 0xbfffb688 in ?? ()
#21 0x00000000 in ?? ()
#22 0x00000000 in ?? ()
#23 0x00000000 in ?? ()
#24 0x00000000 in ?? ()
#25 0x00000000 in ?? ()
#26 0x00000000 in ?? ()
#27 0x00000000 in ?? ()
#28 0x00def5fb in vgMemCheck_helperc_LOADV2 (a=2193464) at mc_main.c:842
#29 0x00def669 in vgMemCheck_helperc_LOADV1 (a=2193464) at mc_main.c:886
#30 0x00def5c1 in vgMemCheck_helperc_STOREV4 (a=16779264, vbytes=3076494160)
at mc_main.c:819
#31 0x00def636 in vgMemCheck_helperc_STOREV2 (a=2193480, vbytes=14612073)
at mc_main.c:863
#32 0x00defec4 in vgMemCheck_fpu_read_check (addr=2193480, size=2193464)
at mc_main.c:1205
#33 0x00defde4 in vgMemCheck_helperc_value_check4_fail () at mc_main.c:1109
#34 0x00df451c in vgMemCheck_helper_value_check0_fail ()
---Type <return> to continue, or q <return> to quit---q
from /afs/slac.stanfordQuit
(gdb) x/i 0x0019bce7
0x19bce7 <vgPlain_vprintf+75>: incl 0x8(%esp)
(gdb) x/i 0x00217838
0x217838 <vgPlain_stack+39640>: mov $0x217848,%ecx
So it's a mov that consistently segfaults.
Any clue on how to get better debugging information or what might be wrong?
Thanks,
John
|