Ticket #33 (closed defect: fixed)

Opened 11 years ago

Last modified 10 years ago

Memory leak

Reported by: dkimpe Owned by:
Priority: minor Component: code generator
Version: git repository Keywords:
Cc:

Description

A simple aesop program leaks memory due to the resources not being
stopped/finalized.

Need to revisit once transition to explicit resource initialization is complete.

==32292== 
==32292== HEAP SUMMARY:
==32292==     in use at exit: 1,301 bytes in 8 blocks
==32292==   total heap usage: 20 allocs, 12 frees, 84,494 bytes allocated
==32292== 
==32292== 6 bytes in 1 blocks are still reachable in loss record 1 of 8
==32292==    at 0x4C28F5D: malloc (vg_replace_malloc.c:263)
==32292==    by 0x5552181: strdup (in /lib64/libc-2.13.so)
==32292==    by 0x403CE7: ae_resource_init_register (resource.c:122)
==32292==    by 0x407EE2: aesop_timer_init_register (timer.c:241)
==32292==    by 0x412465: ??? (in /home/lts/git/aesop/parser/tests/blocking/pbranch-empty)
==32292==    by 0x401962: ??? (in /home/lts/git/aesop/parser/tests/blocking/pbranch-empty)
==32292== 
==32292== 7 bytes in 1 blocks are still reachable in loss record 2 of 8
==32292==    at 0x4C28F5D: malloc (vg_replace_malloc.c:263)
==32292==    by 0x5552181: strdup (in /lib64/libc-2.13.so)
==32292==    by 0x403CE7: ae_resource_init_register (resource.c:122)
==32292==    by 0x408CB8: triton_aethread_init_register (aethread.c:263)
==32292==    by 0x412465: ??? (in /home/lts/git/aesop/parser/tests/blocking/pbranch-empty)
==32292==    by 0x401962: ??? (in /home/lts/git/aesop/parser/tests/blocking/pbranch-empty)
==32292== 
==32292== 8 bytes in 1 blocks are still reachable in loss record 3 of 8
==32292==    at 0x4C28F5D: malloc (vg_replace_malloc.c:263)
==32292==    by 0x4C290A7: realloc (vg_replace_malloc.c:632)
==32292==    by 0x409C7E: ev_realloc_emul (ev.c:612)
==32292==    by 0x409CBC: ev_realloc (ev.c:638)
==32292==    by 0x409F30: array_realloc (ev.c:860)
==32292==    by 0x40A590: fd_change (ev.c:1043)
==32292==    by 0x40EEFE: ev_io_start (ev.c:2674)
==32292==    by 0x40AD4E: evpipe_init (ev.c:1317)
==32292==    by 0x40FB53: ev_signal_start (ev.c:2920)
==32292==    by 0x40DB14: ev_default_loop (ev.c:2095)
==32292==    by 0x403E62: ae_resource_register_with_data (resource.c:165)
==32292==    by 0x403DBA: ae_resource_register (resource.c:136)
==32292== 
==32292== 48 bytes in 1 blocks are still reachable in loss record 4 of 8
==32292==    at 0x4C29042: realloc (vg_replace_malloc.c:632)
==32292==    by 0x409C7E: ev_realloc_emul (ev.c:612)
==32292==    by 0x409CBC: ev_realloc (ev.c:638)
==32292==    by 0x409F30: array_realloc (ev.c:860)
==32292==    by 0x411B0D: ev_async_start (ev.c:3689)
==32292==    by 0x404052: ae_resource_register_with_data (resource.c:191)
==32292==    by 0x403DBA: ae_resource_register (resource.c:136)
==32292==    by 0x407F65: aesop_timer_init (timer.c:259)
==32292==    by 0x4059F9: ae_resource_init_all (resource.c:978)
==32292==    by 0x403625: aesop_init (aesop.c:42)
==32292==    by 0x40347B: main (pbranch-empty.ae.s:2528)
==32292== 
==32292== 128 bytes in 1 blocks are still reachable in loss record 5 of 8
==32292==    at 0x4C28F5D: malloc (vg_replace_malloc.c:263)
==32292==    by 0x4C290A7: realloc (vg_replace_malloc.c:632)
==32292==    by 0x409C7E: ev_realloc_emul (ev.c:612)
==32292==    by 0x409CBC: ev_realloc (ev.c:638)
==32292==    by 0x409F30: array_realloc (ev.c:860)
==32292==    by 0x40EE78: ev_io_start (ev.c:2671)
==32292==    by 0x40AD4E: evpipe_init (ev.c:1317)
==32292==    by 0x40FB53: ev_signal_start (ev.c:2920)
==32292==    by 0x40DB14: ev_default_loop (ev.c:2095)
==32292==    by 0x403E62: ae_resource_register_with_data (resource.c:165)
==32292==    by 0x403DBA: ae_resource_register (resource.c:136)
==32292==    by 0x408D27: aethread_init (aethread.c:279)
==32292== 
==32292== 168 bytes in 1 blocks are still reachable in loss record 6 of 8
==32292==    at 0x4C28F5D: malloc (vg_replace_malloc.c:263)
==32292==    by 0x409804: ae_opcache_init (opcache.c:229)
==32292==    by 0x408CFE: aethread_init (aethread.c:272)
==32292==    by 0x4059F9: ae_resource_init_all (resource.c:978)
==32292==    by 0x403625: aesop_init (aesop.c:42)
==32292==    by 0x40347B: main (pbranch-empty.ae.s:2528)
==32292== 
==32292== 168 bytes in 1 blocks are still reachable in loss record 7 of 8
==32292==    at 0x4C28F5D: malloc (vg_replace_malloc.c:263)
==32292==    by 0x409804: ae_opcache_init (opcache.c:229)
==32292==    by 0x407F46: aesop_timer_init (timer.c:253)
==32292==    by 0x4059F9: ae_resource_init_all (resource.c:978)
==32292==    by 0x403625: aesop_init (aesop.c:42)
==32292==    by 0x40347B: main (pbranch-empty.ae.s:2528)
==32292== 
==32292== 768 bytes in 1 blocks are still reachable in loss record 8 of 8
==32292==    at 0x4C28F5D: malloc (vg_replace_malloc.c:263)
==32292==    by 0x4C290A7: realloc (vg_replace_malloc.c:632)
==32292==    by 0x409C7E: ev_realloc_emul (ev.c:612)
==32292==    by 0x409CBC: ev_realloc (ev.c:638)
==32292==    by 0x40BA5C: epoll_init (ev_epoll.c:242)
==32292==    by 0x40CB09: loop_init (ev.c:1752)
==32292==    by 0x40DAB0: ev_default_loop (ev.c:2088)
==32292==    by 0x403E62: ae_resource_register_with_data (resource.c:165)
==32292==    by 0x403DBA: ae_resource_register (resource.c:136)
==32292==    by 0x408D27: aethread_init (aethread.c:279)
==32292==    by 0x4059F9: ae_resource_init_all (resource.c:978)
==32292==    by 0x403625: aesop_init (aesop.c:42)
==32292== 
==32292== LEAK SUMMARY:
==32292==    definitely lost: 0 bytes in 0 blocks
==32292==    indirectly lost: 0 bytes in 0 blocks
==32292==      possibly lost: 0 bytes in 0 blocks
==32292==    still reachable: 1,301 bytes in 8 blocks
==32292==         suppressed: 0 bytes in 0 blocks
==32292== 
==32292== For counts of detected and suppressed errors, rerun with: -v
==32292== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 6 from 6)

Change History

comment:1 Changed 10 years ago by carns

  • Status changed from new to closed
  • Resolution set to fixed

This should be fixed now. We can reopen this ticket if we find a specific counter-example.

Note: See TracTickets for help on using tickets.