Re: Big memory leak in division operator example !
- Posted by Domingo Alvarez Duarte <domingo at dad-it.com> Jun 20, 2007
- 691 views
This one was done without "-fomit-frame-pointer" and "-g" compiled euphoria and gives a lot more details: $ valgrind --show-reachable=yes --leak-check=yes exu test-memory-leak2.exu ==15474== Memcheck, a memory error detector. ==15474== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al. ==15474== Using LibVEX rev 1658, a library for dynamic binary translation. ==15474== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP. ==15474== Using valgrind-3.2.1-Debian, a dynamic binary instrumentation framework. ==15474== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al. ==15474== For more details, rerun with: -v ==15474== No memory leak till now !!! starting division... Look at the memory leak now !!!! finished... ==15474== ==15474== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 15 from 1) ==15474== malloc/free: in use at exit: 119,365 bytes in 2,719 blocks. ==15474== malloc/free: 10,156 allocs, 7,437 frees, 543,167 bytes allocated. ==15474== For counts of detected errors, rerun with: -v ==15474== searching for pointers to 2,719 not-freed blocks. ==15474== checked 338,092 bytes. ==15474== ==15474== 8 bytes in 1 blocks are still reachable in loss record 1 of 19 ==15474== at 0x4020620: malloc (vg_replace_malloc.c:149) ==15474== by 0x8088EDD: be_init (be_main.c:175) ==15474== by 0x808B7FB: start_backend (be_machine.c:4549) ==15474== by 0x808D54E: machine (be_machine.c:4893) ==15474== by 0x807864E: _17BackEnd (backend.c:2032) ==15474== by 0x807A711: _18main (main.c:663) ==15474== by 0x804E004: main0 (main-0.c:416) ==15474== by 0x804D9CF: main (main-.c:2383) ==15474== ==15474== ==15474== 8 bytes in 1 blocks are definitely lost in loss record 2 of 19 ==15474== at 0x4020620: malloc (vg_replace_malloc.c:149) ==15474== by 0x8084385: eu_startup (be_runtime.c:3624) ==15474== by 0x8049143: main (main-.c:126) ==15474== ==15474== ==15474== 12 bytes in 1 blocks are still reachable in loss record 3 of 19 ==15474== at 0x4020620: malloc (vg_replace_malloc.c:149) ==15474== by 0x8082F80: shift_args (be_runtime.c:4272) ==15474== by 0x8049154: main (main-.c:129) ==15474== ==15474== ==15474== 23 bytes in 1 blocks are still reachable in loss record 4 of 19 ==15474== at 0x4020620: malloc (vg_replace_malloc.c:149) ==15474== by 0x8088F96: be_init (be_main.c:187) ==15474== by 0x808B7FB: start_backend (be_machine.c:4549) ==15474== by 0x808D54E: machine (be_machine.c:4893) ==15474== by 0x807864E: _17BackEnd (backend.c:2032) ==15474== by 0x807A711: _18main (main.c:663) ==15474== by 0x804E004: main0 (main-0.c:416) ==15474== by 0x804D9CF: main (main-.c:2383) ==15474== ==15474== ==15474== 48 bytes in 4 blocks are definitely lost in loss record 5 of 19 ==15474== at 0x4020620: malloc (vg_replace_malloc.c:149) ==15474== by 0x808B45E: Dminus (be_inline.c:46) ==15474== by 0x807D34F: do_exec (be_execute.c:2379) ==15474== by 0x8082180: Execute (be_execute.c:1396) ==15474== by 0x808B80B: start_backend (be_machine.c:4551) ==15474== by 0x808D54E: machine (be_machine.c:4893) ==15474== by 0x807864E: _17BackEnd (backend.c:2032) ==15474== by 0x807A711: _18main (main.c:663) ==15474== by 0x804E004: main0 (main-0.c:416) ==15474== by 0x804D9CF: main (main-.c:2383) ==15474== ==15474== ==15474== 100 bytes in 1 blocks are still reachable in loss record 6 of 19 ==15474== at 0x4020620: malloc (vg_replace_malloc.c:149) ==15474== by 0x808A6A8: InitTraceWindow (be_rterror.c:222) ==15474== by 0x808B7FB: start_backend (be_machine.c:4549) ==15474== by 0x808D54E: machine (be_machine.c:4893) ==15474== by 0x807864E: _17BackEnd (backend.c:2032) ==15474== by 0x807A711: _18main (main.c:663) ==15474== by 0x804E004: main0 (main-0.c:416) ==15474== by 0x804D9CF: main (main-.c:2383) ==15474== ==15474== ==15474== 100 bytes in 1 blocks are still reachable in loss record 7 of 19 ==15474== at 0x4020620: malloc (vg_replace_malloc.c:149) ==15474== by 0x808E741: InitTask (be_task.c:242) ==15474== by 0x80823B8: InitExecute (be_execute.c:725) ==15474== by 0x8088F5F: be_init (be_main.c:212) ==15474== by 0x808B7FB: start_backend (be_machine.c:4549) ==15474== by 0x808D54E: machine (be_machine.c:4893) ==15474== by 0x807864E: _17BackEnd (backend.c:2032) ==15474== by 0x807A711: _18main (main.c:663) ==15474== by 0x804E004: main0 (main-0.c:416) ==15474== by 0x804D9CF: main (main-.c:2383) ==15474== ==15474== ==15474== 100 bytes in 1 blocks are definitely lost in loss record 8 of 19 ==15474== at 0x4020620: malloc (vg_replace_malloc.c:149) ==15474== by 0x808E741: InitTask (be_task.c:242) ==15474== by 0x8049143: main (main-.c:126) ==15474== ==15474== ==15474== 120 bytes in 10 blocks are still reachable in loss record 9 of 19 ==15474== at 0x4020620: malloc (vg_replace_malloc.c:149) ==15474== by 0x8089151: tmp_alloc (be_alloc.c:155) ==15474== by 0x8089174: InitEMalloc (be_alloc.c:185) ==15474== by 0x808436E: eu_startup (be_runtime.c:3621) ==15474== by 0x8049143: main (main-.c:126) ==15474== ==15474== ==15474== 168 bytes in 14 blocks are definitely lost in loss record 10 of 19 ==15474== at 0x4020620: malloc (vg_replace_malloc.c:149) ==15474== by 0x808B3A7: NewDouble (be_inline.c:46) ==15474== by 0x804ECFF: init_literal (init-.c:729) ==15474== by 0x8049148: main (main-.c:128) ==15474== ==15474== ==15474== 228 bytes in 5 blocks are still reachable in loss record 11 of 19 ==15474== at 0x4020620: malloc (vg_replace_malloc.c:149) ==15474== by 0x808904C: NewS1 (be_alloc.c:752) ==15474== by 0x808910C: NewString (be_alloc.c:771) ==15474== by 0x804E1BE: init_literal (init-.c:559) ==15474== by 0x8049148: main (main-.c:128) ==15474== ==15474== ==15474== 372 bytes in 31 blocks are still reachable in loss record 12 of 19 ==15474== at 0x4020620: malloc (vg_replace_malloc.c:149) ==15474== by 0x808B45E: Dminus (be_inline.c:46) ==15474== by 0x8086668: binary_op (be_runtime.c:1881) ==15474== by 0x8073C27: _16compress (compress.c:301) ==15474== by 0x807715C: _17BackEnd (backend.c:851) ==15474== by 0x807A711: _18main (main.c:663) ==15474== by 0x804E004: main0 (main-0.c:416) ==15474== by 0x804D9CF: main (main-.c:2383) ==15474== ==15474== ==15474== 800 bytes in 1 blocks are still reachable in loss record 13 of 19 ==15474== at 0x4020620: malloc (vg_replace_malloc.c:149) ==15474== by 0x807C1E8: InitStack (be_execute.c:693) ==15474== by 0x80823B3: InitExecute (be_execute.c:722) ==15474== by 0x8088F5F: be_init (be_main.c:212) ==15474== by 0x808B7FB: start_backend (be_machine.c:4549) ==15474== by 0x808D54E: machine (be_machine.c:4893) ==15474== by 0x807864E: _17BackEnd (backend.c:2032) ==15474== by 0x807A711: _18main (main.c:663) ==15474== by 0x804E004: main0 (main-0.c:416) ==15474== by 0x804D9CF: main (main-.c:2383) ==15474== ==15474== ==15474== 1,932 bytes in 6 blocks are definitely lost in loss record 14 of 19 ==15474== at 0x402071B: realloc (vg_replace_malloc.c:306) ==15474== by 0x8085273: Append (be_runtime.c:689) ==15474== by 0x804C2E2: main (main-.c:1710) ==15474== ==15474== ==15474== 7,800 bytes in 49 blocks are possibly lost in loss record 15 of 19 ==15474== at 0x4020620: malloc (vg_replace_malloc.c:149) ==15474== by 0x808CD1E: machine (be_machine.c:2523) ==15474== by 0x805098A: _7allocate (machine.c:17) ==15474== by 0x8074B30: _17BackEnd (backend.c:456) ==15474== by 0x807A711: _18main (main.c:663) ==15474== by 0x804E004: main0 (main-0.c:416) ==15474== by 0x804D9CF: main (main-.c:2383) ==15474== ==15474== ==15474== 10,704 bytes in 892 blocks are still reachable in loss record 16 of 19 ==15474== at 0x4020620: malloc (vg_replace_malloc.c:149) ==15474== by 0x808B3DE: Dadd (be_inline.c:46) ==15474== by 0x8086668: binary_op (be_runtime.c:1881) ==15474== by 0x8054AEF: _10hashfn (symtab.c:107) ==15474== by 0x8055D99: _10InitSymTab (symtab.c:1280) ==15474== by 0x807A6DE: _18main (main.c:636) ==15474== by 0x804E004: main0 (main-0.c:416) ==15474== by 0x804D9CF: main (main-.c:2383) ==15474== ==15474== ==15474== 13,236 bytes in 1,103 blocks are still reachable in loss record 17 of 19 ==15474== at 0x4020620: malloc (vg_replace_malloc.c:149) ==15474== by 0x808B3A7: NewDouble (be_inline.c:46) ==15474== by 0x80493C9: main (main-.c:274) ==15474== ==15474== ==15474== 35,830 bytes in 60 blocks are still reachable in loss record 18 of 19 ==15474== at 0x4020620: malloc (vg_replace_malloc.c:149) ==15474== by 0x808CD1E: machine (be_machine.c:2523) ==15474== by 0x805098A: _7allocate (machine.c:17) ==15474== by 0x804941A: main (main-.c:288) ==15474== ==15474== ==15474== 47,776 bytes in 537 blocks are definitely lost in loss record 19 of 19 ==15474== at 0x4020620: malloc (vg_replace_malloc.c:149) ==15474== by 0x808904C: NewS1 (be_alloc.c:752) ==15474== by 0x808910C: NewString (be_alloc.c:771) ==15474== by 0x804E0E1: init_literal (init-.c:546) ==15474== by 0x8049148: main (main-.c:128) ==15474== ==15474== LEAK SUMMARY: ==15474== definitely lost: 50,032 bytes in 563 blocks. ==15474== possibly lost: 7,800 bytes in 49 blocks. ==15474== still reachable: 61,533 bytes in 2,107 blocks. ==15474== suppressed: 0 bytes in 0 blocks.