-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Hard crash after sound finishes playing with python 3.12 #72
Comments
for additional context, I found another user on reddit who seemed to be experiencing a similar problem (although their repro was via pydub) https://www.reddit.com/r/pythonhelp/comments/17vw5zy/python_is_hard_crashing_with_a_simple_mp3_play/ though if I understand correctly, pydub uses simpleaudio for playback |
The cause of the segmentation fault seems to be calling PyMem_Free(*) without acquiring the GIL.
There are two solutions (both of which solved the problem for me). :
The former solution is probably better. With the above changes and rebuild I am able to use simpleaudio in Py3.12.
I am not familiar enough with package development (especially CI and backward compatibility) to know how to make the necessary changes for users in all environments... |
@cexen Thanks a lot! I got the same issue and this fixed it! |
Yeah this bug renders simpleaudio unusable. |
Also experiencing this with Python 3.12.8, although for me I get the warning "There appear to be 1 leaked semaphore objects to clean up at shutdown". Installing @cexen's version fixed it for me, otherwise simple audio appears to be dead in the water with Python 3.12+ |
overview
simpleaudio 1.0.4 seems to crash for me when using python 3.12
the same crash does not reproduce in python 3.11
the crash does not appear to be any form of python failure that I can either catch as an exception or intercept with a python debugger
example
Here's the sample code I'm testing with
when run from a python 3.12 environment with simpleaudio 1.0.4, this is the output
here's the same run but from a python 3.11 environment
Repro Environment information
The text was updated successfully, but these errors were encountered: