This is an archive of the discontinued LLVM Phabricator instance.

tsan: mmap shadow stack
ClosedPublic

Authored by dvyukov on Nov 12 2021, 10:40 AM.

Details

Summary

We used to mmap C++ shadow stack as part of the trace region
before ed7f3f5bc9 ("tsan: move shadow stack into ThreadState"),
which moved the shadow stack into TLS. This started causing
timeouts and OOMs on some of our internal tests that repeatedly
create and destroy thousands of threads.
Allocate C++ shadow stack with mmap and small pages again.
This prevents the observed timeouts and OOMs.
But we now need to be more careful with interceptors that
run after thread finalization because FuncEntry/Exit and
TraceAddEvent all need the shadow stack.

Diff Detail

Event Timeline

dvyukov requested review of this revision.Nov 12 2021, 10:40 AM
dvyukov created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptNov 12 2021, 10:40 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
vitalybuka accepted this revision.Nov 12 2021, 11:11 AM
This revision is now accepted and ready to land.Nov 12 2021, 11:11 AM
This revision was automatically updated to reflect the committed changes.