|
From: Boris M. <bor...@la...> - 2005-03-18 16:22:02
|
Hi, I am using current Valgrind version from CVS (on a Fedora Core 1 or 3 system, Intel P4). Valgrind with Memcheck (or Addrcheck or even Massif) does not see any of my memory allocation ! It always reports : ==11522== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) ==11522== malloc/free: in use at exit: 0 bytes in 0 blocks. ==11522== malloc/free: 0 allocs, 0 frees, 0 bytes allocated. ==11522== For counts of detected errors, rerun with: -v ==11522== No malloc'd blocks -- no leaks are possible. I use option : --leak-check=yes. I have only one processus (so no need to use --trace-children=yes as reported in the FAQ). On a very sinple program valgrind do report memory allocation. But It does not on my main application. I have not yet found a simple test case that reproduce this odd behavior. Any idea ? Besides, Valgrind with Massif sometime dies on the same application. Here is the output : ==23355== Massif, a space profiler for x86-linux. ==23355== Copyright (C) 2003, Nicholas Nethercote ==23355== Using valgrind-2.4.0.rc4, a program supervision framework for x86-linux. ==23355== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al. ==23355== Valgrind library directory: /usr/labri/mansenca/tools/lib/valgrind ==23355== Command line ==23355== ./test-toger ==23355== 10.0 ==23355== 30.0 ==23355== 5.0 ==23355== 1.5 ==23355== ../../Tests/00000296_5th.pnm ==23355== Startup, with flags: ==23355== --tool=massif ==23355== -v ==23355== --alloc-fn=memory_alloc ==23355== --alloc-fn=memory_calloc ==23355== --alloc-fn=memory_realloc ==23355== Contents of /proc/version: ==23355== Linux version 2.6.9-1.667 (bhc...@tw...) (gcc version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)) #1 Tue Nov 2 14:41:25 EST 2004 ==23355== census: 0 ms (took 0 ms) ==23355== Reading syms from /net/tera4/mansenca/toger/girl/src/test-toger (0x8048000) ==23355== object doesn't have a dynamic symbol table ==23355== Reading syms from /net/tera4/mansenca/tools/lib/valgrind/stage2 (0xF0000000) ==23355== Reading syms from /lib/ld-2.3.3.so (0xF1000000) ==23355== object doesn't have any debug info ==23355== Reading syms from /net/tera4/mansenca/tools/lib/valgrind/vgskin_massif.so (0xF6DB0000) ==23355== Reading syms from /lib/tls/libc-2.3.3.so (0xF6EC1000) ==23355== object doesn't have any debug info ==23355== Reading syms from /lib/libdl-2.3.3.so (0xF6FE9000) ==23355== object doesn't have any debug info ==23355== [...] ==23355== ==23355== census: 51101 ms (took 0 ms) ==23355== Total spacetime: 0 ms.B ==23355== heap: (n/a) ==23355== heap admin: (n/a) ==23355== stack(s): 0% --23355-- allocs: 0 --23355-- INTERNAL ERROR: Valgrind received a signal 8 (SIGFPE) - exiting --23355-- si_code=1 Fault EIP: 0xF6DB4FD3; Faulting address: 0xF6DB4FD3 --23355-- esp=0xF050AF20 valgrind: the `impossible' happened: Killed by fatal signal Basic block ctr is approximately 2291767228 ==23355== at 0xF6DB4FD3: print_summary (ms_main.c:1776) ==23355== by 0xF6DB517D: vgSkin_fini (ms_main.c:1809) ==23355== by 0xF006DA5E: vgSkinInternal_fini (vg_toolint.c:36) ==23355== by 0xF0030C40: vgPlain_shutdown_actions (vg_main.c:2683) ==23355== by 0xF0087C44: vgArch_thread_wrapper (core_os.c:77) sched status: running_tid=0 Note: see also the FAQ.txt in the source distribution. It contains workarounds to several common problems. If that doesn't help, please report this bug to: valgrind.kde.org In the bug report, send all the above text, the valgrind version, and what Linux distro you are using. Thanks. |
|
From: Tom H. <to...@co...> - 2005-03-18 16:35:47
|
In message <423...@la...>
Boris Mansencal <bor...@la...> wrote:
> I am using current Valgrind version from CVS (on a Fedora Core 1 or 3
> system, Intel P4).
>
> Valgrind with Memcheck (or Addrcheck or even Massif) does not see any
> of my memory allocation !
> It always reports :
> ==11522== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
> ==11522== malloc/free: in use at exit: 0 bytes in 0 blocks.
> ==11522== malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
> ==11522== For counts of detected errors, rerun with: -v
> ==11522== No malloc'd blocks -- no leaks are possible.
Is your program statically linked? If it is then valgrind won't be
able to see any of the calls to malloc/free etc.
> ==23355== Contents of /proc/version:
> ==23355== Linux version 2.6.9-1.667
> (bhc...@tw...) (gcc version 3.4.2 20041017 (Red
> Hat 3.4.2-6.fc3)) #1 Tue Nov 2 14:41:25 EST 2004
> ==23355== census: 0 ms (took 0 ms)
> ==23355== Reading syms from
> /net/tera4/mansenca/toger/girl/src/test-toger (0x8048000)
> ==23355== object doesn't have a dynamic symbol table
> ==23355== Reading syms from
> /net/tera4/mansenca/tools/lib/valgrind/stage2 (0xF0000000)
> ==23355== Reading syms from /lib/ld-2.3.3.so (0xF1000000)
> ==23355== object doesn't have any debug info
> ==23355== Reading syms from
> /net/tera4/mansenca/tools/lib/valgrind/vgskin_massif.so (0xF6DB0000)
> ==23355== Reading syms from /lib/tls/libc-2.3.3.so (0xF6EC1000)
> ==23355== object doesn't have any debug info
> ==23355== Reading syms from /lib/libdl-2.3.3.so (0xF6FE9000)
> ==23355== object doesn't have any debug info
> ==23355==
There's no obvious sign of it reading symbols for libc there, although
it might be in the bit you snipped. That might suggest a static link.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: Nicholas N. <nj...@cs...> - 2005-03-18 16:58:36
|
On Fri, 18 Mar 2005, Boris Mansencal wrote: > I am using current Valgrind version from CVS (on a Fedora Core 1 or 3 system, > Intel P4). > > Valgrind with Memcheck (or Addrcheck or even Massif) does not see any of my > memory allocation ! > It always reports : > ==11522== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) > ==11522== malloc/free: in use at exit: 0 bytes in 0 blocks. > ==11522== malloc/free: 0 allocs, 0 frees, 0 bytes allocated. > ==11522== For counts of detected errors, rerun with: -v > ==11522== No malloc'd blocks -- no leaks are possible. > > I use option : --leak-check=yes. > I have only one processus (so no need to use --trace-children=yes as reported > in the FAQ). > > On a very sinple program valgrind do report memory allocation. > But It does not on my main application. > I have not yet found a simple test case that reproduce this odd behavior. > > Any idea ? You haven't told us anything about your program. In your Massif output you have these lines: ==23355== --alloc-fn=memory_alloc ==23355== --alloc-fn=memory_calloc ==23355== --alloc-fn=memory_realloc Does your program use a custom allocator, rather than the standard malloc()? If so, you'll have to use the client requests for these (see the manual sections 2.7 and 3.7). The --alloc-fn option is for indicating when functions wrap functions that do allocation. > Besides, Valgrind with Massif sometime dies on the same application. > Here is the output : > [...] > --23355-- allocs: 0 > --23355-- INTERNAL ERROR: Valgrind received a signal 8 (SIGFPE) - exiting > --23355-- si_code=1 Fault EIP: 0xF6DB4FD3; Faulting address: 0xF6DB4FD3 > --23355-- esp=0xF050AF20 That's a bug, although it only occurs with -v so it's not critical. I'll fix it over the weekend. N |