-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
psutil fails (segfault) on Mac OS in the free-threaded (no GIL) version of Python 3.13 #2427
Comments
I don't know enough about free-thread cPython to give any guidance. Some work in this sense was done in #2401. @colesbury any idea? |
happens on windows as well. |
Can you guys run:
...and paste the output? |
|
I get this, on Mac OS:
This is with the published release (from pip install). Should we try it with the current latest code from github? |
Sorry for the ping ponging of issues between projects. I think this is mostly not specific to psutil, but I'm not entirely sure yet. I'd like to focus on macOS first, because I think it'll be easier to get it into a good state. @pkoning2, how did you get Python, pip, and psutil installed? Here are some issues I noticed on macOS:
Here's what I did to successfully install psutil:
There's still the issue that importing psutil enables the GIL:
That can be fixed in this project, but the other issues are more CPython related. |
Yes, what I did roughly follows the steps you describe. I didn't realize that pip was out of date and this is the first time I've run into a situation where it actually matters. So yes, now you have the GIL lock complaint. I ran python3.13t with that flag to suppress the warning, and psutil seems to work fine. At least for I noticed the help mentions |
I'll work on a patch to suppress the GIL warnings and behavior in the free-threaded build, as well as a few small thread-safety issues on some OS's if certain psutil functions are used from multiple threads concurrently. |
Summary
Description
Transfered here from python/cpython#120717
I used pip to install psutil on python 3.13 0b2, both the regular and the "t" version. The regular one works; the t one fails at import psutil with a segfault.
The Python teams comments: "Any extensions that uses more than Python would need to adapt to free-threading if they want to onboard. It's impossible for CPython to ensure all the C extensions work without GIL. So this should be an issue for psutil ."
The text was updated successfully, but these errors were encountered: