runtime: allow crash from gsignal stack

The uses of onM in dopanic/startpanic are okay even from the signal stack.

Fixes #8666.

LGTM=khr
R=khr
CC=golang-codereviews
https://golang.org/cl/134710043
This commit is contained in:
Russ Cox 2014-09-11 12:08:30 -04:00
parent f956740163
commit 1d550b87db
9 changed files with 104 additions and 2 deletions

View file

@ -371,7 +371,7 @@ func gorecover(argp uintptr) interface{} {
//go:nosplit
func startpanic() {
onM(startpanic_m)
onM_signalok(startpanic_m)
}
//go:nosplit
@ -381,7 +381,7 @@ func dopanic(unused int) {
mp.ptrarg[0] = unsafe.Pointer(gp)
mp.scalararg[0] = getcallerpc((unsafe.Pointer)(&unused))
mp.scalararg[1] = getcallersp((unsafe.Pointer)(&unused))
onM(dopanic_m) // should never return
onM_signalok(dopanic_m) // should never return
*(*int)(nil) = 0
}