Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
valgrind of collectd snmp plugin memory leak
==7040== HEAP SUMMARY:
==7040== in use at exit: 4,372,425 bytes in 36,718 blocks
==7040== total heap usage: 749,778 allocs, 713,060 frees, 2,007,697,009 bytes allocated
==7040==
==7040== 8 bytes in 1 blocks are definitely lost in loss record 131 of 687
==7040== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==7040== by 0x5759C41: strdup (strdup.c:43)
==7040== by 0x41D79C: yyparse (parser.y:101)
==7040== by 0x41AFCC: oconfig_parse_fh (oconfig.c:60)
==7040== by 0x41B09C: oconfig_parse_file (oconfig.c:90)
==7040== by 0x40AF69: cf_read_generic (configfile.c:635)
==7040== by 0x40B8AC: cf_read (configfile.c:1062)
==7040== by 0x407689: main (collectd.c:466)
==7040==
==7040== 48 bytes in 1 blocks are definitely lost in loss record 514 of 687
==7040== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==7040== by 0x40ABED: cf_read_generic (configfile.c:787)
==7040== by 0x40B8AC: cf_read (configfile.c:1062)
==7040== by 0x407689: main (collectd.c:466)
==7040==
==7040== 96 bytes in 1 blocks are definitely lost in loss record 544 of 687
==7040== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==7040== by 0x4C28D6F: realloc (vg_replace_malloc.c:632)
==7040== by 0x40A5FA: cf_ci_append_children.isra.2 (configfile.c:528)
==7040== by 0x40AEEC: cf_read_generic (configfile.c:833)
==7040== by 0x40B076: cf_read_generic (configfile.c:587)
==7040== by 0x40B8AC: cf_read (configfile.c:1062)
==7040== by 0x407689: main (collectd.c:466)
==7040==
==7040== 176 bytes in 1 blocks are definitely lost in loss record 572 of 687
==7040== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==7040== by 0x5E66B09: csnmp_read_value (snmp.c:1503)
==7040== by 0x5E6835E: csnmp_read_host (snmp.c:1611)
==7040== by 0x410FD8: plugin_read_thread (plugin.c:471)
==7040== by 0x52BFB4F: start_thread (pthread_create.c:304)
==7040==
==7040== 272 bytes in 1 blocks are possibly lost in loss record 589 of 687
==7040== at 0x4C272B8: calloc (vg_replace_malloc.c:566)
==7040== by 0x6083A96: snmp_pdu_create (in /usr/lib/libnetsnmp.so.15.1.2)
==7040== by 0x5E6718A: csnmp_read_table (snmp.c:1277)
==7040== by 0x5E68334: csnmp_read_host (snmp.c:1609)
==7040== by 0x410FD8: plugin_read_thread (plugin.c:471)
==7040== by 0x52BFB4F: start_thread (pthread_create.c:304)
==7040==
==7040== 2,468 bytes in 123 blocks are definitely lost in loss record 647 of 687
==7040== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==7040== by 0x5759C41: strdup (strdup.c:43)
==7040== by 0x411298: plugin_register_complex_read (plugin.c:1165)
==7040== by 0x5E663D7: csnmp_config (snmp.c:687)
==7040== by 0x40BADA: cf_read (configfile.c:407)
==7040== by 0x407689: main (collectd.c:466)
==7040==
==7040== 79,968 bytes in 294 blocks are definitely lost in loss record 682 of 687
==7040== at 0x4C272B8: calloc (vg_replace_malloc.c:566)
==7040== by 0x6083A96: snmp_pdu_create (in /usr/lib/libnetsnmp.so.15.1.2)
==7040== by 0x5E6718A: csnmp_read_table (snmp.c:1277)
==7040== by 0x5E68334: csnmp_read_host (snmp.c:1609)
==7040== by 0x410FD8: plugin_read_thread (plugin.c:471)
==7040== by 0x52BFB4F: start_thread (pthread_create.c:304)
==7040==
==7040== LEAK SUMMARY:
==7040== definitely lost: 82,764 bytes in 421 blocks
==7040== indirectly lost: 0 bytes in 0 blocks
==7040== possibly lost: 272 bytes in 1 blocks
==7040== still reachable: 4,289,389 bytes in 36,296 blocks
==7040== suppressed: 0 bytes in 0 blocks
==7040== Reachable blocks (those to which a pointer was found) are not shown.
==7040== To see them, rerun with: --leak-check=full --show-reachable=yes
==7040==
==7040== For counts of detected and suppressed errors, rerun with: -v
==7040== ERROR SUMMARY: 7 errors from 7 contexts (suppressed: 4 from 4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment