Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Valgrind reports memory leak in flisp #13540

Closed
Keno opened this issue Oct 11, 2015 · 4 comments
Closed

Valgrind reports memory leak in flisp #13540

Keno opened this issue Oct 11, 2015 · 4 comments

Comments

@Keno
Copy link
Member

Keno commented Oct 11, 2015

I assume this may just be because flisp doesn't run finalizers in deinitialization, but just in case and for posterity, valgrind reports the following (found because address sanitizer complains as well):

valgrind --leak-check=full ./flisp/flisp /home/ubuntu/julia-gallium/src/mk_julia_flisp_boot.scm /home/ubuntu/julia-gallium/src/ jlfrontend.scm julia_flisp.boot
==7753== Memcheck, a memory error detector
==7753== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==7753== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info
==7753== Command: ./flisp/flisp /home/ubuntu/julia-gallium/src/mk_julia_flisp_boot.scm /home/ubuntu/julia-gallium/src/ jlfrontend.scm julia_flisp.boot
==7753==
==7753==
==7753== HEAP SUMMARY:
==7753==     in use at exit: 11,295,048 bytes in 3,582 blocks
==7753==   total heap usage: 5,288 allocs, 1,706 frees, 20,212,763 bytes allocated
==7753==
==7753== 4,608 bytes in 4 blocks are definitely lost in loss record 203 of 228
==7753==    at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7753==    by 0x41F746: equalhash_lookup_bp (equalhash.c:19)
==7753==    by 0x41F908: equalhash_put (equalhash.c:19)
==7753==    by 0x4201F6: fl_table_put (table.c:122)
==7753==    by 0x415992: apply_cl (flisp.c:1276)
==7753==    by 0x417AF2: do_trycatch (flisp.c:950)
==7753==    by 0x414E59: apply_cl (flisp.c:1856)
==7753==    by 0x417AF2: do_trycatch (flisp.c:950)
==7753==    by 0x414E59: apply_cl (flisp.c:1856)
==7753==    by 0x417AF2: do_trycatch (flisp.c:950)
==7753==    by 0x414E59: apply_cl (flisp.c:1856)
==7753==    by 0x417AF2: do_trycatch (flisp.c:950)
==7753==
==7753== LEAK SUMMARY:
==7753==    definitely lost: 4,608 bytes in 4 blocks
==7753==    indirectly lost: 0 bytes in 0 blocks
==7753==      possibly lost: 0 bytes in 0 blocks
==7753==    still reachable: 11,290,440 bytes in 3,578 blocks
==7753==         suppressed: 0 bytes in 0 blocks
==7753== Reachable blocks (those to which a pointer was found) are not shown.
==7753== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==7753==
==7753== For counts of detected and suppressed errors, rerun with: -v
==7753== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
@JeffBezanson
Copy link
Sponsor Member

I think you're right that this is probably just due to not running finalizers on exit.

@JeffBezanson JeffBezanson added the status:won't change Indicates that work won't continue on an issue or pull request label Oct 21, 2015
@Keno
Copy link
Member Author

Keno commented Nov 2, 2015

Can we add a sanitizer/valgrind only codepath that calls the finalizers on exit?

@tkelman
Copy link
Contributor

tkelman commented Nov 2, 2015

If someone is going to go to the effort of writing the code to call finalizers on exit, why wouldn't you run it unconditionally?

@Keno Keno reopened this Aug 5, 2022
@Keno Keno removed the status:won't change Indicates that work won't continue on an issue or pull request label Aug 11, 2022
@inkydragon
Copy link
Sponsor Member

Closed by #46249

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants