We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Found when playing with #118415 (comment). Appears on both debug and non-debug builds.
import sys import threading l = threading._PyRLock() def f(): while True: with l: pass t = threading.Thread(target=f) t.start() while True: f = sys._current_frames()[t.ident] while f: f.f_code f = f.f_back
CPython main branch
Linux
Python 3.13.0a6+ (heads/main:9fd33af5ac, May 7 2024, 03:18:30) [GCC 10.2.1 20210110]
The text was updated successfully, but these errors were encountered:
I can't reproduce the crash on a Mac (M3 Pro), in case that's helpful!
Sorry, something went wrong.
I can repro on a MacBook Pro (M1), using ./configure --disable-gil --with-pydebug && make:
./configure --disable-gil --with-pydebug && make
$ ./python.exe ./crash.py Assertion failed: (frame->frame_obj == NULL), function _PyFrame_MakeAndSetFrameObject, file frame.c, line 48. [1] 27564 abort ./python.exe ./crash.py $ ./python.exe -VV Python 3.13.0a6+ (heads/main-dirty:d3c7821335, May 7 2024, 09:27:50) [Clang 15.0.0 (clang-1500.3.9.4)] $ ./python.exe -c "import sys; print(sys._is_gil_enabled())" False
Yeah, this function is not thread-safe. We need to figure out what to do about it.
More precisely, the call sys._current_frames() is okay, but accessing other thread's frames while they are running is not thread-safe without the GIL.
sys._current_frames()
No branches or pull requests
Crash report
What happened?
Found when playing with #118415 (comment). Appears on both debug and non-debug builds.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Output from running 'python -VV' on the command line:
Python 3.13.0a6+ (heads/main:9fd33af5ac, May 7 2024, 03:18:30) [GCC 10.2.1 20210110]
The text was updated successfully, but these errors were encountered: