On 09/22/2010 06:22 AM, Xavier Toth wrote: > Using valgrind on one of my tests I get the follow results > ==7241== Syscall param exit_group(exit_code) contains uninitialised byte(s) > ==7241== at 0x3E99A90B8A: _Exit (in /lib64/tls/libc-2.3.4.so) > ==7241== by 0x3E99A30CEA: exit (in /lib64/tls/libc-2.3.4.so) > ==7241== by 0x3E99A1C411: (below main) (in /lib64/tls/libc-2.3.4.so) > ==7241== > ==7241== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 8 from 1) > ==7241== malloc/free: in use at exit: 28,560 bytes in 42 blocks. > ==7241== malloc/free: 2,630 allocs, 2,588 frees, 714,842 bytes allocated. > ==7241== For counts of detected errors, rerun with: -v > ==7241== searching for pointers to 42 not-freed blocks. > ==7241== checked 230,984 bytes. > ==7241== > ==7241== > ==7241== 8 bytes in 1 blocks are definitely lost in loss record 3 of 12 > ==7241== at 0x4904A06: malloc (vg_replace_malloc.c:149) > ==7241== by 0x3E99805A53: _dl_map_object_from_fd (in /lib64/ld-2.3.4.so) > ==7241== by 0x3E998065C8: _dl_map_object (in /lib64/ld-2.3.4.so) > ==7241== by 0x3E99AFB75C: dl_open_worker (in /lib64/tls/libc-2.3.4.so) > ==7241== by 0x3E9980AF8F: _dl_catch_error (in /lib64/ld-2.3.4.so) > ==7241== by 0x3E99AFBF09: _dl_open (in /lib64/tls/libc-2.3.4.so) > ==7241== by 0x3E99D01053: dlopen_doit (in /lib64/libdl-2.3.4.so) > ==7241== by 0x3E9980AF8F: _dl_catch_error (in /lib64/ld-2.3.4.so) > ==7241== by 0x3E99D01551: _dlerror_run (in /lib64/libdl-2.3.4.so) > ==7241== by 0x3E99D01091: dlopen@@GLIBC_2.2.5 (in /lib64/libdl-2.3.4.so) > ==7241== by 0x341A914E61: PR_LoadLibraryWithFlags (in > /usr/lib64/libnspr4.so)==7241== by 0x4B4D564: ??? > ==7241== > ==7241== > ==7241== 46 (40 direct, 6 indirect) bytes in 1 blocks are definitely > lost in loss record 6 of 12 > ==7241== at 0x4905D27: calloc (vg_replace_malloc.c:279) > ==7241== by 0x341A9148D1: (within /usr/lib64/libnspr4.so) > ==7241== by 0x341A91ACB9: (within /usr/lib64/libnspr4.so) > ==7241== by 0x341A922A94: PR_NewLock (in /usr/lib64/libnspr4.so) > ==7241== by 0x341B359FD9: (within /usr/lib64/libnss3.so) > ==7241== by 0x341B319A76: (within /usr/lib64/libnss3.so) > ==7241== by 0x341B31A297: NSS_Init (in /usr/lib64/libnss3.so) > ==7241== by 0x404D76: spl_nssSocketConnect (nss_socket.c:263) > ==7241== by 0x40347D: spl_stompConnect (spl_stomp.c:368) > ==7241== by 0x405DB4: spl_guard_stomp_connect (guard_stomp.c:100) > ==7241== by 0x40247F: main (guardstomp.c:40) > ==7241== > ==7241== > ==7241== 1,024 bytes in 1 blocks are definitely lost in loss record 9 of 12 > ==7241== at 0x4905D27: calloc (vg_replace_malloc.c:279) > ==7241== by 0x341A9145C2: (within /usr/lib64/libnspr4.so) > ==7241== by 0x341A91AC69: (within /usr/lib64/libnspr4.so) > ==7241== by 0x341A922A94: PR_NewLock (in /usr/lib64/libnspr4.so) > ==7241== by 0x341B359FD9: (within /usr/lib64/libnss3.so) > ==7241== by 0x341B319A76: (within /usr/lib64/libnss3.so) > ==7241== by 0x341B31A297: NSS_Init (in /usr/lib64/libnss3.so) > ==7241== by 0x404D76: spl_nssSocketConnect (nss_socket.c:263) > ==7241== by 0x40347D: spl_stompConnect (spl_stomp.c:368) > ==7241== by 0x405DB4: spl_guard_stomp_connect (guard_stomp.c:100) > ==7241== by 0x40247F: main (guardstomp.c:40) > ==7241== > ==7241== > ==7241== 1,152 bytes in 10 blocks are possibly lost in loss record 10 of 12 > ==7241== at 0x4905D27: calloc (vg_replace_malloc.c:279) > ==7241== by 0x341B37166F: (within /usr/lib64/libnss3.so) > ==7241== by 0x341B3717EC: (within /usr/lib64/libnss3.so) > ==7241== by 0x341B365BDA: (within /usr/lib64/libnss3.so) > ==7241== by 0x341B36A736: (within /usr/lib64/libnss3.so) > ==7241== by 0x341B319B44: (within /usr/lib64/libnss3.so) > ==7241== by 0x341B31A297: NSS_Init (in /usr/lib64/libnss3.so) > ==7241== by 0x404D76: spl_nssSocketConnect (nss_socket.c:263) > ==7241== by 0x40347D: spl_stompConnect (spl_stomp.c:368) > ==7241== by 0x405DB4: spl_guard_stomp_connect (guard_stomp.c:100) > ==7241== by 0x40247F: main (guardstomp.c:40) > ==7241== > ==7241== LEAK SUMMARY: > ==7241== definitely lost: 1,072 bytes in 3 blocks. > ==7241== indirectly lost: 6 bytes in 1 blocks. > ==7241== possibly lost: 1,152 bytes in 10 blocks. > ==7241== still reachable: 26,330 bytes in 28 blocks. > ==7241== suppressed: 0 bytes in 0 blocks. > ==7241== Reachable blocks (those to which a pointer was found) are not shown. > ==7241== To see them, rerun with: --show-reachable=yes > > ==7241== Syscall param exit_group(exit_code) contains uninitialised byte(s) > ==7241== at 0x3E99A90B8A: _Exit (in /lib64/tls/libc-2.3.4.so) > ==7241== by 0x3E99A30CEA: exit (in /lib64/tls/libc-2.3.4.so) > ==7241== by 0x3E99A1C411: (below main) (in /lib64/tls/libc-2.3.4.so) > ==7241== > ==7241== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 8 from 1) > ==7241== malloc/free: in use at exit: 28,560 bytes in 42 blocks. > ==7241== malloc/free: 2,630 allocs, 2,588 frees, 714,842 bytes allocated. > ==7241== For counts of detected errors, rerun with: -v > ==7241== searching for pointers to 42 not-freed blocks. > ==7241== checked 230,984 bytes. > > Here's the code used during connection shutdown: > if (connection->sslSocket != NULL) { > PR_Shutdown(connection->sslSocket, PR_SHUTDOWN_BOTH); > PR_Close(connection->sslSocket); > } > SSL_ClearSessionCache(); > NSS_Shutdown(); > PR_Cleanup(); > > Most of the leaks look like allocations made by NSS_Init are there > other calls I need to make to fix these leaks? > Are you looking for *Real* leaks, or just trying to clean up valgrind output.
Locks allocated in NSS_Init are one time allocations which only happen at init time, and thus are not critical leaks (they do not grow as the system continues to be used). These kinds of leaks are low priority to fix. There's a known series of them which we keep on exception lists when running our tinderbox leak checks. bob > Ted >
-- dev-tech-crypto mailing list dev-tech-crypto@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-tech-crypto