Skip to content

Commit c2f3b2f

Browse files
committed
[asan] disable MallocNanoZone for no fd test on darwin
On Darwin, MallocNanoZone may log after execv, which messes up this test. Disable MallocNanoZone for this test since we don't use it anyway with asan. This environment variable should only affect Darwin and not change behavior on other platforms. rdar://74992832 Reviewed By: delcypher Differential Revision: https://reviews.llvm.org/D98735
1 parent 9adc907 commit c2f3b2f

File tree

1 file changed

+7
-5
lines changed
  • compiler-rt/test/asan/TestCases/Posix

1 file changed

+7
-5
lines changed

compiler-rt/test/asan/TestCases/Posix/no-fd.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
// RUN: %clangxx_asan -std=c++11 -O0 %s -o %t
2-
// RUN: %run %t 2>&1 | FileCheck %s
3-
// RUN: %env_asan_opts=debug=1,verbosity=2 %run %t 2>&1 | FileCheck %s
2+
3+
// MallocNanoZone=0 disables initialization of the Nano MallocZone on Darwin.
4+
// Initialization of this zone can interfere with this test because the zone
5+
// might log which opens another file descriptor,
6+
// e.g. failing to setup the zone due to ASan taking the memory region it wants.
7+
// RUN: env MallocNanoZone=0 %run %t 2>&1 | FileCheck %s
8+
// RUN: env MallocNanoZone=0 %env_asan_opts=debug=1,verbosity=2 %run %t 2>&1 | FileCheck %s
49

510
// Test ASan initialization
611

@@ -10,9 +15,6 @@
1015
// lld - see https://bugs.llvm.org/show_bug.cgi?id=45076.
1116
// UNSUPPORTED: android, powerpc
1217

13-
// Deflake this test before reinabling for darwin (rdar://74992832)
14-
// UNSUPPORTED: darwin
15-
1618
#include <assert.h>
1719
#include <stdio.h>
1820
#include <stdlib.h>

0 commit comments

Comments
 (0)