Skip to content

Commit b4121b3

Browse files
committed
[Compiler-rt] Fix running ASan/TSan unit tests under macOS 12.0.
On macOS the unit tests currently rely on libmalloc being used for allocations (due to no functioning interceptors) but also having the ASan/TSan allocator initialized in the same process. This leads to crashes with the macOS 12.0 libmalloc nano allocator so disable use of the allocator while running unit tests as a workaround. rdar://80086125 Differential Revision: https://reviews.llvm.org/D107412
1 parent 143edec commit b4121b3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler-rt/unittests/lit.common.unit.cfg.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ def get_lit_conf(name, default=None):
4646
# 64-bit Darwin. Using more scales badly and hogs the system due to
4747
# inefficient handling of large mmap'd regions (terabytes) by the kernel.
4848
lit_config.parallelism_groups["shadow-memory"] = 3
49+
# Disable libmalloc nanoallocator due to crashes running on macOS 12.0.
50+
#
51+
# rdar://80086125
52+
config.environment['MallocNanoZone'] = '0'
4953

5054
# The test config gets pickled and sent to multiprocessing workers, and that
5155
# only works for code if it is stored at the top level of some module.

0 commit comments

Comments
 (0)