Increase fiber stack size if UBSAN is enabled
authorAndrii Grynenko <andrii@fb.com>
Tue, 6 Dec 2016 23:11:57 +0000 (15:11 -0800)
committerFacebook Github Bot <facebook-github-bot-bot@fb.com>
Tue, 6 Dec 2016 23:23:27 +0000 (15:23 -0800)
Summary: UBSAN instrumentation results in more stack being used. Applying the same logic we already have for ASAN there.

Reviewed By: igorsugak

Differential Revision: D4287455

fbshipit-source-id: 1a224cb5a3654c23b15fa298bf80476234a1418c

folly/fibers/FiberManagerInternal-inl.h

index fa526288e5ea3b72845db73c5f76e0f5988d2394..68c9a2ac4464804488f1021443f661a213fc9f90 100644 (file)
@@ -37,8 +37,8 @@ namespace fibers {
 namespace {
 
 inline FiberManager::Options preprocessOptions(FiberManager::Options opts) {
-#ifdef FOLLY_SANITIZE_ADDRESS
-  /* ASAN needs a lot of extra stack space.
+#if defined(FOLLY_SANITIZE_ADDRESS) || defined(UNDEFINED_SANITIZER)
+  /* ASAN/UBSAN needs a lot of extra stack space.
      16x is a conservative estimate, 8x also worked with tests
      where it mattered.  Note that overallocating here does not necessarily
      increase RSS, since unused memory is pretty much free. */