Skip to content

Commit ee08005

Browse files
authored
Merge pull request #8568 from chelcassanova/cherrypick/reland-lldb-lit-mallocnanozone
Reland "[lldb][lit] Add MallocNanoZone envvar to Darwin ASan builds" …
2 parents 5a302e4 + b0e130f commit ee08005

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

lldb/test/API/lit.cfg.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ def delete_module_cache(path):
128128
config.environment["DYLD_INSERT_LIBRARIES"] = find_sanitizer_runtime(
129129
"libclang_rt.asan_osx_dynamic.dylib"
130130
)
131+
config.environment["MallocNanoZone"] = "0"
131132

132133
if "Thread" in config.llvm_use_sanitizer:
133134
if "Darwin" in config.host_os:

lldb/test/Shell/lit.cfg.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@
5555
]
5656
)
5757

58+
# Enable sanitizer runtime flags.
59+
if "Address" in config.llvm_use_sanitizer:
60+
config.environment["ASAN_OPTIONS"] = "detect_stack_use_after_return=1"
61+
if platform.system() == "Darwin":
62+
config.environment["MallocNanoZone"] = "0"
63+
64+
if "Thread" in config.llvm_use_sanitizer:
65+
config.environment["TSAN_OPTIONS"] = "halt_on_error=1"
66+
5867
# Support running the test suite under the lldb-repro wrapper. This makes it
5968
# possible to capture a test suite run and then rerun all the test from the
6069
# just captured reproducer.

lldb/test/Shell/lit.site.cfg.py.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ config.lldb_enable_lua = @LLDB_ENABLE_LUA@
2828
config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@"
2929
config.have_lldb_server = @LLDB_TOOL_LLDB_SERVER_BUILD@
3030
config.lldb_system_debugserver = @LLDB_USE_SYSTEM_DEBUGSERVER@
31+
config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
3132
# The shell tests use their own module caches.
3233
config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", "lldb-shell")
3334
config.clang_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_CLANG@", "lldb-shell")

0 commit comments

Comments
 (0)