tsan: protect trace memory range on startup

so that user does not map something there ahead of us

llvm-svn: 223456
This commit is contained in:
Dmitry Vyukov 2014-12-05 10:06:06 +00:00
parent 153c3948f1
commit bf253a3d3f

View File

@ -324,6 +324,9 @@ static void CheckAndProtect() {
ProtectRange(kLoAppMemEnd, kShadowBeg);
ProtectRange(kShadowEnd, kMetaShadowBeg);
ProtectRange(kMetaShadowEnd, kTraceMemBeg);
// Memory for traces is mapped lazily in MapThreadTrace.
// Protect the whole range for now, so that user does not map something here.
ProtectRange(kTraceMemBeg, kTraceMemEnd);
ProtectRange(kTraceMemEnd, kHeapMemBeg);
ProtectRange(kHeapMemEnd + PrimaryAllocator::AdditionalSize(), kHiAppMemBeg);
}