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/signal_arm.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/signal_arm.go')
-rw-r--r-- | src/runtime/signal_arm.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/runtime/signal_arm.go b/src/runtime/signal_arm.go index c07b45ef18..7d417fa2b3 100644 --- a/src/runtime/signal_arm.go +++ b/src/runtime/signal_arm.go @@ -32,6 +32,8 @@ func dumpregs(c *sigctxt) { print("fault ", hex(c.fault()), "\n") } +// May run during STW, so write barriers are not allowed. +//go:nowritebarrier func sighandler(sig uint32, info *siginfo, ctxt unsafe.Pointer, gp *g) { _g_ := getg() c := &sigctxt{info, ctxt} @@ -93,7 +95,7 @@ func sighandler(sig uint32, info *siginfo, ctxt unsafe.Pointer, gp *g) { } _g_.m.throwing = 1 - _g_.m.caughtsig = gp + setGNoWriteBarrier(&_g_.m.caughtsig, gp) startpanic() if sig < uint32(len(sigtable)) { |