|
From: Rakesh S. <rak...@gm...> - 2007-12-15 04:36:56
|
Hi - One of my programs uses the dl library to dynamically load the symbols from a file and link it. valgrind seems to detect an error specifically in one of the functions in -ldl (dl library on GNU/Linux RedHat Enterprise AS 4). I am trying to figure out if that would be a cause of a memory leak. And how to go about fixing the same. Thanks for the help. $ valgrind --leak-check=yes --gen-suppressions=yes ./testdll ~/libcustom.so ==24395== Memcheck, a memory error detector. ==24395== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al. ==24395== Using LibVEX rev 1732, a library for dynamic binary translation. ==24395== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP. ==24395== Using valgrind-3.2.3, a dynamic binary instrumentation framework. ==24395== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al. ==24395== For more details, rerun with: -v ==24395== 0 ==24395== ==24395== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 30 from 2) ==24395== malloc/free: in use at exit: 1,091 bytes in 9 blocks. ==24395== malloc/free: 78 allocs, 69 frees, 10,707 bytes allocated. ==24395== For counts of detected errors, rerun with: -v ==24395== searching for pointers to 9 not-freed blocks. ==24395== checked 167,072 bytes. ==24395== ==24395== 8 bytes in 2 blocks are definitely lost in loss record 1 of 8 ==24395== at 0x40046F2: malloc (vg_replace_malloc.c:149) ==24395== by 0x2773DD: _dl_map_object_from_fd (in /lib/ld-2.3.4.so) ==24395== by 0x2780BB: _dl_map_object (in /lib/ld-2.3.4.so) ==24395== by 0x27BD97: openaux (in /lib/ld-2.3.4.so) ==24395== by 0x27D0FD: _dl_catch_error (in /lib/ld-2.3.4.so) ==24395== by 0x27C039: _dl_map_object_deps (in /lib/ld-2.3.4.so) ==24395== by 0x38B158: dl_open_worker (in /lib/tls/libc-2.3.4.so) ==24395== by 0x27D0FD: _dl_catch_error (in /lib/ld-2.3.4.so) ==24395== by 0x38BCB7: _dl_open (in /lib/tls/libc-2.3.4.so) ==24395== by 0x7C1CB7: dlopen_doit (in /lib/libdl-2.3.4.so) ==24395== by 0x27D0FD: _dl_catch_error (in /lib/ld-2.3.4.so) ==24395== by 0x7C22BA: _dlerror_run (in /lib/libdl-2.3.4.so) ==24395== ==24395== ---- Print suppression ? --- [Return/N/n/Y/y/C/c] ---- ==24395== ==24395== LEAK SUMMARY: ==24395== definitely lost: 8 bytes in 2 blocks. ==24395== possibly lost: 0 bytes in 0 blocks. ==24395== still reachable: 1,083 bytes in 7 blocks. ==24395== suppressed: 0 bytes in 0 blocks. ==24395== Reachable blocks (those to which a pointer was found) are not shown. ==24395== To see them, rerun with: --leak-check=full --show-reachable=yes |