-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
segfault when releasing a thread #100
Comments
More debugging --- loaded |
I'm not set up to test/verify any of this so if you get to the bottom of it it'd be fantastic. It's (at first glance) code that stood the test of time, so I wonder if there is something about Python 3.9.1 - perhaps it's doing something differently? |
Also been getting this for several months, basically since python went to 3.9 it has been happening. Using version 3.8 seems to make it go away, not really best practices to do that though. |
Commenting out the call to |
We use httpd docker images which recently switched from debian buster to bullseye. I now also see the Segmentation fault errors with my PythonAuthenHandler. |
This opens a python file I've been running since python 3.9 at least 2 years ago. The file is called several times per second 24/7. I'm now running python 3.11 and is segfaults horribly. Commenting out PyThreadState_Clear(tstate); fixed it. Just a confirmation that wom-bat patch works. |
So should that line be wrapped in something like so #if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 10
PyThreadState_Clear(tstate);
#endif |
Totally makes sense. Thanks! |
Could you confirm that this works for you? I'm currently not set up to test it. If it works, then a pull-request would be much appreciated, if not let me know and I'll add it in myself. Thank you! |
It does. Just recompiled the source from debian 12 with your suggestion. Restarted apache and no segfault. Can't make a pull request though, permission denied: |
That's okay, I took care of it, thanks for your help! |
This was fixed as >= 3.10, but reported against 3.9 too. Is that related, or is #122 a different bug |
@stefanor I don't have the set up to test it - if you can confirm that the fix should include 3.9 too that'd be much appreciated. |
I'm afraid it's present in 3.9 too. I didn't realised it immediately. Only when I installed debian 12 and after many useless edits in my python files because I had a lot of trouble and noticed this fix applied to 3.11 has nothing to do with my python files being bad because the bug was suddenly gone. It was related to this bug. Sorry I forgot to report it. I remember clearly I had to switch to old apache module whenever I wanted to run some python 3 code. In other words, it was fine on debian 10, broken in debian 11 (with 3.9) and fine again in debian 12, thanks to this fix. |
@i300220 so the fix should really be
does this look reasonable? |
@grisha that's right. thanks! |
I see apparently at random, a segmentation violation.
Bcktrace is
Looks like we're trying to release a semaphore we don't hold.
Python 3.9.1 (Debian build), Apache2.4.46-4 (Debian); mod_python from 88e4444 with the libpython fix.
Using mpm_worker if that makes a difference.
The text was updated successfully, but these errors were encountered: