Open Mr-Shibari opened 2 months ago
Just adding some information.
It seems it received a cmd that it doesn't recognise, concretely Bad CMDFIFO packet 4b615b4e 0028d010 And happens when header & 7 is 6 or 7 ( and 4b615b4e is 6) https://github.com/sarah-walker-pcem/pcem/blob/f6132a2a124b9265550ff8c99a334fd5e8904ac2/src/video/vid_voodoo_fifo.c#L454
Since this is a fatal, this causes the application to stop, reporting information.
But then, there is an additional problem where it crashes while saving a memory dump to disk (rram), when compiled in debug (or basically without the RELEASE_BUILD compile time define) :
_dumpregs();
Does a loop and crashes doing :
return *(uint8_t *)(readlookup2[(a) >> 12] + (a));
With loop value 161623
So you need to find out why or when it receives that unknown cmd. You might initially try just logging (pclog) instead of doing fatal on those default cases to check if the program can continue without important glitches ( since it would log the message, you could know if it happened)
Fixing the dumpregs would be a separate issue. You could open it referencing this issue in order to track it.
Describe the bug On the Raspberry PI 5 PCEM vNext (dev) crashes randomly when using a Voodoo card and playing 3D games. The crashes are random; sometimes the game runs for half an hour and sometimes it crashes after few seconds.
I am using the 64-bit version of Ubuntu 24.04 LTS (Noble Numbat) and also tried with Raspbian (Bookworm), both crash the same way. Also tried to compile on 32-bit Raspbian but that gave me errors while compiling and I gave up on that.
The type of the Voodoo card does not matter, got crashes on all of them.
The emulated OS is Windows 98, games I tried were Unreal Return to Napali and Half Life original.
To Reproduce Compile PCEM on the PI5 using the Ninja method, then spin up a Windows 98 machine on a PI5 and play a 3D game using the accelerator. My config was Intel Pentium 100/66 on a [Super 7] FIC VA-503+ MB with SB16 and a Voodoo 2. As mentioned, the type of the card does not matter, Voodoo 3 2000/3000 also crash PCEM.
Expected behavior Uninterrupted play of great retro games.
Emulator configuration
Host machine
Additional context Backtrace:
Core was generated by `./pcem'. Program terminated with signal SIGSEGV, Segmentation fault.
0 readmemb (a=161623) at /home/pi/pcem/pcem/src/cpu/808x.c:63
63 return (uint8_t )(readlookup2[(a) >> 12] + (a)); [Current thread is 1 (Thread 0xffff54c0ed40 (LWP 14648))] (gdb) bt full
0 readmemb (a=161623) at /home/pi/pcem/pcem/src/cpu/808x.c:63
1 0x0000aaaabdf5f12c in dumpregs () at /home/pi/pcem/pcem/src/cpu/808x.c:554
2 0x0000ffff885da238 in fatal
3 0x0000aaaabe133ee8 in voodoo_fifo_thread (param=0xaaab008cafd0)
4 0x0000ffff87d3597c in start_thread (arg=0xffff885c9760)
5 0x0000ffff87d9ba4c in thread_start ()