From 008f58d77e63722686d182b505efab677c3dadd5 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 13 Mar 2020 11:54:36 +0100 Subject: 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 --- executor/executor.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'executor') 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) -- cgit mrf-deployment