-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Segfault from calling StringIO
methods in threads on free-threading debug build
#135410
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
Labels
3.13
bugs and security fixes
3.14
bugs and security fixes
3.15
new features, bugs and security fixes
extension-modules
C modules in the Modules dir
topic-free-threading
type-crash
A hard crash of the interpreter, possibly with a core dump
Comments
This seems very similar to #134908 we should add critical section around iteration |
kumaraditya303
pushed a commit
that referenced
this issue
Jun 12, 2025
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Jun 12, 2025
…ythonGH-135412) (cherry picked from commit e6c3039) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
kumaraditya303
pushed a commit
that referenced
this issue
Jun 12, 2025
We broke the refleak buildbots. |
ZeroIntensity
added a commit
to ZeroIntensity/cpython
that referenced
this issue
Jun 12, 2025
…xt__` (python#135412)" This reverts commit e6c3039.
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Jun 12, 2025
…xt__` (pythonGH-135412)" (pythonGH-135439) This reverts commit e6c3039. (cherry picked from commit 7343135) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
3.13
bugs and security fixes
3.14
bugs and security fixes
3.15
new features, bugs and security fixes
extension-modules
C modules in the Modules dir
topic-free-threading
type-crash
A hard crash of the interpreter, possibly with a core dump
Uh oh!
There was an error while loading. Please reload this page.
Crash report
What happened?
It's possible to segfault or abort the interpreter in a free-threading debug build by calling StringIO methods from threads:
The segfault for this MRE can happen in different places, all seemingly related to
_stringio_readline
. If you comment out thesio.seek(0)
line, a different segfault happens.Backtrace:
Similar backtrace:
Backtrace with indicated line commented out:
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.15.0a0 experimental free-threading build (heads/main:ac7511062bf, Jun 9 2025, 15:09:10) [GCC 11.4.0]
Linked PRs
StringIO.__next__
#135412StringIO.__next__
(GH-135412) #135425test_memoryio
refleak buildbots #135430StringIO.__next__
(#135412)" #135439StringIO.__next__
(GH-135412)" (GH-135439) #135449The text was updated successfully, but these errors were encountered: