[Lldb-commits] [lldb] 4df854e - [lldb][lit] Add MallocNanoZone envvar to Darwin ASan builds (#88431)

via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 11 13:38:30 PDT 2024


Author: Chelsea Cassanova
Date: 2024-04-11T13:38:26-07:00
New Revision: 4df854e1a98ed47c955838d2c94bf2913c50041f

URL: https://github.com/llvm/llvm-project/commit/4df854e1a98ed47c955838d2c94bf2913c50041f
DIFF: https://github.com/llvm/llvm-project/commit/4df854e1a98ed47c955838d2c94bf2913c50041f.diff

LOG: [lldb][lit] Add MallocNanoZone envvar to Darwin ASan builds (#88431)

When builds on Darwin are configured with ASan, running tests will emit
a warning about malloc's nano zone (`malloc: nano zone abandoned due to inability to reserve vm space`) that can interfere with the test
output and cause failures. Setting the environment variable
`MallocNanoZone` to 0 will remove this warning and allow the tests to
run as normal.

Added: 
    

Modified: 
    lldb/test/API/lit.cfg.py
    lldb/test/Shell/lit.cfg.py

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/lit.cfg.py b/lldb/test/API/lit.cfg.py
index f9497b632fc504..9ea389c639a013 100644
--- a/lldb/test/API/lit.cfg.py
+++ b/lldb/test/API/lit.cfg.py
@@ -121,6 +121,7 @@ def delete_module_cache(path):
             config.environment["DYLD_INSERT_LIBRARIES"] = find_sanitizer_runtime(
                 "libclang_rt.asan_osx_dynamic.dylib"
             )
+            config.environment["MallocNanoZone"] = "0"
 
     if "Thread" in config.llvm_use_sanitizer:
         config.environment["TSAN_OPTIONS"] = "halt_on_error=1"

diff  --git a/lldb/test/Shell/lit.cfg.py b/lldb/test/Shell/lit.cfg.py
index 31afe5151c0661..345627835d2bf2 100644
--- a/lldb/test/Shell/lit.cfg.py
+++ b/lldb/test/Shell/lit.cfg.py
@@ -52,6 +52,8 @@
 # Enable sanitizer runtime flags.
 config.environment["ASAN_OPTIONS"] = "detect_stack_use_after_return=1"
 config.environment["TSAN_OPTIONS"] = "halt_on_error=1"
+if "Darwin" in config.host_os:
+    config.environment["MallocNanoZone"] = "0"
 
 # Support running the test suite under the lldb-repro wrapper. This makes it
 # possible to capture a test suite run and then rerun all the test from the


        


More information about the lldb-commits mailing list