[Lldb-commits] [lldb] Reland "[lldb][lit] Add MallocNanoZone envvar to Darwin ASan builds" … (PR #88442)

Chelsea Cassanova via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 11 14:24:36 PDT 2024


https://github.com/chelcassanova created https://github.com/llvm/llvm-project/pull/88442

…(#88436)"

This reverts commit 1f5d130df85c2d0550dc8687ad0fa1d96856c318. The original commit checks that the host system is "Darwin" before setting the `MallocNanoZone` envvar, but on the Shell lit config this attribute does not exist at the point where it is being checked which leads to a build failure.

This commit checks the host OS correctly.

>From dc964330c1409a2089c54114d1efea43cc835599 Mon Sep 17 00:00:00 2001
From: Chelsea Cassanova <chelsea_cassanova at apple.com>
Date: Thu, 11 Apr 2024 14:18:22 -0700
Subject: [PATCH] Reland "[lldb][lit] Add MallocNanoZone envvar to Darwin ASan
 builds" (#88436)"

This reverts commit 1f5d130df85c2d0550dc8687ad0fa1d96856c318. The
original commit checks that the host system is "Darwin" before setting
the `MallocNanoZone` envvar, but on the Shell lit config this attribute
does not exist at the point where it is being checked which leads to a
build failure.

This commit checks the host OS correctly.
---
 lldb/test/API/lit.cfg.py   | 1 +
 lldb/test/Shell/lit.cfg.py | 2 ++
 2 files changed, 3 insertions(+)

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..290569576ac80d 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 platform.system() == "Darwin":
+    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