From c837a9ace048f963dac866c6b76b74d9ff660a41 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Mon, 15 Jun 2026 11:16:19 +0200 Subject: [PATCH] Log more information in assertion failure --- cmdline/io.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/cmdline/io.c b/cmdline/io.c index a5e92d93..6c7a7c6e 100644 --- a/cmdline/io.c +++ b/cmdline/io.c @@ -751,7 +751,12 @@ static void* io_reader_thread(void* arg) if (task->state == TASK_STATE_EMPTY) continue; - assert(task->state == TASK_STATE_READY); + if (task->state != TASK_STATE_READY) { + /* LCOV_EXCL_START */ + log_fatal(EINTERNAL, "Internal inconsistency: Unexpected state %d in reader for task at position %u in worker %u\n", task->state, task->position, worker->index); + os_abort(); + /* LCOV_EXCL_STOP */ + } /* work on the assigned task */ io_reader_worker(worker, task); @@ -781,7 +786,12 @@ static void* io_writer_thread(void* arg) continue; } - assert(task->state == TASK_STATE_READY); + if (task->state != TASK_STATE_READY) { + /* LCOV_EXCL_START */ + log_fatal(EINTERNAL, "Internal inconsistency: Unexpected state %d in writer for task at position %u in worker %u\n", task->state, task->position, worker->index); + os_abort(); + /* LCOV_EXCL_STOP */ + } /* work on the assigned task */ worker->func(worker, task);