Hard fault while checking for terminated tasks in idle loop

Thanks for the great debugging effort and information. I’m not at my computer just now so can’t look at the source code to get a clear understanding of the report. Are we saying the kernel code deletes a task twice, or that the application code (test code I think in this case) was deleting the same task twice?

To answer your question: there is a separate variable that counts the number of tasks waiting termination when the list already contains a count to prevent the idle task from continuously entering and exiting a critical section in the idle task loop. The idle task can check the variable without a critical section but can’t check the list without one.