@@ -529,6 +529,31 @@ class MacOSArmWithBrewNoGilRefleakBuild(UnixNoGilRefleakBuild):
529
529
"LDFLAGS=-L/opt/homebrew/lib" ,
530
530
]
531
531
532
+
533
+ class MacOSAsanNoGilBuild (UnixAsanNoGilBuild ):
534
+ buildersuffix = ".macos-with-brew.asan.nogil"
535
+ configureFlags = UnixAsanNoGilBuild .configureFlags + [
536
+ "--with-openssl=/opt/homebrew/opt/openssl@3" ,
537
+ "CPPFLAGS=-I/opt/homebrew/include" ,
538
+ "LDFLAGS=-L/opt/homebrew/lib" ,
539
+ ]
540
+ asan_options = 'detect_leaks=0:allocator_may_return_null=1:handle_segv=0'
541
+ compile_environ = {'ASAN_OPTIONS' : asan_options }
542
+ test_environ = {
543
+ 'ASAN_OPTIONS' : asan_options ,
544
+ # Note: Need to set `MallocNanoZone=0` environment variable to workaround a macOS issue.
545
+ # This was needed to workaround an issue with this builder that manifested as failures in 3 tests:
546
+ # test_cmd_line, test_posix, test_subprocess
547
+ # These failures seem to be related to the occurrence of this warning:
548
+ # python.exe(74602,0x7ff84626a700) malloc: nano zone abandoned due to inability to reserve vm space.
549
+ # It is unclear why (or if) it's *directly* causing the test failures, but setting `MallocNanoZone=0`
550
+ # disables this optimization (and fixes the tests), which appears to be interfering with ASAN. See also:
551
+ # https://stackoverflow.com/questions/64126942/malloc-nano-zone-abandoned-due-to-inability-to-preallocate-reserved-vm-space
552
+ # https://github.com/python/buildmaster-config/issues/450 (and attached PR)
553
+ 'MallocNanoZone' : '0' ,
554
+ }
555
+
556
+
532
557
##############################################################################
533
558
############################ WINDOWS BUILDS ################################
534
559
##############################################################################
0 commit comments