Bug Report: Philosophers Dinner @ VisionFive2
The philosophers dinner isn't working in EPOS for INE5424 @ VisionFive 2. The code generates an exception (id=5) that means data protection violation (read). With debugs, we can see that the exception is in epc=0x000000004000129a, following the objdump, we see that this address contains the instruction {ld a0,0(s1)}. The protection violation occurs in register a0. This is inside the philosopher function, and the exception occurs before the chopstick Semaphore call p() (line 93). I commented the Delay thinking(1000000); (line 86), but the exception still occurs. In log file, we see that wakeup_all() is the last function called before the exception occurs. This function is called 11 times in philosophers dinner, but the exception occursrs just in the 5 first (1 time for each philosopher thread before Thread exit()) and the debug added (line 292 in thread.cc) inside the if(!q->empty()) conditional wasn't printed. To see the code, follow to https://gitlab.lisha.ufsc.br/epos/ine5424/-/tree/nic-plic-integration.
OBS: The philosophers dinner execution log at VisionFive 2 and objdump are attached at this post.