diff options
author | Derek Bruening <bruening@google.com> | 2016-06-13 15:42:39 +0000 |
---|---|---|
committer | Derek Bruening <bruening@google.com> | 2016-06-13 15:42:39 +0000 |
commit | d5a0419aecd169af9f26b6f7254ff2ef555e497f (patch) | |
tree | c969efaae3f2a01befbd5c81c9c5a21988cd680e /lib/esan/working_set.cpp | |
parent | 51be894d7708c17d006a298b247facc796305db0 (diff) |
[sanitizer][esan] Add internal_sigaction_syscall
Summary:
Adds a version of sigaction that uses a raw system call, to avoid circular
dependencies and support calling sigaction prior to setting up
interceptors. The new sigaction relies on an assembly sigreturn routine
for its restorer, which is Linux x86_64-only for now.
Uses the new sigaction to initialize the working set tool's shadow fault
handler prior to libc interceptor being set up. This is required to
support instrumentation invoked during interceptor setup, which happens
with an instrumented tcmalloc or other allocator compiled with esan.
Adds a test that emulates an instrumented allocator.
Reviewers: aizatsky
Subscribers: vitalybuka, tberghammer, zhaoqin, danalbert, kcc, srhines, eugenis, llvm-commits, kubabrecka
Differential Revision: http://reviews.llvm.org/D21083
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@272553 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/esan/working_set.cpp')
-rw-r--r-- | lib/esan/working_set.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/esan/working_set.cpp b/lib/esan/working_set.cpp index 9e7520f49..622fd29e8 100644 --- a/lib/esan/working_set.cpp +++ b/lib/esan/working_set.cpp @@ -182,10 +182,13 @@ static void takeSample(void *Arg) { } } -void initializeWorkingSet() { +// Initialization that must be done before any instrumented code is executed. +void initializeShadowWorkingSet() { CHECK(getFlags()->cache_line_size == CacheLineSize); registerMemoryFaultHandler(); +} +void initializeWorkingSet() { if (getFlags()->record_snapshots) { for (u32 i = 0; i < NumFreq; ++i) SizePerFreq[i].initialize(CircularBufferSizes[i]); |