Commit 62dbf939 authored by Pavlo Kushnir's avatar Pavlo Kushnir Committed by Viswanath Sivakumar

Disable stack recording with ASAN

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
parent df7a2d07
...@@ -78,6 +78,9 @@ Fiber::Fiber(FiberManager& fiberManager) : ...@@ -78,6 +78,9 @@ Fiber::Fiber(FiberManager& fiberManager) :
} }
void Fiber::init(bool recordStackUsed) { 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; recordStackUsed_ = recordStackUsed;
if (UNLIKELY(recordStackUsed_ && !stackFilledWithMagic_)) { if (UNLIKELY(recordStackUsed_ && !stackFilledWithMagic_)) {
auto limit = fcontext_.stackLimit(); auto limit = fcontext_.stackLimit();
...@@ -94,6 +97,7 @@ void Fiber::init(bool recordStackUsed) { ...@@ -94,6 +97,7 @@ void Fiber::init(bool recordStackUsed) {
stackFilledWithMagic_ = true; stackFilledWithMagic_ = true;
} }
#endif
} }
Fiber::~Fiber() { Fiber::~Fiber() {
......
...@@ -71,8 +71,7 @@ class Fiber { ...@@ -71,8 +71,7 @@ class Fiber {
explicit Fiber(FiberManager& fiberManager); explicit Fiber(FiberManager& fiberManager);
// It is necessary to disable ASAN because init() changes the fiber's stack. void init(bool recordStackUsed);
void init(bool recordStackUsed) FOLLY_DISABLE_ADDRESS_SANITIZER;
template <typename F> template <typename F>
void setFunction(F&& func); void setFunction(F&& func);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment