Crash: SDLAudioP2 Segmentation Fault
J1mbo opened this issue · 1 comments
J1mbo commented
With the current code running on RPi4 with SDL2, I run in to the following after a variable period of time:
Thread 5 "SDLAudioP2" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xaf2ff360 (LWP 7777)]
0xb6fb9c5c in memcpy () from /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so
(gdb) Exception ignored in: <gdb.GdbOutputFile object at 0xb5e47b70>
Traceback (most recent call last):
File "/usr/share/gdb/python/gdb/__init__.py", line 43, in flush
def flush(self):
KeyboardInterrupt
Any assistance troubleshooting this would be greatly appreciated.
J1mbo commented
So the solution is to add a spinlock to audio::tick and fillaudio in sdl2/audio.cpp, since if these execute concurrently in different threads then dsp_read_pos is corrupted by fillaudio on exit.