Skip to content

Memory leak in testOutputList

When running with the sanitizer on, we get a leak running testOutputList:

==20877==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 480 byte(s) in 4 object(s) allocated from:
    #0 0x7f88a5b3fb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x7f88a3004b8b in getdelim (/lib/x86_64-linux-gnu/libc.so.6+0x7fb8b)

Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x7f88a5b3fb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x55643999f694 in output_list_init /home/matthieu/Desktop/Swift-git/master/swiftsim/src/outputlist.c:228
    #2 0x556439975887 in test_cosmo /home/matthieu/Desktop/Swift-git/master/swiftsim/tests/testOutputList.c:95
    #3 0x5564399762e3 in main /home/matthieu/Desktop/Swift-git/master/swiftsim/tests/testOutputList.c:151
    #4 0x7f88a2fa6b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x7f88a5b3fb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x55643999f694 in output_list_init /home/matthieu/Desktop/Swift-git/master/swiftsim/src/outputlist.c:228
    #2 0x556439975887 in test_cosmo /home/matthieu/Desktop/Swift-git/master/swiftsim/tests/testOutputList.c:95
    #3 0x5564399762ff in main /home/matthieu/Desktop/Swift-git/master/swiftsim/tests/testOutputList.c:152
    #4 0x7f88a2fa6b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x7f88a5b3fb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x55643999f694 in output_list_init /home/matthieu/Desktop/Swift-git/master/swiftsim/src/outputlist.c:228
    #2 0x556439975887 in test_cosmo /home/matthieu/Desktop/Swift-git/master/swiftsim/tests/testOutputList.c:95
    #3 0x5564399762c7 in main /home/matthieu/Desktop/Swift-git/master/swiftsim/tests/testOutputList.c:150
    #4 0x7f88a2fa6b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x7f88a5b3fb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x55643999f694 in output_list_init /home/matthieu/Desktop/Swift-git/master/swiftsim/src/outputlist.c:228
    #2 0x556439974d29 in test_no_cosmo /home/matthieu/Desktop/Swift-git/master/swiftsim/tests/testOutputList.c:59
    #3 0x5564399762ab in main /home/matthieu/Desktop/Swift-git/master/swiftsim/tests/testOutputList.c:147
    #4 0x7f88a2fa6b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

SUMMARY: AddressSanitizer: 576 byte(s) leaked in 8 allocation(s).

It looks like the function output_list_init() has a malloc() with no matching free(). This may also affect SWIFT itself.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information