You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "Joe McDonnell (Jira)" <ji...@apache.org> on 2023/04/04 23:32:00 UTC

[jira] [Created] (IMPALA-12040) LSAN isn't detecting leaks for backend tests

Joe McDonnell created IMPALA-12040:
--------------------------------------

             Summary: LSAN isn't detecting leaks for backend tests
                 Key: IMPALA-12040
                 URL: https://issues.apache.org/jira/browse/IMPALA-12040
             Project: IMPALA
          Issue Type: Bug
          Components: Backend
    Affects Versions: Impala 4.3.0
            Reporter: Joe McDonnell


I have a backend test that I know leaks memory. It isn't checked in anywhere, but I know from visual inspection that it does leak memory. However, when I compile with ASAN and run the test via ctest, LSAN doesn't detect the leak. Turning on verbose mode, I get this:
{noformat}
54: Test command: /home/joemcdonnell/upstream/Impala/bin/run-jvm-binary.sh "/home/joemcdonnell/upstream/Impala/be/build/debug//runtime/memory-leak-test" "-log_dir=/home/joemcdonnell/upstream/Impala/logs/be_tests"
54: Environment variables: 
54:  LSAN_OPTIONS=suppressions=/home/joemcdonnell/upstream/Impala/bin/lsan-suppressions.txt
54: Test timeout computed to be: 10000000
...
54: [==========] Running 1 test from 1 test case.
54: [----------] Global test environment set-up.
54: [----------] 1 test from MemoryLeakTest
54: [ RUN      ] MemoryLeakTest.LeakMemory
54: [       OK ] MemoryLeakTest.LeakMemory (0 ms)
54: [----------] 1 test from MemoryLeakTest (0 ms total)
54: 
54: [----------] Global test environment tear-down
54: [==========] 1 test from 1 test case ran. (0 ms total)
54: [  PASSED  ] 1 test.
1/1 Test #54: memory-leak-test .................   Passed    0.60 sec

The following tests passed:
    memory-leak-test

100% tests passed, 0 tests failed out of 1
{noformat}
LSAN can detect some memory leaks, but this particular memory leak only gets detected if I also add ASAN_OPTIONS="detect_leaks=1". It looks like we intended that to be added, because we have it listed here in be/CMakeLists.txt:
{noformat}
FUNCTION(ENABLE_LSAN_FOR_TEST TEST_NAME)
    SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES ENVIRONMENT
        "ASAN_OPTIONS=handle_segv=0 detect_leaks=1 allocator_may_return_null=1")
    SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES ENVIRONMENT
        "LSAN_OPTIONS=suppressions=${CMAKE_SOURCE_DIR}/bin/lsan-suppressions.txt")
ENDFUNCTION(){noformat}
The second invocation overwrites the first rather than appending, so we only get LSAN_OPTIONS.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org