Skip to content

Reland "[lldb][lit] Add MallocNanoZone envvar to Darwin ASan builds" … #88442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

chelcassanova
Copy link
Contributor

…(#88436)"

This reverts commit 1f5d130. 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.

…lvm#88436)"

This reverts commit 1f5d130. 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.
@llvmbot
Copy link
Member

llvmbot commented Apr 11, 2024

@llvm/pr-subscribers-lldb

Author: Chelsea Cassanova (chelcassanova)

Changes

…(#88436)"

This reverts commit 1f5d130. 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.


Full diff: https://github.com/llvm/llvm-project/pull/88442.diff

2 Files Affected:

  • (modified) lldb/test/API/lit.cfg.py (+1)
  • (modified) lldb/test/Shell/lit.cfg.py (+2)
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

Copy link
Collaborator

@jasonmolenda jasonmolenda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

@chelcassanova chelcassanova merged commit c1a4456 into llvm:main Apr 12, 2024
chelcassanova added a commit to chelcassanova/llvm-project that referenced this pull request Apr 15, 2024
llvm#88442)

…(llvm#88436)"

This reverts commit 1f5d130. 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.

(cherry picked from commit c1a4456)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants