aboutsummaryrefslogtreecommitdiffstats
path: root/executor
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-03-13 11:54:36 +0100
committerDmitry Vyukov <dvyukov@google.com>2020-03-13 13:16:53 +0100
commit008f58d77e63722686d182b505efab677c3dadd5 (patch)
treeb5338262793c676cbe3238871808f090bdad178e /executor
parent9b1f3e665308ee2ddd5b3f35a078219b5c509cdb (diff)
executor: add more debugging output for running=-1
The running=-1 check fires periodically for the past 2 years. I can't reproduce nor understand how this happens. Add more debugging output, maybe it will shed some light. Update #502
Diffstat (limited to 'executor')
-rw-r--r--executor/executor.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/executor/executor.cc b/executor/executor.cc
index 2b4fc505d..bc97b5f41 100644
--- a/executor/executor.cc
+++ b/executor/executor.cc
@@ -894,8 +894,20 @@ void handle_completion(thread_t* th)
}
th->executing = false;
running--;
- if (running < 0)
+ if (running < 0) {
+ // This fires periodically for the past 2 years (see issue #502).
+ fprintf(stderr, "running=%d collide=%d completed=%d flag_threaded=%d flag_collide=%d current=%d\n",
+ running, collide, completed, flag_threaded, flag_collide, th->id);
+ for (int i = 0; i < kMaxThreads; i++) {
+ thread_t* th1 = &threads[i];
+ fprintf(stderr, "th #%2d: created=%d executing=%d colliding=%d"
+ " ready=%d done=%d call_index=%d res=%ld reserrno=%d\n",
+ i, th1->created, th1->executing, th1->colliding,
+ event_isset(&th1->ready), event_isset(&th1->done),
+ th1->call_index, th1->res, th1->reserrno);
+ }
fail("running = %d", running);
+ }
}
void copyout_call_results(thread_t* th)