diff options
author | Keith Randall <khr@golang.org> | 2018-05-03 10:30:31 -0700 |
---|---|---|
committer | Keith Randall <khr@golang.org> | 2018-05-19 17:38:01 +0000 |
commit | e86c26789dbc11c50c4c49bee55ea015847a97b7 (patch) | |
tree | a6c1cdd109f457edab95df6f29229595cb97a505 /src/runtime/mmap.go | |
parent | e9137299bf74e1bcac358b569f86aef73c7c2ea6 (diff) | |
download | go-e86c26789dbc11c50c4c49bee55ea015847a97b7.tar.gz go-e86c26789dbc11c50c4c49bee55ea015847a97b7.zip |
runtime: fix darwin 386/amd64 stack switches
A few libc_ calls were missing stack switches.
Unfortunately, adding the stack switches revealed a deeper problem.
systemstack() is fundamentally flawed because when you do
systemstack(func() { ... })
There's no way to mark the anonymous function as nosplit. At first I
thought it didn't matter, as that function runs on the g0 stack. But
nosplit is still required, because some syscalls are done when stack
bounds are not set up correctly (e.g. in a signal handler, which runs
on the g0 stack, but g is still pointing at the g stack). Instead use
asmcgocall and funcPC, so we can be nosplit all the way down.
Mid-stack inlining now pushes darwin over the nosplit limit also.
Leaving that as a TODO.
Update #23168
This might fix the cause of occasional darwin hangs.
Update #25181
Update #17490
Change-Id: If9c3ef052822c7679f5a1dd192443f714483327e
Reviewed-on: https://go-review.googlesource.com/111258
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/mmap.go')
-rw-r--r-- | src/runtime/mmap.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/runtime/mmap.go b/src/runtime/mmap.go index 649b4ab1ec..80b89d2ef1 100644 --- a/src/runtime/mmap.go +++ b/src/runtime/mmap.go @@ -9,6 +9,8 @@ // +build !linux !amd64 // +build !linux !arm64 // +build !js +// +build !darwin !amd64 +// +build !darwin !386 package runtime |