ChugR commented on a change in pull request #1050:
URL: https://github.com/apache/qpid-dispatch/pull/1050#discussion_r584780043



##########
File path: cmake/RuntimeChecks.cmake
##########
@@ -106,9 +106,17 @@ elseif(RUNTIME_CHECK STREQUAL "asan")
     message(FATAL_ERROR "libubsan not installed - address sanitizer not 
available")
   endif(UBSAN_LIBRARY-NOTFOUND)
   message(STATUS "Runtime memory checker: gcc/clang address sanitizers")
+  option(SANITIZE_3RD_PARTY "Detect leaks in 3rd party libraries used by 
Dispatch while running tests" OFF)
+  file (COPY "${CMAKE_SOURCE_DIR}/tests/lsan.supp" DESTINATION 
"${CMAKE_BINARY_DIR}/tests")
+  if (NOT SANITIZE_3RD_PARTY)
+    # Append wholesale library suppressions
+    #  this is necessary if target system does not have debug symbols for 
these libraries installed
+    #  and therefore the more specific suppressions do not match
+    file(APPEND "${CMAKE_BINARY_DIR}/tests/lsan.supp" 
"\nleak:/libpython2.*.so\nleak:/libpython3.*.so\n")
+  endif ()
   set(SANITIZE_FLAGS "-g -fno-omit-frame-pointer -fsanitize=address,undefined")
   set(RUNTIME_ASAN_ENV_OPTIONS "detect_leaks=true 
suppressions=${CMAKE_SOURCE_DIR}/tests/asan.supp")
-  set(RUNTIME_LSAN_ENV_OPTIONS 
"suppressions=${CMAKE_SOURCE_DIR}/tests/lsan.supp")
+  set(RUNTIME_LSAN_ENV_OPTIONS 
"suppressions=${CMAKE_BINARY_DIR}/tests/lsan.supp")

Review comment:
       Copying lsan.supp to BINARY_DIR is a good idea regardless of the rest of 
this PR. The self tests use SOURCE_DIR and BINARY_DIR in a mixed and confusing 
manner, like configuring system_tests_handle_failover.py.in back in to 
SOURCE_DIR, but that's the topic for another jira.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to