From 80b6f9b0cb46666a14d471248cc3747930a28dd4 Mon Sep 17 00:00:00 2001 From: Dave-in-lafayette <64047859+Dave-in-lafayette@users.noreply.github.com> Date: Mon, 20 Apr 2020 16:38:06 -0700 Subject: [PATCH] fix for crash during panic before all threads are up If there's a panic before all threads have been started (say, if file descriptor 0 is closed at exec), the panic response will crash here again. --- src/bio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bio.c b/src/bio.c index 0662c8c4c..85f681185 100644 --- a/src/bio.c +++ b/src/bio.c @@ -266,7 +266,7 @@ void bioKillThreads(void) { int err, j; for (j = 0; j < BIO_NUM_OPS; j++) { - if (pthread_cancel(bio_threads[j]) == 0) { + if (bio_threads[j] && pthread_cancel(bio_threads[j]) == 0) { if ((err = pthread_join(bio_threads[j],NULL)) != 0) { serverLog(LL_WARNING, "Bio thread for job type #%d can be joined: %s",