bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-inetutils] ping: memory leaks


From: Debarshi 'Rishi' Ray
Subject: [bug-inetutils] ping: memory leaks
Date: Sun, 22 Jul 2007 02:12:45 +0530

Running valgrind indicates some memory leaks in GNU ping.

address@hidden ping]$ sudo valgrind --tool=memcheck --leak-check=full
--show-reachable=yes ./ping localhost
......
==5704==
PING ginger (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=17.662 ms
......
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.176/4.618/17.662/7.532 ms
==5704==
==5704== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 17 from 1)
==5704== malloc/free: in use at exit: 372 bytes in 6 blocks.
==5704== malloc/free: 60 allocs, 54 frees, 6,825 bytes allocated.
==5704== For counts of detected errors, rerun with: -v
==5704== searching for pointers to 6 not-freed blocks.
==5704== checked 80,108 bytes.
==5704==
==5704== 5 bytes in 1 blocks are definitely lost in loss record 1 of 6
==5704==    at 0x40054E5: malloc (vg_replace_malloc.c:149)
==5704==    by 0x782228: strndup (in /lib/libc-2.6.so)
==5704==    by 0x8050397: xstrndup (xstrndup.c:33)
==5704==    by 0x804F97F: base_name (basename.c:104)
==5704==    by 0x804F5CA: argp_parse (argp-parse.c:561)
==5704==    by 0x8049930: main (ping.c:240)
==5704==
==5704==
==5704== 7 bytes in 1 blocks are still reachable in loss record 2 of 6
==5704==    at 0x40054E5: malloc (vg_replace_malloc.c:149)
==5704==    by 0x7821BF: strdup (in /lib/libc-2.6.so)
==5704==    by 0x804B0F0: ping_set_dest (libping.c:343)
==5704==    by 0x804AA82: ping_echo (ping_echo.c:90)
==5704==    by 0x80499E1: main (ping.c:266)
==5704==
==5704==
==5704== 56 bytes in 1 blocks are still reachable in loss record 3 of 6
==5704==    at 0x40054E5: malloc (vg_replace_malloc.c:149)
==5704==    by 0x804FB71: xmalloc (xmalloc.c:52)
==5704==    by 0x8049F17: init_data_buffer (ping_common.c:64)
==5704==    by 0x80499CE: main (ping.c:264)
==5704==
==5704==
==5704== 84 bytes in 1 blocks are still reachable in loss record 4 of 6
==5704==    at 0x40054E5: malloc (vg_replace_malloc.c:149)
==5704==    by 0x804B3AC: _ping_setbuf (libping.c:129)
==5704==    by 0x804B58E: ping_set_data (libping.c:148)
==5704==    by 0x8049563: send_echo (ping.c:402)
==5704==    by 0x8049618: ping_run (ping.c:324)
==5704==    by 0x804AADE: ping_echo (ping_echo.c:113)
==5704==    by 0x80499E1: main (ping.c:266)
==5704==
==5704==
==5704== 92 bytes in 1 blocks are still reachable in loss record 5 of 6
==5704==    at 0x40054E5: malloc (vg_replace_malloc.c:149)
==5704==    by 0x804B648: ping_init (libping.c:81)
==5704==    by 0x8049945: main (ping.c:242)
==5704==
==5704==
==5704== 128 bytes in 1 blocks are still reachable in loss record 6 of 6
==5704==    at 0x40054E5: malloc (vg_replace_malloc.c:149)
==5704==    by 0x804B3C5: _ping_setbuf (libping.c:135)
==5704==    by 0x804B58E: ping_set_data (libping.c:148)
==5704==    by 0x8049563: send_echo (ping.c:402)
==5704==    by 0x8049618: ping_run (ping.c:324)
==5704==    by 0x804AADE: ping_echo (ping_echo.c:113)
==5704==    by 0x80499E1: main (ping.c:266)
==5704==
==5704== LEAK SUMMARY:
==5704==    definitely lost: 5 bytes in 1 blocks.
==5704==      possibly lost: 0 bytes in 0 blocks.
==5704==    still reachable: 367 bytes in 5 blocks.
==5704==         suppressed: 0 bytes in 0 blocks.
address@hidden ping]$

Happy hacking,
Debarshi
--
GPG key ID: 63D4A5A7
Key server: pgp.mit.edu




reply via email to

[Prev in Thread] Current Thread [Next in Thread]