|
From: Joseph W. <jos...@ma...> - 2009-06-09 12:58:20
|
With version svn 10277 and valgrind 3.4.1 on an x86_64, I have a program that crashes callgrind but works just fine under memcheck. Here's the result from running vg-in-place: $ ~/src/Tools/VALGRIND/RemoteSVN/valgrind/vg-in-place --tool=callgrind --num-callers=50 --show-emwarns=yes --smc-check=all bin/Test1.exe ==15141== Callgrind, a call-graph generating cache profiler. ==15141== Copyright (C) 2002-2009, and GNU GPL'd, by Josef Weidendorfer et al. ==15141== Using LibVEX rev 1899, a library for dynamic binary translation. ==15141== Copyright (C) 2004-2009, and GNU GPL'd, by OpenWorks LLP. ==15141== Using valgrind-3.5.0.SVN, a dynamic binary instrumentation framework. ==15141== Copyright (C) 2000-2009, and GNU GPL'd, by Julian Seward et al. ==15141== For more details, rerun with: -v ==15141== ==15141== For interactive control, run 'callgrind_control -h'. /glb/home/usjwiv/src/Tools/VALGRIND/RemoteSVN/valgrind/vg-in-place: line 28: 15141 Segmentation fault VALGRIND_LIB="$vgbasedir/.in_place" VALGRIND_LIB_INNER="$vgbasedir/.in_place" "$vgbasedir/coregrind/valgrind" "$@" Here's what happens when I run callgrind inside of gdb: $ setenv VALGRIND_LAUNCHER ~/src/Tools/VALGRIND/RemoteSVN/valgrind/coregrind/valgrind $ gdb ~/src/Tools/VALGRIND/RemoteSVN/valgrind/.in_place/callgrind-amd64-linux GNU gdb 6.8 Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu"... (gdb) handle SIGILL SIGSEGV nostop noprint Signal Stop Print Pass to program Description SIGILL No No Yes Illegal instruction SIGSEGV No No Yes Segmentation fault (gdb) run --num-callers=50 --show-emwarns=yes --smc-check=all bin/Test1.exe Starting program: /scratch/jody/src/Tools/VALGRIND/RemoteSVN/valgrind/.in_place/callgrind-amd64-linux --num-callers=50 --show-emwarns=yes --smc-check=all bin/Test1.exe ==16049== Callgrind, a call-graph generating cache profiler. ==16049== Copyright (C) 2002-2009, and GNU GPL'd, by Josef Weidendorfer et al. ==16049== Using LibVEX rev 1899, a library for dynamic binary translation. ==16049== Copyright (C) 2004-2009, and GNU GPL'd, by OpenWorks LLP. ==16049== Using valgrind-3.5.0.SVN, a dynamic binary instrumentation framework. ==16049== Copyright (C) 2000-2009, and GNU GPL'd, by Julian Seward et al. ==16049== For more details, rerun with: -v ==16049== ==16049== For interactive control, run 'callgrind_control -h'. --16049-- VG_USERREQ__CLIENT_CALL1: func=0x0 Operating system error: Success Memory allocation failed ==16049== ==16049== Events : Ir ==16049== Collected : 78018391 ==16049== ==16049== I refs: 78,018,391 Program exited with code 01. (gdb) Just for completeness, here is the results of memcheck: $ ~/src/Tools/VALGRIND/RemoteSVN/valgrind/.in_place/memcheck-amd64-linux --num-callers=50 --show-emwarns=yes --smc-check=all bin/Test1.exe ==16587== Memcheck, a memory error detector. ==16587== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al. ==16587== Using LibVEX rev 1899, a library for dynamic binary translation. ==16587== Copyright (C) 2004-2009, and GNU GPL'd, by OpenWorks LLP. ==16587== Using valgrind-3.5.0.SVN, a dynamic binary instrumentation framework. ==16587== Copyright (C) 2000-2009, and GNU GPL'd, by Julian Seward et al. ==16587== For more details, rerun with: -v ==16587== ==16587== Conditional jump or move depends on uninitialised value(s) ==16587== at 0x4907107: strlen (mc_replace_strmem.c:275) ==16587== by 0xDF485A0: sgygtn_f (in /scratch/jody/work/SVN/branches/2009.1/3rdparty/SIPMAP/200901/Linux64/siplib/libSipmapShell.so.9.1) ==16587== by 0x7FEFFC67F: ??? ==16587== ==16587== Conditional jump or move depends on uninitialised value(s) ==16587== at 0x4907107: strlen (mc_replace_strmem.c:275) ==16587== by 0xDF485A0: sgygtn_f (in /scratch/jody/work/SVN/branches/2009.1/3rdparty/SIPMAP/200901/Linux64/siplib/libSipmapShell.so.9.1) ==16587== by 0x7FEFFC6A7: ??? ==16587== ==16587== Conditional jump or move depends on uninitialised value(s) ==16587== at 0x4907107: strlen (mc_replace_strmem.c:275) ==16587== by 0xDF485A0: sgygtn_f (in /scratch/jody/work/SVN/branches/2009.1/3rdparty/SIPMAP/200901/Linux64/siplib/libSipmapShell.so.9.1) ==16587== by 0x7FEFFB947: ??? 13:01:36 DEBUG: SpBTFFileManager::buildLookupTable: Search radius for ../../../Data/synth_XY.ssf lookup tables = 212.132 XXX no SpBTFFileManager::BDFInfo ==16587== ==16587== ERROR SUMMARY: 36 errors from 3 contexts (suppressed: 10 from 5) ==16587== malloc/free: in use at exit: 3,231,557 bytes in 1,785 blocks. ==16587== malloc/free: 135,975 allocs, 134,190 frees, 13,558,729 bytes allocated. ==16587== For counts of detected errors, rerun with: -v ==16587== Use --track-origins=yes to see where uninitialised values come from ==16587== searching for pointers to 1,785 not-freed blocks. ==16587== checked 126,070,344 bytes. ==16587== ==16587== LEAK SUMMARY: ==16587== definitely lost: 45,240 bytes in 18 blocks. ==16587== indirectly lost: 1,126 bytes in 5 blocks. ==16587== possibly lost: 17,333 bytes in 304 blocks. ==16587== still reachable: 3,167,858 bytes in 1,458 blocks. ==16587== suppressed: 0 bytes in 0 blocks. ==16587== Rerun with --leak-check=full to see details of leaked memory. What hints can you give me so that I can actually identify what the problem is? Thanks, Jody |
|
From: Julian S. <js...@ac...> - 2009-06-09 13:06:02
|
> ==16587== Conditional jump or move depends on uninitialised value(s) > ==16587== at 0x4907107: strlen (mc_replace_strmem.c:275) > ==16587== by 0xDF485A0: sgygtn_f (in > /scratch/jody/work/SVN/branches/2009.1/3rdparty/SIPMAP/200901/Linux64/sipli >b/libSipmapShell.so.9.1) ==16587== by 0x7FEFFC67F: ??? > ==16587== > ==16587== Conditional jump or move depends on uninitialised value(s) > ==16587== at 0x4907107: strlen (mc_replace_strmem.c:275) > ==16587== by 0xDF485A0: sgygtn_f (in > /scratch/jody/work/SVN/branches/2009.1/3rdparty/SIPMAP/200901/Linux64/sipli >b/libSipmapShell.so.9.1) ==16587== by 0x7FEFFC6A7: ??? > ==16587== > ==16587== Conditional jump or move depends on uninitialised value(s) > ==16587== at 0x4907107: strlen (mc_replace_strmem.c:275) > ==16587== by 0xDF485A0: sgygtn_f (in > /scratch/jody/work/SVN/branches/2009.1/3rdparty/SIPMAP/200901/Linux64/sipli >b/libSipmapShell.so.9.1) ==16587== by 0x7FEFFB947: ??? > 13:01:36 DEBUG: SpBTFFileManager::buildLookupTable: Search radius for > ../../../Data/synth_XY.ssf lookup tables = 212.132 Use --track-origins=yes, and find and fix the above errors. Then see whether Callgrind still crashes. J |
|
From: Joseph W. <jos...@ma...> - 2009-06-09 14:37:23
|
It's not easy to get the source code to this library but if it is what is needed, I'll do it and fix these problems. Just let me know. By the way, here's the output with --track-orgins=yes. ~/src/Tools/VALGRIND/RemoteSVN/valgrind/vg-in-place --tool=memcheck --num-callers=50 --show-emwarns=yes --smc-check=all --track-origins=yes bin/Test1.exe ==29408== Memcheck, a memory error detector. ==29408== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al. ==29408== Using LibVEX rev 1899, a library for dynamic binary translation. ==29408== Copyright (C) 2004-2009, and GNU GPL'd, by OpenWorks LLP. ==29408== Using valgrind-3.5.0.SVN, a dynamic binary instrumentation framework. ==29408== Copyright (C) 2000-2009, and GNU GPL'd, by Julian Seward et al. ==29408== For more details, rerun with: -v ==29408== ==29408== Conditional jump or move depends on uninitialised value(s) ==29408== at 0x4907107: strlen (mc_replace_strmem.c:275) ==29408== by 0xE0F55A0: sgygtn_f (in /scratch/jody/work/SVN/branches/2009.1/3rdparty/SIPMAP/200901/Linux64/siplib/libSipmapShell.so.9.1) ==29408== by 0x7FEFFC31F: ??? ==29408== Uninitialised value was created by a stack allocation ==29408== at 0xDFE5260: get_unit (in /scratch/jody/work/SVN/branches/2009.1/3rdparty/SIPMAP/200901/Linux64/siplib/libSipmapShell.so.9.1) ==29408== ==29408== Conditional jump or move depends on uninitialised value(s) ==29408== at 0x4907107: strlen (mc_replace_strmem.c:275) ==29408== by 0xE0F55A0: sgygtn_f (in /scratch/jody/work/SVN/branches/2009.1/3rdparty/SIPMAP/200901/Linux64/siplib/libSipmapShell.so.9.1) ==29408== by 0x7FEFFC347: ??? ==29408== Uninitialised value was created by a stack allocation ==29408== at 0xDFE5260: get_unit (in /scratch/jody/work/SVN/branches/2009.1/3rdparty/SIPMAP/200901/Linux64/siplib/libSipmapShell.so.9.1) ==29408== ==29408== Conditional jump or move depends on uninitialised value(s) ==29408== at 0x4907107: strlen (mc_replace_strmem.c:275) ==29408== by 0xE0F55A0: sgygtn_f (in /scratch/jody/work/SVN/branches/2009.1/3rdparty/SIPMAP/200901/Linux64/siplib/libSipmapShell.so.9.1) ==29408== by 0x7FEFFB5E7: ??? ==29408== Uninitialised value was created by a stack allocation ==29408== at 0xDFE5260: get_unit (in /scratch/jody/work/SVN/branches/2009.1/3rdparty/SIPMAP/200901/Linux64/siplib/libSipmapShell.so.9.1) 09:30:12 DEBUG: SpBTFFileManager::buildLookupTable: Search radius for ../../../Data/synth_XY.ssf lookup tables = 212.132 XXX no SpBTFFileManager::BDFInfo ==29408== ==29408== ERROR SUMMARY: 21 errors from 3 contexts (suppressed: 10 from 5) ==29408== malloc/free: in use at exit: 3,231,557 bytes in 1,785 blocks. ==29408== malloc/free: 135,976 allocs, 134,191 frees, 13,558,793 bytes allocated. ==29408== For counts of detected errors, rerun with: -v ==29408== searching for pointers to 1,785 not-freed blocks. ==29408== checked 126,251,432 bytes. ==29408== ==29408== LEAK SUMMARY: ==29408== definitely lost: 45,240 bytes in 18 blocks. ==29408== indirectly lost: 1,126 bytes in 5 blocks. ==29408== possibly lost: 17,333 bytes in 304 blocks. ==29408== still reachable: 3,167,858 bytes in 1,458 blocks. ==29408== suppressed: 0 bytes in 0 blocks. ==29408== Rerun with --leak-check=full to see details of leaked memory. On Tuesday, June 09, 2009, at 08:08AM, "Julian Seward" <js...@ac...> wrote: > >> ==16587== Conditional jump or move depends on uninitialised value(s) >> ==16587== at 0x4907107: strlen (mc_replace_strmem.c:275) >> ==16587== by 0xDF485A0: sgygtn_f (in >> /scratch/jody/work/SVN/branches/2009.1/3rdparty/SIPMAP/200901/Linux64/sipli >>b/libSipmapShell.so.9.1) ==16587== by 0x7FEFFC67F: ??? >> ==16587== >> ==16587== Conditional jump or move depends on uninitialised value(s) >> ==16587== at 0x4907107: strlen (mc_replace_strmem.c:275) >> ==16587== by 0xDF485A0: sgygtn_f (in >> /scratch/jody/work/SVN/branches/2009.1/3rdparty/SIPMAP/200901/Linux64/sipli >>b/libSipmapShell.so.9.1) ==16587== by 0x7FEFFC6A7: ??? >> ==16587== >> ==16587== Conditional jump or move depends on uninitialised value(s) >> ==16587== at 0x4907107: strlen (mc_replace_strmem.c:275) >> ==16587== by 0xDF485A0: sgygtn_f (in >> /scratch/jody/work/SVN/branches/2009.1/3rdparty/SIPMAP/200901/Linux64/sipli >>b/libSipmapShell.so.9.1) ==16587== by 0x7FEFFB947: ??? >> 13:01:36 DEBUG: SpBTFFileManager::buildLookupTable: Search radius for >> ../../../Data/synth_XY.ssf lookup tables = 212.132 > >Use --track-origins=yes, and find and fix the above errors. Then >see whether Callgrind still crashes. > >J > > |
|
From: Josef W. <Jos...@gm...> - 2009-06-09 23:05:51
|
On Tuesday 09 June 2009, Joseph Winston wrote: > Here's what happens when I run callgrind inside of gdb: > ... > (gdb) run --num-callers=50 --show-emwarns=yes --smc-check=all bin/Test1.exe You should run it in the debugger including the option "--tool=callgrind" (this needs to be added to README_DEVELOPERS), because otherwise, the preload library for memcheck will be loaded, leading to errors such as > ==16049== For interactive control, run 'callgrind_control -h'. > --16049-- VG_USERREQ__CLIENT_CALL1: func=0x0 which is bogus. > Operating system error: Success > Memory allocation failed No idea what's wrong here. As Julian said, your program seems to have a bug somewhere. Josef |
|
From: Joseph W. <jos...@ma...> - 2009-06-10 12:55:36
|
On Tuesday, June 09, 2009, at 06:04PM, "Josef Weidendorfer" <Jos...@gm...> wrote: >On Tuesday 09 June 2009, Joseph Winston wrote: >> Here's what happens when I run callgrind inside of gdb: >> ... >> (gdb) run --num-callers=50 --show-emwarns=yes --smc-check=all bin/Test1.exe > >You should run it in the debugger including the option "--tool=callgrind" >(this needs to be added to README_DEVELOPERS), because otherwise, the >preload library for memcheck will be loaded, leading to errors such as > >> ==16049== For interactive control, run 'callgrind_control -h'. >> --16049-- VG_USERREQ__CLIENT_CALL1: func=0x0 > >which is bogus. > >> Operating system error: Success >> Memory allocation failed > >No idea what's wrong here. As Julian said, your program seems to have a bug somewhere. > >Josef > > I've asked for the source code to the library that has the issues and I'm still waiting for that request to be filled. Until then, here's the output with --tool=callgrind: $ setenv VALGRIND_LAUNCHER ~/src/Tools/VALGRIND/RemoteSVN/valgrind/coregrind/valgrind $ gdb ~/src/Tools/VALGRIND/RemoteSVN/valgrind/.in_place/callgrind-amd64-linux GNU gdb 6.8 Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu"... (gdb) handle SIGILL SIGSEGV nostop noprint Signal Stop Print Pass to program Description SIGILL No No Yes Illegal instruction SIGSEGV No No Yes Segmentation fault (gdb) run --tool=callgrind bin/Test1.exe Starting program: /scratch/jody/src/Tools/VALGRIND/RemoteSVN/valgrind/.in_place/callgrind-amd64-linux --tool=callgrind bin/Test1.exe ==13658== Callgrind, a call-graph generating cache profiler. ==13658== Copyright (C) 2002-2009, and GNU GPL'd, by Josef Weidendorfer et al. ==13658== Using LibVEX rev 1899, a library for dynamic binary translation. ==13658== Copyright (C) 2004-2009, and GNU GPL'd, by OpenWorks LLP. ==13658== Using valgrind-3.5.0.SVN, a dynamic binary instrumentation framework. ==13658== Copyright (C) 2000-2009, and GNU GPL'd, by Julian Seward et al. ==13658== For more details, rerun with: -v ==13658== ==13658== For interactive control, run 'callgrind_control -h'. Program terminated with signal SIGSEGV, Segmentation fault. The program no longer exists. (gdb) |