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

@ -175,6 +175,14 @@ func TestMainGoroutineId(t *testing.T) {
}
}
func TestBreakpoint(t *testing.T) {
output := executeTest(t, breakpointSource, nil)
want := "runtime.Breakpoint()"
if !strings.Contains(output, want) {
t.Fatalf("output:\n%s\n\nwant output containing: %s", output, want)
}
}
const crashSource = `
package main
@ -380,3 +388,11 @@ func main() {
panic("test")
}
`
const breakpointSource = `
package main
import "runtime"
func main() {
runtime.Breakpoint()
}
`