runtime: print signal information during panic
$ 6.out
panic: runtime error: invalid memory address or nil pointer dereference
[signal 11 code=0x1 addr=0x0 pc=0x1c16]
runtime.panic+0xa7 /Users/rsc/g/go/src/pkg/runtime/proc.c:1089
runtime.panic(0xf6c8, 0x25c010)
runtime.panicstring+0x69 /Users/rsc/g/go/src/pkg/runtime/runtime.c:88
runtime.panicstring(0x24814, 0x0)
runtime.sigpanic+0x144 /Users/rsc/g/go/src/pkg/runtime/darwin/thread.c:465
runtime.sigpanic()
main.f+0x16 /Users/rsc/x.go:5
main.f()
main.main+0x1c /Users/rsc/x.go:9
main.main()
runtime.mainstart+0xf /Users/rsc/g/go/src/pkg/runtime/amd64/asm.s:77
runtime.mainstart()
runtime.goexit /Users/rsc/g/go/src/pkg/runtime/proc.c:149
runtime.goexit()
R=r
CC=golang-dev
https://golang.org/cl/4036042
diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c
index 35ab098..09c7a1d 100644
--- a/src/pkg/runtime/proc.c
+++ b/src/pkg/runtime/proc.c
@@ -1070,6 +1070,8 @@
reflect·call(d->fn, d->args, d->siz);
if(p->recovered) {
g->panic = p->link;
+ if(g->panic == nil) // must be done with signal
+ g->sig = 0;
runtime·free(p);
// put recovering defer back on list
// for scheduler to find.