Log more information in assertion failure

This commit is contained in:
Andrea Mazzoleni 2026-06-15 11:16:19 +02:00
parent 4d7277a68e
commit c837a9ace0

View file

@ -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);