[PATCH] D72470: [scudo][standalone] Fork support

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 13 18:14:08 PST 2020


eugenis added inline comments.


================
Comment at: compiler-rt/lib/scudo/standalone/combined.h:31
 // https://reviews.llvm.org/D69265#inline-624315).
 static gwp_asan::GuardedPoolAllocator GuardedAlloc;
 #endif // GWP_ASAN_HOOKS
----------------
eugenis wrote:
> A static global in a header is not a great idea - every translation unit that includes this will get its own instance of gwp-asan, and only one of those will be initialized.
> 
> This needs to be moved to the wrappers, probably.
I'm not sure I completely understand this comment about constexpr initialization.
But if the problem is that gwp-asan is not zero initialized, then it seems really easy to fix. There are only two non-zero fields:
* AdjustedSampleRate can be stored in a pre-decremented form. It is not used on the hot path.
* GuardedPagePool - I don't see why it can not start as 0
Then we make GuardedAlloc a member of Allocator, and we are done. What am I missing?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72470/new/

https://reviews.llvm.org/D72470





More information about the llvm-commits mailing list