diff options
author | Austin Clements <austin@google.com> | 2015-03-24 11:51:24 -0400 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2015-03-26 15:26:29 +0000 |
commit | 9b0ea6aa271c811abc180eb46a4d114890870ec5 (patch) | |
tree | ce8ecd018c7422fd48ae571c50d62bdb0fc5bb31 /src/runtime/os3_plan9.go | |
parent | 222f371118754382145735186fe3aedfca16d5f4 (diff) | |
download | go-9b0ea6aa271c811abc180eb46a4d114890870ec5.tar.gz go-9b0ea6aa271c811abc180eb46a4d114890870ec5.zip |
runtime: remove write barrier on G in sighandler
sighandler may run during a stop-the-world without a P, so it's not
allowed to have write barriers. Fix the G write to disable the write
barrier (this is safe because the G is reachable from allgs) and mark
the function nowritebarrier.
Change-Id: I907f05d3829e24eeb15fa4d020598af36710e87e
Reviewed-on: https://go-review.googlesource.com/8020
Reviewed-by: Rick Hudson <rlh@golang.org>
Diffstat (limited to 'src/runtime/os3_plan9.go')
-rw-r--r-- | src/runtime/os3_plan9.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/runtime/os3_plan9.go b/src/runtime/os3_plan9.go index 27519debd3..fa49ad681f 100644 --- a/src/runtime/os3_plan9.go +++ b/src/runtime/os3_plan9.go @@ -6,6 +6,8 @@ package runtime import "unsafe" +// May run during STW, so write barriers are not allowed. +//go:nowritebarrier func sighandler(_ureg *ureg, note *byte, gp *g) int { _g_ := getg() var t sigTabT @@ -79,7 +81,7 @@ func sighandler(_ureg *ureg, note *byte, gp *g) int { } Throw: _g_.m.throwing = 1 - _g_.m.caughtsig = gp + setGNoWriteBarrier(&_g_.m.caughtsig, gp) startpanic() print(notestr, "\n") print("PC=", hex(c.pc()), "\n") |