|
From: Jay M. <jkm...@gm...> - 2005-11-08 16:09:50
|
Hi, When I tried to run valgrind 3.0.1 and 2.4.1 I ran into a segmentation faul= t even while running small programs. valgrind -v ls -al =3D=3D6755=3D=3D Memcheck, a memory error detector for x86-linux. =3D=3D6755=3D=3D Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward e= t al. =3D=3D6755=3D=3D Using valgrind-2.4.1, a program supervision framework for x86-linux. =3D=3D6755=3D=3D Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward e= t al. =3D=3D6755=3D=3D Valgrind library directory: ~/bin/lib/valgrind =3D=3D6755=3D=3D Command line =3D=3D6755=3D=3D ls =3D=3D6755=3D=3D -al =3D=3D6755=3D=3D Startup, with flags: =3D=3D6755=3D=3D -v =3D=3D6755=3D=3D Contents of /proc/version: =3D=3D6755=3D=3D Linux version 2.4.26-mosix (root@dcpc1) (gcc version 3.3.4= ) #3 SMP Tue Jul 27 11:33:54 EDT 2004 =3D=3D6755=3D=3D Reading syms from /lib/ld-2.3.4.so <http://2.3.4.so> (0x77= E1000) =3D=3D6755=3D=3D object doesn't have any debug info =3D=3D6755=3D=3D Reading syms from /bin/ls (0x8048000) =3D=3D6755=3D=3D object doesn't have a symbol table =3D=3D6755=3D=3D object doesn't have any debug info =3D=3D6755=3D=3D Reading syms from ~/bin/lib/valgrind/stage2 (0x30000000) =3D=3D6755=3D=3D Reading syms from /lib/ld-2.3.4.so <http://2.3.4.so> (0x31= 000000) =3D=3D6755=3D=3D object doesn't have any debug info =3D=3D6755=3D=3D Reading syms from /lib/libdl-2.3.4.so <http://2.3.4.so>(0x= 40015000) =3D=3D6755=3D=3D object doesn't have any debug info =3D=3D6755=3D=3D Reading syms from /lib/libc-2.3.4.so <http://2.3.4.so> (0x= 40019000) =3D=3D6755=3D=3D object doesn't have any debug info =3D=3D6755=3D=3D Reading syms from ~/bin/lib/valgrind/vgskin_memcheck.so (0x40237000) =3D=3D6755=3D=3D Reading suppressions file: ~/bin/lib/valgrind/default.supp =3D=3D6755=3D=3D =3D=3D6755=3D=3D =3D=3D6755=3D=3D Process terminating with default action of signal 11 (SIGS= EGV) =3D=3D6755=3D=3D at 0x77E1C9C: dl_main (in /lib/ld-2.3.4.so <http://2.3.4.s= o>) =3D=3D6755=3D=3D by 0x77EE029: _dl_sysdep_start (in /lib/ld-2.3.4.so<http:/= /2.3.4.so> ) =3D=3D6755=3D=3D by 0x77E1AB5: _dl_start (in /lib/ld-2.3.4.so <http://2.3.4= .so>) =3D=3D6755=3D=3D by 0x77E17A6: (within /lib/ld-2.3.4.so <http://2.3.4.so>) =3D=3D6755=3D=3D =3D=3D6755=3D=3D ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 fro= m 0) =3D=3D6755=3D=3D malloc/free: in use at exit: 0 bytes in 0 blocks. =3D=3D6755=3D=3D malloc/free: 0 allocs, 0 frees, 0 bytes allocated. =3D=3D6755=3D=3D =3D=3D6755=3D=3D No malloc'd blocks -- no leaks are possible. --6755-- TT/TC: 0 tc sectors discarded. --6755-- 102 tt_fast misses. --6755-- translate: new 102 (1683 -> 22096; ratio 131:10) --6755-- discard 0 (0 -> 0; ratio 0:10). --6755-- chainings: 29 chainings, 0 unchainings. --6755-- dispatch: 295 jumps (bb entries); of them 109 (36%) unchained. --6755-- 1/105 major/minor sched events. --6755-- reg-alloc: 20 t-req-spill, 3960+216 orig+spill uis, --6755-- 558 total-reg-rank --6755-- sanity: 2 cheap, 1 expensive checks. --6755-- ccalls: 280 C calls, 55% saves+restores avoided (914 bytes) --6755-- 383 args, avg 0.86 setup instrs each (106 bytes) --6755-- 0% clear the stack (840 bytes) --6755-- 134 retvals, 18% of reg-reg movs avoided (46 bytes) Segmentation fault valgrind -v ls -al =3D=3D14940=3D=3D Memcheck, a memory error detector. =3D=3D14940=3D=3D Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward = et al. =3D=3D14940=3D=3D Using LibVEX rev 1367, a library for dynamic binary trans= lation. =3D=3D14940=3D=3D Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP. =3D=3D14940=3D=3D Using valgrind-3.0.1, a dynamic binary instrumentation fr= amework. =3D=3D14940=3D=3D Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward = et al. --14940-- Valgrind library directory: ~/bin/lib/valgrind --14940-- Command line --14940-- ls --14940-- -al --14940-- Startup, with flags: --14940-- -v --14940-- Contents of /proc/version: --14940-- Linux version 2.4.26-mosix (root@dcpc1) (gcc version 3.3.4) #3 SM= P Tue Jul 27 11:33:54 EDT 2004 --14940-- Reading syms from /bin/ls (0x8048000) --14940-- object doesn't have a symbol table --14940-- Reading syms from /lib/ld-2.3.4.so <http://2.3.4.so> (0x1B8E4000) --14940-- Reading syms from ~/bin/lib/valgrind/stage2 (0xB0000000) --14940-- Reading suppressions file: ~/bin/lib/valgrind/default.supp =3D=3D14940=3D=3D --14940-- Reading syms from ~/bin/lib/valgrind/vg_preload_core.so (0x1B8FB000) --14940-- Reading syms from ~/bin/lib/valgrind/vgpreload_memcheck.so (0x1B8FD000) --14940-- REDIR: 0x1B8F3E30 (index) redirected to 0x1B9003C0 (index) --14940-- REDIR: 0x1B8F3FE0 (strlen) redirected to 0x1B900630 (strlen) --14940-- Reading syms from /lib/librt-2.3.4.so <http://2.3.4.so>(0x1B91900= 0) --14940-- Reading syms from /lib/libc-2.3.4.so <http://2.3.4.so>(0x1B92C000= ) --14940-- Reading syms from /lib/libdl-2.3.4.so <http://2.3.4.so>(0x1BA4900= 0) --14940-- Reading syms from /lib/libpthread-0.10.so <http://0.10.so>(0x1BA4= D000) --14940-- REDIR: 0x1B993810 (rindex) redirected to 0x1B900280 (rindex) --14940-- REDIR: 0x1B992F20 (strcmp) redirected to 0x1B9008C0 (strcmp) --14940-- REDIR: 0x1B9934A0 (strlen) redirected to 0x1B900610 (strlen) --14940-- REDIR: 0x1B993690 (strncmp) redirected to 0x1B900860 (strncmp) --14940-- REDIR: 0x1B992DB0 (index) redirected to 0x1B900390 (index) --14940-- REDIR: 0x1B98D710 (malloc) redirected to 0x1B8FE9FC (malloc) --14940-- REDIR: 0x1B994120 (memchr) redirected to 0x1B900940 (memchr) --14940-- REDIR: 0x1B9948A0 (memcpy) redirected to 0x1B900970 (memcpy) --14940-- REDIR: 0x1B98D990 (realloc) redirected to 0x1B8FFD5A (realloc) --14940-- REDIR: 0x1B98D8D0 (free) redirected to 0x1B8FF4F3 (free) --14940-- REDIR: 0x1B993550 (strnlen) redirected to 0x1B9005D0 (strnlen) --14940-- REDIR: 0x1B994560 (stpcpy) redirected to 0x1B900B40 (stpcpy) --14940-- REDIR: 0x1B9951F0 (rawmemchr) redirected to 0x1B900E40 (rawmemchr= ) =3D=3D14940=3D=3D =3D=3D14940=3D=3D Process terminating with default action of signal 11 (SIG= SEGV) =3D=3D14940=3D=3D at 0x1BA15331: open_socket (in /lib/libc-2.3.4.so<http://= 2.3.4.so> ) =3D=3D14940=3D=3D by 0x1BA15492: get_mapping (in /lib/libc-2.3.4.so<http://= 2.3.4.so> ) =3D=3D14940=3D=3D by 0x1BA15120: __nscd_get_map_ref (in /lib/libc-2.3.4.so<http://2.3.4.so> ) =3D=3D14940=3D=3D by 0x1BA13746: nscd_getpw_r (in /lib/libc-2.3.4.so<http:/= /2.3.4.so> ) =3D=3D14940=3D=3D by 0x1BA136EA: __nscd_getpwuid_r (in /lib/libc-2.3.4.so<http://2.3.4.so> ) =3D=3D14940=3D=3D by 0x1B9B3376: getpwuid_r@@GLIBC_2.1.2 (in /lib/libc-2.3.4.so<http://2.3.4.so> ) =3D=3D14940=3D=3D by 0x1B9B2D3E: getpwuid (in /lib/libc-2.3.4.so <http://2.= 3.4.so>) =3D=3D14940=3D=3D by 0x8052323: (within /bin/ls) =3D=3D14940=3D=3D by 0x804D068: (within /bin/ls) =3D=3D14940=3D=3D by 0x804BE3B: (within /bin/ls) =3D=3D14940=3D=3D by 0x804B4BF: (within /bin/ls) =3D=3D14940=3D=3D by 0x8049D7C: (within /bin/ls) =3D=3D14940=3D=3D =3D=3D14940=3D=3D Process terminating with default action of signal 11 (SIG= SEGV) =3D=3D14940=3D=3D at 0x1B8FB899: _vgw_freeres (vg_preloaded.c:58) =3D=3D14940=3D=3D by 0x1BA15492: get_mapping (in /lib/libc-2.3.4.so<http://= 2.3.4.so> ) =3D=3D14940=3D=3D by 0x1BA15120: __nscd_get_map_ref (in /lib/libc-2.3.4.so<http://2.3.4.so> ) =3D=3D14940=3D=3D by 0x1BA13746: nscd_getpw_r (in /lib/libc-2.3.4.so<http:/= /2.3.4.so> ) =3D=3D14940=3D=3D by 0x1BA136EA: __nscd_getpwuid_r (in /lib/libc-2.3.4.so<http://2.3.4.so> ) =3D=3D14940=3D=3D by 0x1B9B3376: getpwuid_r@@GLIBC_2.1.2 (in /lib/libc-2.3.4.so<http://2.3.4.so> ) =3D=3D14940=3D=3D by 0x1B9B2D3E: getpwuid (in /lib/libc-2.3.4.so <http://2.= 3.4.so>) =3D=3D14940=3D=3D by 0x8052323: (within /bin/ls) =3D=3D14940=3D=3D by 0x804D068: (within /bin/ls) =3D=3D14940=3D=3D by 0x804BE3B: (within /bin/ls) =3D=3D14940=3D=3D by 0x804B4BF: (within /bin/ls) =3D=3D14940=3D=3D by 0x8049D7C: (within /bin/ls) =3D=3D14940=3D=3D =3D=3D14940=3D=3D ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 22 f= rom 3) --14940-- --14940-- supp: 3 index-not-intercepted-early-enough-HACK-3 --14940-- supp: 17 dl_relocate_object --14940-- supp: 2 strlen/*dl_map_object*(Cond) =3D=3D14940=3D=3D malloc/free: in use at exit: 16795 bytes in 15 blocks. =3D=3D14940=3D=3D malloc/free: 18 allocs, 3 frees, 18223 bytes allocated. =3D=3D14940=3D=3D =3D=3D14940=3D=3D searching for pointers to 15 not-freed blocks. =3D=3D14940=3D=3D checked 414100 bytes. =3D=3D14940=3D=3D =3D=3D14940=3D=3D LEAK SUMMARY: =3D=3D14940=3D=3D definitely lost: 0 bytes in 0 blocks. =3D=3D14940=3D=3D possibly lost: 0 bytes in 0 blocks. =3D=3D14940=3D=3D still reachable: 16795 bytes in 15 blocks. =3D=3D14940=3D=3D suppressed: 0 bytes in 0 blocks. =3D=3D14940=3D=3D Reachable blocks (those to which a pointer was found) are= not shown. =3D=3D14940=3D=3D To see them, rerun with: --show-reachable=3Dyes --14940-- memcheck: sanity checks: 1 cheap, 1 expensive --14940-- memcheck: auxmaps: 0 auxmap entries (0k, 0M) in use --14940-- memcheck: auxmaps: 0 searches, 0 comparisons --14940-- memcheck: secondaries: 13 issued (832k, 0M) --14940-- memcheck: secondaries: 20 accessible and distinguished (1280k, 1M= ) --14940-- tt/tc: 5346 tt lookups requiring 5473 probes --14940-- tt/tc: 5346 fast-cache updates, 4 flushes --14940-- translate: new 2568 (51447 -> 842166; ratio 163:10) [0 scs] --14940-- translate: dumped 0 (0 -> ??) --14940-- translate: discarded 7 (199 -> ??) --14940-- scheduler: 87643 jumps (bb entries). --14940-- scheduler: 1/2888 major/minor sched events. --14940-- sanity: 2 cheap, 1 expensive checks. --14940-- exectx: 4999 lists, 30 contexts (avg 0 per list) --14940-- exectx: 43 searches, 13 full compares (302 per 1000) --14940-- exectx: 0 cmp2, 69 cmp4, 0 cmpAll Segmentation fault I finally tracked it down using strace and gdb to be happening in the open_mmap call while loading stage2. I found that I have only about 49MB of free memory (512 MB of actual) on this system. When I changed KICKSTART_BAS= E to 0x30000000 the segmentation fault went away and the program worked. I then ran valgrind on another system with about 306MB of free memory (1GB of actual) and it ran without a problem with the KICKSTART_BASE at the default of 0xb0000000. There seems to be some interaction with the amount of free memory in the system and the BASE. My system is running the following: Linux version 2.4.26 (root@tree) (gcc version 3.3.4) #6 Mon Jun 14 19:07:27 PDT 2004 Jay |
|
From: Tom H. <to...@co...> - 2005-11-08 16:50:15
|
In message <16c...@ma...>
Jay Menon <jkm...@gm...> wrote:
> I finally tracked it down using strace and gdb to be happening in the
> open_mmap call while loading stage2. I found that I have only about 49MB of
> free memory (512 MB of actual) on this system. When I changed KICKSTART_BASE
> to 0x30000000 the segmentation fault went away and the program worked.
> I then ran valgrind on another system with about 306MB of free memory (1GB
> of actual) and it ran without a problem with the KICKSTART_BASE at the
> default of 0xb0000000.
Use the SVN code with the new address space manager and all will be well.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: Nicholas N. <nj...@cs...> - 2005-11-08 16:50:30
|
On Tue, 8 Nov 2005, Jay Menon wrote: > When I tried to run valgrind 3.0.1 and 2.4.1 I ran into a segmentation fault > even while running small programs. > > [...] > > I finally tracked it down using strace and gdb to be happening in the > open_mmap call while loading stage2. I found that I have only about 49MB of > free memory (512 MB of actual) on this system. When I changed KICKSTART_BASE > to 0x30000000 the segmentation fault went away and the program worked. > I then ran valgrind on another system with about 306MB of free memory (1GB > of actual) and it ran without a problem with the KICKSTART_BASE at the > default of 0xb0000000. > > There seems to be some interaction with the amount of free memory in the > system and the BASE. > > My system is running the following: > Linux version 2.4.26 (root@tree) (gcc version 3.3.4) #6 Mon Jun 14 19:07:27 > PDT 2004 Thanks for the detailed report. The code in the SVN repository is much improved in the way it handles memory (and will be released as 3.1.0 later this month). Can you try it out and see if the problem persists? See http://www.valgrind.org/downloads/repository.html for how to access the repository. Thanks. Nick |