aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/proc.c
diff options
context:
space:
mode:
authorDmitriy Vyukov <dvyukov@google.com>2014-02-14 13:24:48 +0400
committerDmitriy Vyukov <dvyukov@google.com>2014-02-14 13:24:48 +0400
commit47534ddc68d6c605db2d5ec5726927a244159ad9 (patch)
treec0fd56121af13d0803a3f2921bcdc15dbaeeb4ff /src/pkg/runtime/proc.c
parente71d147750dc4dce115c5614fc96877aa08da596 (diff)
downloadgo-47534ddc68d6c605db2d5ec5726927a244159ad9.tar.xz
runtime: remove misleading message during crash
The following checkdead message is false positive: $ go test -race -c runtime $ ./runtime.test -test.cpu=2 -test.run=TestSmhasherWindowed -test.v === RUN TestSmhasherWindowed-2 checkdead: find g 18 in status 1 SIGABRT: abort PC=0x42bff1 LGTM=rsc R=golang-codereviews, gobot, rsc CC=golang-codereviews, iant, khr https://golang.org/cl/59490046
Diffstat (limited to 'src/pkg/runtime/proc.c')
-rw-r--r--src/pkg/runtime/proc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c
index 47cb304083..b782d0fe1a 100644
--- a/src/pkg/runtime/proc.c
+++ b/src/pkg/runtime/proc.c
@@ -2441,8 +2441,14 @@ checkdead(void)
run = runtime·sched.mcount - runtime·sched.nmidle - runtime·sched.nmidlelocked - 1;
if(run > 0)
return;
+ // If we are dying because of a signal caught on an already idle thread,
+ // freezetheworld will cause all running threads to block.
+ // And runtime will essentially enter into deadlock state,
+ // except that there is a thread that will call runtime·exit soon.
+ if(runtime·panicking > 0)
+ return;
if(run < 0) {
- runtime·printf("checkdead: nmidle=%d nmidlelocked=%d mcount=%d\n",
+ runtime·printf("runtime: checkdead: nmidle=%d nmidlelocked=%d mcount=%d\n",
runtime·sched.nmidle, runtime·sched.nmidlelocked, runtime·sched.mcount);
runtime·throw("checkdead: inconsistent counts");
}
@@ -2457,7 +2463,7 @@ checkdead(void)
grunning++;
else if(s == Grunnable || s == Grunning || s == Gsyscall) {
runtime·unlock(&allglock);
- runtime·printf("checkdead: find g %D in status %d\n", gp->goid, s);
+ runtime·printf("runtime: checkdead: find g %D in status %d\n", gp->goid, s);
runtime·throw("checkdead: runnable g");
}
}