|
From: <fr...@be...> - 2005-10-11 15:25:32
|
Hi,
i'm using a svn-version of valgrind in a uclibc-chroot
(uclibc-0.98).
My problem is that it fails to catch memleaks.
frank@linux:~> cat main.c
int main() {
void* bla ;
int i;
for (i = 0; i < 10; i++) {
bla = (void*)malloc(10);
}
}
frank@linux:~> i386-linux-gcc main.c # uclibc toolchain
cp a.out $CHROOT
In chroot:
bash-3.00$ valgrind /a.out
==16527== Memcheck, a memory error detector.
==16527== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
==16527== Using LibVEX rev 1418, a library for dynamic binary translation.
==16527== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP.
==16527== Using valgrind-3.1.SVN, a dynamic binary instrumentation framework.
==16527== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
==16527== For more details, rerun with: -v
==16527==
==16527== Conditional jump or move depends on uninitialised value(s)
==16527== at 0x40029EF: _dl_get_ready_to_run (in /lib/ld-uClibc-0.9.28.so)
==16527== by 0x40036BE: (within /lib/ld-uClibc-0.9.28.so)
==16527== by 0x40008D4: _start (in /lib/ld-uClibc-0.9.28.so)
==16527==
==16527== Conditional jump or move depends on uninitialised value(s)
==16527== at 0x40022B7: _dl_load_shared_library (in /lib/ld-uClibc-0.9.28.so)
==16527== by 0x4002E5F: _dl_get_ready_to_run (in /lib/ld-uClibc-0.9.28.so)
==16527== by 0x40036BE: (within /lib/ld-uClibc-0.9.28.so)
==16527== by 0x40008D4: _start (in /lib/ld-uClibc-0.9.28.so)
==16527==
==16527== Conditional jump or move depends on uninitialised value(s)
==16527== at 0x4002306: _dl_load_shared_library (in /lib/ld-uClibc-0.9.28.so)
==16527== by 0x4002E5F: _dl_get_ready_to_run (in /lib/ld-uClibc-0.9.28.so)
==16527== by 0x40036BE: (within /lib/ld-uClibc-0.9.28.so)
==16527== by 0x40008D4: _start (in /lib/ld-uClibc-0.9.28.so)
==16527==
==16527== Conditional jump or move depends on uninitialised value(s)
==16527== at 0x40025EA: _dl_fixup (in /lib/ld-uClibc-0.9.28.so)
==16527== by 0x40031F9: _dl_get_ready_to_run (in /lib/ld-uClibc-0.9.28.so)
==16527== by 0x40036BE: (within /lib/ld-uClibc-0.9.28.so)
==16527== by 0x40008D4: _start (in /lib/ld-uClibc-0.9.28.so)
==16527==
==16527== Conditional jump or move depends on uninitialised value(s)
==16527== at 0x400261F: _dl_fixup (in /lib/ld-uClibc-0.9.28.so)
==16527== by 0x40031F9: _dl_get_ready_to_run (in /lib/ld-uClibc-0.9.28.so)
==16527== by 0x40036BE: (within /lib/ld-uClibc-0.9.28.so)
==16527== by 0x40008D4: _start (in /lib/ld-uClibc-0.9.28.so)
==16527==
==16527== Conditional jump or move depends on uninitialised value(s)
==16527== at 0x400266E: _dl_fixup (in /lib/ld-uClibc-0.9.28.so)
==16527== by 0x40031F9: _dl_get_ready_to_run (in /lib/ld-uClibc-0.9.28.so)
==16527== by 0x40036BE: (within /lib/ld-uClibc-0.9.28.so)
==16527== by 0x40008D4: _start (in /lib/ld-uClibc-0.9.28.so)
==16527==
==16527== Conditional jump or move depends on uninitialised value(s)
==16527== at 0x40032AC: _dl_get_ready_to_run (in /lib/ld-uClibc-0.9.28.so)
==16527== by 0x40036BE: (within /lib/ld-uClibc-0.9.28.so)
==16527== by 0x40008D4: _start (in /lib/ld-uClibc-0.9.28.so)
==16527==
==16527== ERROR SUMMARY: 9 errors from 7 contexts (suppressed: 0 from 0)
==16527== malloc/free: in use at exit: 0 bytes in 0 blocks.
==16527== malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
==16527== For counts of detected errors, rerun with: -v
==16527== No malloc'd blocks -- no leaks are possible.
bash-3.00$ ldd /a.out
ldd: can't open cache '/etc/ld.so.cache'
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x40007000)
libc.so.0 => /lib/libc.so.0 (0x4000f000)
ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x40000000)
It's not statically linked.
Any ideas what's wrong? When running the same program against
the same svn-version of valgrind on my regular system i get
this:
frank@linux:~> valgrind a.out
==16442== Memcheck, a memory error detector.
==16442== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
==16442== Using LibVEX rev 1418, a library for dynamic binary translation.
==16442== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP.
==16442== Using valgrind-3.1.SVN, a dynamic binary instrumentation framework.
==16442== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
==16442== For more details, rerun with: -v
==16442==
==16442==
==16442== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 13 from 1)
==16442== malloc/free: in use at exit: 100 bytes in 10 blocks.
==16442== malloc/free: 10 allocs, 0 frees, 100 bytes allocated.
==16442== For counts of detected errors, rerun with: -v
==16442== searching for pointers to 10 not-freed blocks.
==16442== checked 65,620 bytes.
==16442==
==16442== LEAK SUMMARY:
==16442== definitely lost: 100 bytes in 10 blocks.
==16442== possibly lost: 0 bytes in 0 blocks.
==16442== still reachable: 0 bytes in 0 blocks.
==16442== suppressed: 0 bytes in 0 blocks.
==16442== Use --leak-check=full to see details of leaked memory.
TIA Frank
|
|
From: Tom H. <to...@co...> - 2005-10-11 15:31:37
|
In message <200...@ad...>
fr...@be... wrote:
> ==16527== ERROR SUMMARY: 9 errors from 7 contexts (suppressed: 0 from 0)
> ==16527== malloc/free: in use at exit: 0 bytes in 0 blocks.
> ==16527== malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
> ==16527== For counts of detected errors, rerun with: -v
> ==16527== No malloc'd blocks -- no leaks are possible.
Clearly it has failed to intercept malloc. Run with -v and post
the result.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: Brian C. <cr...@fi...> - 2005-10-11 15:34:59
|
Looks like your valgrind cmd line isn't specifying either a tool, OR that you want to check leaks...
try running valgrind --help to check out the options and tools, then run it again with a tool
selected to see the options specific to that tool. Here's a command line I like:
valgrind --track-fds=yes --db-attach=yes --num-callers=7 --tool=memcheck --leak-check=yes
fr...@be... wrote:
> Hi,
>
> i'm using a svn-version of valgrind in a uclibc-chroot
> (uclibc-0.98).
>
> My problem is that it fails to catch memleaks.
>
> frank@linux:~> cat main.c
> int main() {
> void* bla ;
> int i;
>
> for (i = 0; i < 10; i++) {
> bla = (void*)malloc(10);
> }
> }
>
> frank@linux:~> i386-linux-gcc main.c # uclibc toolchain
> cp a.out $CHROOT
>
> In chroot:
>
> bash-3.00$ valgrind /a.out
> ==16527== Memcheck, a memory error detector.
> ==16527== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
> ==16527== Using LibVEX rev 1418, a library for dynamic binary translation.
> ==16527== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP.
> ==16527== Using valgrind-3.1.SVN, a dynamic binary instrumentation framework.
> ==16527== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
> ==16527== For more details, rerun with: -v
> ==16527==
> ==16527== Conditional jump or move depends on uninitialised value(s)
> ==16527== at 0x40029EF: _dl_get_ready_to_run (in /lib/ld-uClibc-0.9.28.so)
> ==16527== by 0x40036BE: (within /lib/ld-uClibc-0.9.28.so)
> ==16527== by 0x40008D4: _start (in /lib/ld-uClibc-0.9.28.so)
> ==16527==
> ==16527== Conditional jump or move depends on uninitialised value(s)
> ==16527== at 0x40022B7: _dl_load_shared_library (in /lib/ld-uClibc-0.9.28.so)
> ==16527== by 0x4002E5F: _dl_get_ready_to_run (in /lib/ld-uClibc-0.9.28.so)
> ==16527== by 0x40036BE: (within /lib/ld-uClibc-0.9.28.so)
> ==16527== by 0x40008D4: _start (in /lib/ld-uClibc-0.9.28.so)
> ==16527==
> ==16527== Conditional jump or move depends on uninitialised value(s)
> ==16527== at 0x4002306: _dl_load_shared_library (in /lib/ld-uClibc-0.9.28.so)
> ==16527== by 0x4002E5F: _dl_get_ready_to_run (in /lib/ld-uClibc-0.9.28.so)
> ==16527== by 0x40036BE: (within /lib/ld-uClibc-0.9.28.so)
> ==16527== by 0x40008D4: _start (in /lib/ld-uClibc-0.9.28.so)
> ==16527==
> ==16527== Conditional jump or move depends on uninitialised value(s)
> ==16527== at 0x40025EA: _dl_fixup (in /lib/ld-uClibc-0.9.28.so)
> ==16527== by 0x40031F9: _dl_get_ready_to_run (in /lib/ld-uClibc-0.9.28.so)
> ==16527== by 0x40036BE: (within /lib/ld-uClibc-0.9.28.so)
> ==16527== by 0x40008D4: _start (in /lib/ld-uClibc-0.9.28.so)
> ==16527==
> ==16527== Conditional jump or move depends on uninitialised value(s)
> ==16527== at 0x400261F: _dl_fixup (in /lib/ld-uClibc-0.9.28.so)
> ==16527== by 0x40031F9: _dl_get_ready_to_run (in /lib/ld-uClibc-0.9.28.so)
> ==16527== by 0x40036BE: (within /lib/ld-uClibc-0.9.28.so)
> ==16527== by 0x40008D4: _start (in /lib/ld-uClibc-0.9.28.so)
> ==16527==
> ==16527== Conditional jump or move depends on uninitialised value(s)
> ==16527== at 0x400266E: _dl_fixup (in /lib/ld-uClibc-0.9.28.so)
> ==16527== by 0x40031F9: _dl_get_ready_to_run (in /lib/ld-uClibc-0.9.28.so)
> ==16527== by 0x40036BE: (within /lib/ld-uClibc-0.9.28.so)
> ==16527== by 0x40008D4: _start (in /lib/ld-uClibc-0.9.28.so)
> ==16527==
> ==16527== Conditional jump or move depends on uninitialised value(s)
> ==16527== at 0x40032AC: _dl_get_ready_to_run (in /lib/ld-uClibc-0.9.28.so)
> ==16527== by 0x40036BE: (within /lib/ld-uClibc-0.9.28.so)
> ==16527== by 0x40008D4: _start (in /lib/ld-uClibc-0.9.28.so)
> ==16527==
> ==16527== ERROR SUMMARY: 9 errors from 7 contexts (suppressed: 0 from 0)
> ==16527== malloc/free: in use at exit: 0 bytes in 0 blocks.
> ==16527== malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
> ==16527== For counts of detected errors, rerun with: -v
> ==16527== No malloc'd blocks -- no leaks are possible.
>
> bash-3.00$ ldd /a.out
> ldd: can't open cache '/etc/ld.so.cache'
> libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x40007000)
> libc.so.0 => /lib/libc.so.0 (0x4000f000)
> ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x40000000)
>
> It's not statically linked.
>
> Any ideas what's wrong? When running the same program against
> the same svn-version of valgrind on my regular system i get
> this:
>
> frank@linux:~> valgrind a.out
> ==16442== Memcheck, a memory error detector.
> ==16442== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
> ==16442== Using LibVEX rev 1418, a library for dynamic binary translation.
> ==16442== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP.
> ==16442== Using valgrind-3.1.SVN, a dynamic binary instrumentation framework.
> ==16442== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
> ==16442== For more details, rerun with: -v
> ==16442==
> ==16442==
> ==16442== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 13 from 1)
> ==16442== malloc/free: in use at exit: 100 bytes in 10 blocks.
> ==16442== malloc/free: 10 allocs, 0 frees, 100 bytes allocated.
> ==16442== For counts of detected errors, rerun with: -v
> ==16442== searching for pointers to 10 not-freed blocks.
> ==16442== checked 65,620 bytes.
> ==16442==
> ==16442== LEAK SUMMARY:
> ==16442== definitely lost: 100 bytes in 10 blocks.
> ==16442== possibly lost: 0 bytes in 0 blocks.
> ==16442== still reachable: 0 bytes in 0 blocks.
> ==16442== suppressed: 0 bytes in 0 blocks.
> ==16442== Use --leak-check=full to see details of leaked memory.
>
> TIA Frank
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads, discussions,
> and more. http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> Valgrind-users mailing list
> Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-users
>
>
>
|