Delaying the runtime.throw until here will print more information.
In particular it will print the signal and code values, which means
it will show the fault address.
The canpanic checks were added recently, in CL
75320043.
They were just not added in exactly the right place.
LGTM=iant
R=dvyukov, iant
CC=golang-codereviews
https://golang.org/cl/
83980043
void
runtime·sigpanic(void)
{
+ if(!runtime·canpanic(g))
+ runtime·throw("unexpected signal during runtime execution");
+
switch(g->sig) {
case SIGBUS:
if(g->sigcode0 == BUS_ADRERR && g->sigcode1 < 0x1000 || g->paniconfault) {
void
runtime·sigpanic(void)
{
+ if(!runtime·canpanic(g))
+ runtime·throw("unexpected signal during runtime execution");
+
switch(g->sig) {
case SIGBUS:
if(g->sigcode0 == BUS_ADRERR && g->sigcode1 < 0x1000 || g->paniconfault) {
void
runtime·sigpanic(void)
{
+ if(!runtime·canpanic(g))
+ runtime·throw("unexpected signal during runtime execution");
+
switch(g->sig) {
case SIGBUS:
if(g->sigcode0 == BUS_ADRERR && g->sigcode1 < 0x1000 || g->paniconfault) {
void
runtime·sigpanic(void)
{
+ if(!runtime·canpanic(g))
+ runtime·throw("unexpected signal during runtime execution");
+
switch(g->sig) {
case SIGBUS:
if(g->sigcode0 == BUS_ADRERR && g->sigcode1 < 0x1000 || g->paniconfault) {
void
runtime·sigpanic(void)
{
+ if(!runtime·canpanic(g))
+ runtime·throw("unexpected signal during runtime execution");
+
// Native Client only invokes the exception handler for memory faults.
g->sig = SIGSEGV;
if(g->sigpc == 0)
void
runtime·sigpanic(void)
{
+ if(!runtime·canpanic(g))
+ runtime·throw("unexpected signal during runtime execution");
+
switch(g->sig) {
case SIGBUS:
if(g->sigcode0 == BUS_ADRERR && g->sigcode1 < 0x1000 || g->paniconfault) {
void
runtime·sigpanic(void)
{
+ if(!runtime·canpanic(g))
+ runtime·throw("unexpected signal during runtime execution");
+
switch(g->sig) {
case SIGBUS:
if(g->sigcode0 == BUS_ADRERR && g->sigcode1 < 0x1000 || g->paniconfault) {
{
byte *p;
+ if(!runtime·canpanic(g))
+ runtime·throw("unexpected signal during runtime execution");
+
switch(g->sig) {
case SIGRFAULT:
case SIGWFAULT:
runtime·exits(note+9); // Strip "go: exit " prefix.
if(flags & SigPanic) {
- if(!runtime·canpanic(gp))
- goto Throw;
-
// Copy the error string from sigtramp's stack into m->notesig so
// we can reliably access it from the panic routines.
runtime·memmove(m->notesig, note, len+1);
runtime·exits(note+9); // Strip "go: exit " prefix.
if(flags & SigPanic) {
- if(!runtime·canpanic(gp))
- goto Throw;
-
// Copy the error string from sigtramp's stack into m->notesig so
// we can reliably access it from the panic routines.
runtime·memmove(m->notesig, note, len+1);
void
runtime·sigpanic(void)
{
+ if(!runtime·canpanic(g))
+ runtime·throw("unexpected signal during runtime execution");
+
switch(g->sig) {
case SIGBUS:
if(g->sigcode0 == BUS_ADRERR && g->sigcode1 < 0x1000 || g->paniconfault) {
void
runtime·sigpanic(void)
{
+ if(!runtime·canpanic(g))
+ runtime·throw("unexpected signal during runtime execution");
+
switch(g->sig) {
case EXCEPTION_ACCESS_VIOLATION:
if(g->sigcode1 < 0x1000 || g->paniconfault) {
t = &runtime·sigtab[sig];
if(SIG_CODE0(info, ctxt) != SI_USER && (t->flags & SigPanic)) {
- if(!runtime·canpanic(gp))
- goto Throw;
-
// Make it look like a call to the signal func.
// Have to pass arguments out of band since
// augmenting the stack frame would break
if(!(t->flags & SigThrow))
return;
-Throw:
m->throwing = 1;
m->caughtsig = gp;
runtime·startpanic();
t = &runtime·sigtab[sig];
if(SIG_CODE0(info, ctxt) != SI_USER && (t->flags & SigPanic)) {
- if(!runtime·canpanic(gp))
- goto Throw;
-
// Make it look like a call to the signal func.
// Have to pass arguments out of band since
// augmenting the stack frame would break
if(!(t->flags & SigThrow))
return;
-Throw:
m->throwing = 1;
m->caughtsig = gp;
runtime·startpanic();
t = &runtime·sigtab[sig];
if(SIG_CODE0(info, ctxt) != SI_USER && (t->flags & SigPanic)) {
- if(!runtime·canpanic(gp))
- goto Throw;
-
// Make it look like a call to the signal func.
// Have to pass arguments out of band since
// augmenting the stack frame would break
if(!(t->flags & SigThrow))
return;
-Throw:
m->throwing = 1;
m->caughtsig = gp;
if(runtime·panicking) // traceback already printed