Commit b7f15425 authored by Bill Budge's avatar Bill Budge Committed by Commit Bot

Revert "[Memory] Speculative fix for sanitizer flakiness."

This reverts commit dc5493f4.

Reason for revert: Broke TSAN
https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20TSAN/builds/18819

Original change's description:
> [Memory] Speculative fix for sanitizer flakiness.
> 
> - When allocating virtual memory, make sure addresses don't interfere
>   with hard-coded sanitizer regions.
> 
> Bug: v8:7146
> Change-Id: I5bcb664b32bf53c8581772fe329190da6033701f
> Reviewed-on: https://chromium-review.googlesource.com/833171
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Reviewed-by: Hannes Payer <hpayer@chromium.org>
> Commit-Queue: Bill Budge <bbudge@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#50208}

TBR=bbudge@chromium.org,ulan@chromium.org,hpayer@chromium.org,mlippautz@chromium.org

Change-Id: I8b0fcda1510854fe7fac3aba8c1a462e3350c639
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7146
Reviewed-on: https://chromium-review.googlesource.com/834070Reviewed-by: 's avatarBill Budge <bbudge@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50210}
parent 56b2b3be
......@@ -206,18 +206,14 @@ size_t OS::CommitPageSize() {
// static
void* OS::GetRandomMmapAddr() {
#if defined(ADDRESS_SANITIZER) || defined(MEMORY_SANITIZER) || \
defined(THREAD_SANITIZER)
// Dynamic tools do not support custom mmap addresses.
return nullptr;
#else
uintptr_t raw_addr;
platform_random_number_generator.Pointer()->NextBytes(&raw_addr,
sizeof(raw_addr));
#if defined(V8_USE_ADDRESS_SANITIZER) || defined(MEMORY_SANITIZER) || \
defined(THREAD_SANITIZER) || defined(LEAK_SANITIZER)
// If random hint addresses interfere with address ranges hard coded in
// sanitizers, bad things happen. This address range is copied from TSAN
// source but works with all tools.
// See crbug.com/539863.
raw_addr &= 0x007fffff0000ULL;
raw_addr += 0x7e8000000000ULL;
#else
#if V8_TARGET_ARCH_X64
// Currently available CPUs have 48 bits of virtual addressing. Truncate
// the hint address to 46 bits to give the kernel a fighting chance of
......@@ -270,9 +266,9 @@ void* OS::GetRandomMmapAddr() {
// 10.6 and 10.7.
raw_addr += 0x20000000;
#endif
#endif
#endif
return reinterpret_cast<void*>(raw_addr);
#endif
}
// TODO(bbudge) Move Cygwin and Fuschia stuff into platform-specific files.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment