From 613033bad212d5500d4af3a76dbc72583ff5b820 Mon Sep 17 00:00:00 2001 From: Yedidya Feldblum Date: Fri, 5 May 2017 17:14:26 -0700 Subject: [PATCH] Stop trying to setrlimit(RLIMIT_AS) in ASAN builds Summary: [Folly] Stop trying to `setrlimit(RLIMIT_AS)` in ASAN builds. ASAN needs to reserve plenty of memory outside of the limited address space imposed by the call to `setrlimit`. Reviewed By: andriigrynenko Differential Revision: D5014679 fbshipit-source-id: 2ab71b1cca9297d3a276cf72154fac30a2057f86 --- folly/futures/test/RetryingTest.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/folly/futures/test/RetryingTest.cpp b/folly/futures/test/RetryingTest.cpp index 43a15ea2..2ec569fa 100644 --- a/folly/futures/test/RetryingTest.cpp +++ b/folly/futures/test/RetryingTest.cpp @@ -146,7 +146,9 @@ TEST(RetryingTest, large_retries) { rlimit newMemLimit; newMemLimit.rlim_cur = std::min(1UL << 30, oldMemLimit.rlim_max); newMemLimit.rlim_max = oldMemLimit.rlim_max; - PCHECK(setrlimit(RLIMIT_AS, &newMemLimit) == 0); + if (!folly::kIsSanitizeAddress) { // ASAN reserves outside of the rlimit + PCHECK(setrlimit(RLIMIT_AS, &newMemLimit) == 0); + } SCOPE_EXIT { PCHECK(setrlimit(RLIMIT_AS, &oldMemLimit) == 0); }; -- 2.34.1