-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
Segfault/abort from calling BytesIO
unshare_buffer
in threads on a free-threaded build
#132551
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
Comments
|
|
Edit:
But is Ah, wait, |
FYI CURRENT: (note empty buffer so just timing overhead)
CRITS:
Some
|
This is a cost of using many little locks instead of one global lock. If this does not affect performance for non free-threaded builds, we should add critical sections for all methods. Correctness first, performance second. |
Shouldn't, all the critical stuff disappears in GIL build:
|
Crash report
What happened?
This seems to be almost the same issue as #111174, but for free-threaded builds.
In a free-threaded build it's possible to segfault (rare on debug build) or abort (common on debug build) the interpreter with the following code (which might not be minimal, I'll try to reduce it further later today):
Segfault backtrace 1 (gcc, release):
Segfault backtrace 2 (clang, debug, ASAN):
Segfault backtrace 3 (this one only happened with code similar to the MRE, not from this exact code):
Segfault backtrace 4:
Abort backtrace:
Rare error message:
Found using fusil by @vstinner.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Output from running 'python -VV' on the command line:
Python 3.14.0a7+ experimental free-threading build (heads/main:c7f6535e4a3, Apr 15 2025, 09:09:58) [GCC 11.4.0]
Linked PRs
The text was updated successfully, but these errors were encountered: