Commit 5cf35278 authored by Andre Pinto's avatar Andre Pinto Committed by Praveen Kumar Ramakrishnan

Disable ASAN for Fiber::init()

Summary:
Fiber::init() method modifies all the bytes in the fiber's stack in
order to produce a high watermark of stack memory usage. This behavior
generates ASAN errors, as it modifies stack red zones. For that reason,
ASAN is disabled for that particular method.

Test Plan:
Unit tests

Reviewed By: alikhtarov@fb.com

Subscribers: folly-diffs@, yfeldblum, chalfant

FB internal diff: D2036280

Tasks: 6861962

Signature: t1:2036280:1430439550:e156e0e06fae3615d9d9204e99acaf3072bbfafd
parent e4e2520a
......@@ -23,6 +23,7 @@
#include <cstring>
#include <stdexcept>
#include <folly/CPortability.h>
#include <folly/Likely.h>
#include <folly/Portability.h>
#include <folly/experimental/fibers/BoostContextCompatibility.h>
......@@ -77,6 +78,8 @@ Fiber::Fiber(FiberManager& fiberManager) :
fcontext_ = makeContext(limit, size, &Fiber::fiberFuncHelper);
}
// It is necessary to disable ASAN because this function changes fiber's stack.
FOLLY_DISABLE_ADDRESS_SANITIZER
void Fiber::init(bool recordStackUsed) {
recordStackUsed_ = recordStackUsed;
if (UNLIKELY(recordStackUsed_ && !stackFilledWithMagic_)) {
......
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