gtDMMB/RNAStructViz

TODO: Resolve all memory leaks reported on close by the AddressSanitizer

maxieds opened this issue · 4 comments

Some of these may actually be in external libraries over which we have no control...

There only appears to be one leak left to handle:

STATUS: Handling <CTRL+C> (SIGINT) signal ... Saving config and exiting.

=================================================================
==15423==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 6912 byte(s) in 9 object(s) allocated from:
    #0 0x7f4bc3f9cf40 in realloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdef40)
    #1 0x7f4bc2a8b998  (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1d998)

Direct leak of 4608 byte(s) in 18 object(s) allocated from:
    #0 0x7f4bc3f9cb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x7f4bc2a8b8ed  (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1d8ed)

Direct leak of 24 byte(s) in 3 object(s) allocated from:
    #0 0x7f4bc3f9cb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x562455a5a9c5 in StructureManager::AddFile(char const*, bool, bool) /home/maxie/RNA-projects/RNAStructViz/src/StructureManager.cpp:70
    #2 0x5624559f46c7 in SelectAllButton::LoadAllFilesFromDirectory(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char const*, bool, bool, bool, bool) /home/maxie/RNA-projects/RNAStructViz/src/LoadFileSelectAllButton.cpp:212
    #3 0x5624559f4e20 in SelectAllButton::LoadAllFilesFromDirectory(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, SelectAllButton const&) /home/maxie/RNA-projects/RNAStructViz/src/LoadFileSelectAllButton.cpp:228
    #4 0x5624559fc92d in MainWindow::OpenFileCallback(Fl_Widget*, void*) /home/maxie/RNA-projects/RNAStructViz/src/MainWindow.cpp:298
    #5 0x562455aa40be in Fl_Widget::do_callback(Fl_Widget*, void*) (/home/maxie/RNA-projects/RNAStructViz/src/RNAStructViz+0x1ae0be)
    #6 0x5b97e7a170ba19ff  (<unknown module>)

Indirect leak of 8640 byte(s) in 270 object(s) allocated from:
    #0 0x7f4bc3f9cd38 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded38)
    #1 0x7f4bc2a8b5c4  (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1d5c4)

Indirect leak of 4230 byte(s) in 158 object(s) allocated from:
    #0 0x7f4bc3f35538 in strdup (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x77538)
    #1 0x7f4bc2a8b2f4 in FcValueSave (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1d2f4)

Indirect leak of 3264 byte(s) in 102 object(s) allocated from:
    #0 0x7f4bc3f9cd38 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded38)
    #1 0x7f4bc2a8bfd8  (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1dfd8)

Indirect leak of 1728 byte(s) in 54 object(s) allocated from:
    #0 0x7f4bc3f9cd38 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded38)
    #1 0x7f4bc2a8b440  (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1d440)

Indirect leak of 432 byte(s) in 9 object(s) allocated from:
    #0 0x7f4bc3f9cb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x7f4bc2a85acd in FcLangSetCreate (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x17acd)

SUMMARY: AddressSanitizer: 29838 byte(s) leaked in 623 allocation(s).

Based on the outputs under Linux, this looks fixed as of the latest commit... Closing issue as fixed.

This is what remains after multiple, varied operations:

STATUS: Handling <CTRL+C> (SIGINT) signal ... Saving config and exiting.
Fl_Text_Buffer::remove_modify_callback(): Can't find modify CB to remove
Fl_Text_Buffer::remove_predelete_callback(): Can't find pre-delete CB to remove

=================================================================
==24645==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 9984 byte(s) in 13 object(s) allocated from:
    #0 0x7f1e1a2d9f40 in realloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdef40)
    #1 0x7f1e18dc8998  (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1d998)

Direct leak of 5120 byte(s) in 20 object(s) allocated from:
    #0 0x7f1e1a2d9b50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x7f1e18dc88ed  (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1d8ed)

Indirect leak of 12480 byte(s) in 390 object(s) allocated from:
    #0 0x7f1e1a2d9d38 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded38)
    #1 0x7f1e18dc85c4  (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1d5c4)

Indirect leak of 5984 byte(s) in 216 object(s) allocated from:
    #0 0x7f1e1a272538 in strdup (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x77538)
    #1 0x7f1e18dc82f4 in FcValueSave (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1d2f4)

Indirect leak of 4352 byte(s) in 136 object(s) allocated from:
    #0 0x7f1e1a2d9d38 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded38)
    #1 0x7f1e18dc8fd8  (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1dfd8)

Indirect leak of 2496 byte(s) in 78 object(s) allocated from:
    #0 0x7f1e1a2d9d38 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded38)
    #1 0x7f1e18dc8440  (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1d440)

Indirect leak of 624 byte(s) in 13 object(s) allocated from:
    #0 0x7f1e1a2d9b50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x7f1e18dc2acd in FcLangSetCreate (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x17acd)

SUMMARY: AddressSanitizer: 41040 byte(s) leaked in 866 allocation(s).

Once again, I think this is fixed. At least as far as I can tell by testing for memory leaks on Linux:

=================================================================
==20662==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 9984 byte(s) in 13 object(s) allocated from:
    #0 0x7f7efb621f40 in realloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdef40)
    #1 0x7f7efa110998  (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1d998)

Direct leak of 4864 byte(s) in 19 object(s) allocated from:
    #0 0x7f7efb621b50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x7f7efa1108ed  (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1d8ed)

Indirect leak of 12480 byte(s) in 390 object(s) allocated from:
    #0 0x7f7efb621d38 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded38)
    #1 0x7f7efa1105c4  (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1d5c4)

Indirect leak of 5974 byte(s) in 215 object(s) allocated from:
    #0 0x7f7efb5ba538 in strdup (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x77538)
    #1 0x7f7efa1102f4 in FcValueSave (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1d2f4)

Indirect leak of 4256 byte(s) in 133 object(s) allocated from:
    #0 0x7f7efb621d38 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded38)
    #1 0x7f7efa110fd8  (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1dfd8)

Indirect leak of 2496 byte(s) in 78 object(s) allocated from:
    #0 0x7f7efb621d38 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded38)
    #1 0x7f7efa110440  (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1d440)

Indirect leak of 624 byte(s) in 13 object(s) allocated from:
    #0 0x7f7efb621b50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x7f7efa10aacd in FcLangSetCreate (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x17acd)

SUMMARY: AddressSanitizer: 40678 byte(s) leaked in 861 allocation(s).

That is to say, everything that remains appears to happen in an external library over which our developers have no control. RNAStructViz does not leak memory as far as I can now see!