I'm seeing this message after running the philosophers program for some minutes, using my SoC both in simulation and on the Upduino board:
ASSERTION FAIL [mutex->owner == _kernel.current] @ /usr/local/share/zephyr/kernel/mutex.c:215:
Running the same program on a Hifive1 with a standard zephyr build, I see the same error but only after a few hours. If I push the demo to run faster, by making the change below, I see the error on Hifive1 after a few minutes too.
--- a/samples/philosophers/src/main.c
+++ b/samples/philosophers/src/main.c
@@ -183,3 +183,3 @@ void philosopher(void *id, void *unused1, void *unused2)
- delay = get_random_delay(my_id, 25);
+ delay = get_random_delay(my_id, 1);
print_phil_state(my_id, " EATING [ %s%d ms ] ", delay);
@@ -191,3 +191,3 @@ void philosopher(void *id, void *unused1, void *unused2)
- delay = get_random_delay(my_id, 25);
+ delay = get_random_delay(my_id, 1);
print_phil_state(my_id, " THINKING [ %s%d ms ] ", delay);
I think the RTC on my SoC is running faster than real time. But it seems to me that the correctness of synchronisation primitives should not depend on having sufficient delay between calls.
Would anyone like to try the speed-up experiment on their SoC, or run the unmodified program overnight, and see if the same assertion falure occurs?