[compiler-rt] b4121b3 - [Compiler-rt] Fix running ASan/TSan unit tests under macOS 12.0.

Dan Liew via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 3 17:46:56 PDT 2021


Author: Dan Liew
Date: 2021-08-03T17:46:27-07:00
New Revision: b4121b335c48979716520f36445e6b01bef523cf

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

LOG: [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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/compiler-rt/unittests/lit.common.unit.cfg.py b/compiler-rt/unittests/lit.common.unit.cfg.py
index 4cf5bf7360526..11d99980f8412 100644
--- a/compiler-rt/unittests/lit.common.unit.cfg.py
+++ b/compiler-rt/unittests/lit.common.unit.cfg.py
@@ -46,6 +46,10 @@ def get_lit_conf(name, default=None):
   # 64-bit Darwin. Using more scales badly and hogs the system due to
   # inefficient handling of large mmap'd regions (terabytes) by the kernel.
   lit_config.parallelism_groups["shadow-memory"] = 3
+  # Disable libmalloc nanoallocator due to crashes running on macOS 12.0.
+  #
+  # rdar://80086125
+  config.environment['MallocNanoZone'] = '0'
 
   # The test config gets pickled and sent to multiprocessing workers, and that
   # only works for code if it is stored at the top level of some module.


        


More information about the llvm-commits mailing list