diff options
author | Ian Lance Taylor <iant@golang.org> | 2016-10-04 21:15:42 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2016-10-05 13:13:27 +0000 |
commit | 7faf70239670c3c1f8b4b530aba8847a03860f2a (patch) | |
tree | 2c7ca7c2412bc34f0ef77a317d2a7cc391707b99 /src/runtime/crash_test.go | |
parent | efaa36017e34b87a5731793594b42d483209d808 (diff) | |
download | go-7faf70239670c3c1f8b4b530aba8847a03860f2a.tar.gz go-7faf70239670c3c1f8b4b530aba8847a03860f2a.zip |
runtime: avoid endless loop if printing the panic value panics
Change-Id: I56de359a5ccdc0a10925cd372fa86534353c6ca0
Reviewed-on: https://go-review.googlesource.com/30358
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/runtime/crash_test.go')
-rw-r--r-- | src/runtime/crash_test.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/runtime/crash_test.go b/src/runtime/crash_test.go index 9d87957c2a..e352540ac2 100644 --- a/src/runtime/crash_test.go +++ b/src/runtime/crash_test.go @@ -444,6 +444,13 @@ func TestPanicDeadlockSyscall(t *testing.T) { testPanicDeadlock(t, "SyscallInPanic", "1\n2\npanic: 3\n\n") } +func TestPanicLoop(t *testing.T) { + output := runTestProg(t, "testprog", "PanicLoop") + if want := "panic while printing panic value"; !strings.Contains(output, want) { + t.Errorf("output does not contain %q:\n%s", want, output) + } +} + func TestMemPprof(t *testing.T) { testenv.MustHaveGoRun(t) |