You are not logged in.

#1 2005-01-11 16:36:18

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

valgrind on pacman

so I just discovered valgrind, and I was messing with the leak checker....

valgrind --tool=memcheck --leak-check=yes pacman -Syu
output wrote:

==3582== ERROR SUMMARY: 25640 errors from 11 contexts (suppressed: 19 from 1)
==3582== malloc/free: in use at exit: 835512 bytes in 11619 blocks.
==3582== malloc/free: 64029 allocs, 52410 frees, 249948628 bytes allocated.
==3582== For counts of detected errors, rerun with: -v
==3582== searching for pointers to 11619 not-freed blocks.
==3582== checked 1791644 bytes.
==3582==
==3582== LEAK SUMMARY:
==3582==    definitely lost: 5184 bytes in 16 blocks.
==3582==    possibly lost:   0 bytes in 0 blocks.
==3582==    still reachable: 830328 bytes in 11603 blocks.
==3582==         suppressed: 0 bytes in 0 blocks.

yikes

Offline

#2 2005-01-11 18:54:35

IceRAM
Member
From: Bucharest, Romania
Registered: 2004-03-04
Posts: 772
Website

Re: valgrind on pacman

Check out KCacheGrind! You might like it wink

Test Case: "pacman -Syu", select NO when asked to upgrade (pacman compiled with debug symbols)

Here are some screenshots:
http://mircea.bardac.net/archlinux/kcac … acman1.png
http://mircea.bardac.net/archlinux/kcac … acman2.png
^ in my particular case - might be the general case (haven't checked), you can see here that the "if" there is almost always skipped: "9448 of 9483 jumps"
http://mircea.bardac.net/archlinux/kcac … acman3.png

My "pacman -Syu" results for

# valgrind --tool=memcheck --leak-check=yes --error-limit=no --log-file=valgrind.pacman.log ./pacman -Syu

@ http://mircea.bardac.net/archlinux/valgrind.pacman.log
Two of the places where the lost bytes appear are listed at the bottom.

==5409== 102 bytes in 18 blocks are definitely lost in loss record 2 of 10
==5409==    at 0x1B903E6D: malloc (in /usr/lib/valgrind/vgpreload_memcheck.so)
==5409==    by 0x1B99CA4F: strdup (in /lib/tls/libc-2.3.3.so)
==5409==    by 0x805BA2A: rpmvercmp (rpmvercmp.c:42)
==5409==    by 0x80535B9: pacman_sync (pacman.c:691)
==5409==
==5409==
==5409== 972 bytes in 3 blocks are definitely lost in loss record 3 of 10
==5409==    at 0x1B904864: calloc (in /usr/lib/valgrind/vgpreload_memcheck.so)
==5409==    by 0x805C70A: FtpConnect (in /var/abs/base/pacman/src/pacman-2.9.4/pacman)
==5409==    by 0x805A37D: downloadfiles_forreal (pacsync.c:184)
==5409==    by 0x805A82D: sync_synctree (pacsync.c:94)
==5409==
==5409== LEAK SUMMARY:
==5409==    definitely lost: 1074 bytes in 21 blocks.
==5409==    possibly lost:   0 bytes in 0 blocks.
==5409==    still reachable: 1048411 bytes in 13350 blocks.
==5409==         suppressed: 0 bytes in 0 blocks.

Offline

#3 2005-01-11 19:12:43

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: valgrind on pacman

wow kcachegrind rocks
... thanks for pointing that out to me!

Offline

Board footer

Powered by FluxBB