Commit 61ef6a39 authored by Michael Anthony Knyszek's avatar Michael Anthony Knyszek Committed by Michael Knyszek

runtime: remove MAP_FIXED in sysReserve for raceenabled on darwin

This change removes a hack which was added to deal with Darwin 10.10's
weird ignorance of mapping hints which would cause race mode to fail
since it requires the heap to live within a certain address range.

We no longer support 10.10, and this is potentially causing problems
related to the page allocator, so drop this code.

Updates #26475.
Updates #35112.

Change-Id: I0e1c6f8c924afe715a2aceb659a969d7c7b6f749
Reviewed-on: https://go-review.googlesource.com/c/go/+/205757
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarKeith Randall <khr@golang.org>
parent 6ce4384f
......@@ -49,19 +49,7 @@ func sysFault(v unsafe.Pointer, n uintptr) {
}
func sysReserve(v unsafe.Pointer, n uintptr) unsafe.Pointer {
flags := int32(_MAP_ANON | _MAP_PRIVATE)
if raceenabled {
// Currently the race detector expects memory to live within a certain
// range, and on Darwin 10.10 mmap is prone to ignoring hints, moreso
// than later versions and other BSDs (#26475). So, even though it's
// potentially dangerous to MAP_FIXED, we do it in the race detection
// case because it'll help maintain the race detector's invariants.
//
// TODO(mknyszek): Drop this once support for Darwin 10.10 is dropped,
// and reconsider this when #24133 is addressed.
flags |= _MAP_FIXED
}
p, err := mmap(v, n, _PROT_NONE, flags, -1, 0)
p, err := mmap(v, n, _PROT_NONE, _MAP_ANON|_MAP_PRIVATE, -1, 0)
if err != 0 {
return nil
}
......
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