Disable stack recording with ASAN
authorPavlo Kushnir <pavlo@fb.com>
Wed, 13 May 2015 23:23:26 +0000 (16:23 -0700)
committerViswanath Sivakumar <viswanath@fb.com>
Wed, 20 May 2015 17:57:02 +0000 (10:57 -0700)
Summary: ASAN crashes on std::fill and doesn't respect no_sanitize_address attribute for some reason.

Test Plan: run fibers-test with ASAN

Reviewed By: stepan@fb.com

Subscribers: trunkagent, folly-diffs@, yfeldblum, chalfant

FB internal diff: D2069437

Signature: t1:2069437:1431547972:7d2c7a6547f8d76b309a76ef69fd19a1de4ce261

folly/experimental/fibers/Fiber.cpp
folly/experimental/fibers/Fiber.h

index 19d4b19835f35c73b3716a284be853536d23c5b9..40e9464158958c4f3a62e21c3320cb7e9674550e 100644 (file)
@@ -78,6 +78,9 @@ Fiber::Fiber(FiberManager& fiberManager) :
 }
 
 void Fiber::init(bool recordStackUsed) {
+// It is necessary to disable the logic for ASAN because we change
+// the fiber's stack.
+#ifndef FOLLY_SANITIZE_ADDRESS
   recordStackUsed_ = recordStackUsed;
   if (UNLIKELY(recordStackUsed_ && !stackFilledWithMagic_)) {
     auto limit = fcontext_.stackLimit();
@@ -94,6 +97,7 @@ void Fiber::init(bool recordStackUsed) {
 
     stackFilledWithMagic_ = true;
   }
+#endif
 }
 
 Fiber::~Fiber() {
index b0b63b6f4ab97981e8434f47e1b12b1674b27ccb..5dbb48785bf665b3ec8b7379b875fd0f9cc8cac7 100644 (file)
@@ -71,8 +71,7 @@ class Fiber {
 
   explicit Fiber(FiberManager& fiberManager);
 
-  // It is necessary to disable ASAN because init() changes the fiber's stack.
-  void init(bool recordStackUsed) FOLLY_DISABLE_ADDRESS_SANITIZER;
+  void init(bool recordStackUsed);
 
   template <typename F>
   void setFunction(F&& func);