mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: when crash with panic, call user Error/String methods before freezing the world
Fixes #14432. Change-Id: I0a92ef86de95de39217df9a664d8034ef685a906 Reviewed-on: https://go-review.googlesource.com/19792 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Minux Ma <minux@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
bc8458ab02
commit
e960302410
5 changed files with 99 additions and 0 deletions
|
|
@ -336,3 +336,19 @@ func TestPanicTraceback(t *testing.T) {
|
|||
output = output[idx[1]:]
|
||||
}
|
||||
}
|
||||
|
||||
func testPanicDeadlock(t *testing.T, name string, want string) {
|
||||
// test issue 14432
|
||||
output := runTestProg(t, "testprog", name)
|
||||
if !strings.HasPrefix(output, want) {
|
||||
t.Fatalf("output does not start with %q:\n%s", want, output)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPanicDeadlockGosched(t *testing.T) {
|
||||
testPanicDeadlock(t, "GoschedInPanic", "panic: errorThatGosched\n\n")
|
||||
}
|
||||
|
||||
func TestPanicDeadlockSyscall(t *testing.T) {
|
||||
testPanicDeadlock(t, "SyscallInPanic", "1\n2\npanic: 3\n\n")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue