Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-140936: Fix JIT assertion crash at finalization if some generator is alive#140969
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
gh-140936: Fix JIT assertion crash at finalization if some generator is alive#140969
Conversation
Fidget-Spinner commentedNov 3, 2025
Hmm I think this isn't the problem. The problem might be that JUMP_BACKWARD is specialized to JUMP_BACKWARD_JIT. Following that, finalization happens, turning the JIT off. However, some of the JUMP_BACKWARD still remains as JUMP_BACKWARD_JIT. This causes optimizer to be triggered on JUMP_BACKWARD_JIT. The real fix should be to check if |
efimov-mikhail commentedNov 3, 2025
CC@brandtbucher as author of#129194 |
efimov-mikhail commentedNov 3, 2025
Ok, I've provided this fix. |
Fidget-Spinner commentedNov 3, 2025
@efimov-mikhail thanks. Just checking: does it pass the test on your system? I didn't test it but I think it should. |
efimov-mikhail commentedNov 3, 2025
On my system new test passes with this fix and fails without it on debug build. |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
sergey-miryanov left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM
Uh oh!
There was an error while loading.Please reload this page.
efimov-mikhail commentedNov 12, 2025
Friendly ping,@Fidget-Spinner,@ZeroIntensity . |
Uh oh!
There was an error while loading.Please reload this page.
35ed3e4 intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@efimov-mikhail for the PR, and@Fidget-Spinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
Sorry,@efimov-mikhail and@Fidget-Spinner, I could not cleanly backport this to |
efimov-mikhail commentedNov 12, 2025
Thanks for the merge,@Fidget-Spinner. I'll provide manual backport for 3.14. |
GH-141494 is a backport of this pull request to the3.14 branch. |
* main: (463 commits)pythongh-140601: Add ResourceWarning to iterparse when not closed (pythonGH-140603)pythongh-137969: Fix double evaluation of `ForwardRef`s which rely on globals (python#140974)pythongh-139109: A new tracing JIT compiler frontend for CPython (pythonGH-140310)pythongh-141004: Document `PyErr_RangedSyntaxLocationObject` (python#141521)pythongh-140873: Add support of non-descriptor callables in functools.singledispatchmethod() (pythonGH-140884)pythongh-139653: Add PyUnstable_ThreadState_SetStackProtection() (python#139668)pythongh-141004: Document `PyCode_Optimize` (pythonGH-141378)pythongh-141004: Document C APIs for dictionary keys, values, and items (pythonGH-141009)pythongh-137959: Fix `TIER1_TO_TIER2` macro name in JIT InternalDocs (pythonGH-141496)pythongh-139871: Add `bytearray.take_bytes([n])` to efficiently extract `bytes` (pythonGH-140128)pythongh-140601: Refactor ElementTree.iterparse() tests (pythonGH-141499)pythongh-135801: Add the module parameter to compile() etc (pythonGH-139652)pythongh-140260: fix data race in `_struct` module initialization with subinterpreters (python#140909)pythongh-137109: refactor warning about threads when forking (python#141438)pythongh-141004: Document `PyRun_InteractiveOneObject` (pythonGH-141405)pythongh-124111: Fix TCL 9 thread detection (pythonGH-128103)pythongh-141442: Add escaping to iOS testbed arguments (python#141443)pythongh-140936: Fix JIT assertion crash at finalization if some generator is alive (pythonGH-140969) Add details about JIT build infrastructure and updating dependencies to `Tools/jit` (python#141167)pythongh-141412: Use reliable target URL for urllib example (pythonGH-141428) ...
* 'main' of github.com:python/cpython: (464 commits)pythongh-140601: Add ResourceWarning to iterparse when not closed (pythonGH-140603)pythongh-137969: Fix double evaluation of `ForwardRef`s which rely on globals (python#140974)pythongh-139109: A new tracing JIT compiler frontend for CPython (pythonGH-140310)pythongh-141004: Document `PyErr_RangedSyntaxLocationObject` (python#141521)pythongh-140873: Add support of non-descriptor callables in functools.singledispatchmethod() (pythonGH-140884)pythongh-139653: Add PyUnstable_ThreadState_SetStackProtection() (python#139668)pythongh-141004: Document `PyCode_Optimize` (pythonGH-141378)pythongh-141004: Document C APIs for dictionary keys, values, and items (pythonGH-141009)pythongh-137959: Fix `TIER1_TO_TIER2` macro name in JIT InternalDocs (pythonGH-141496)pythongh-139871: Add `bytearray.take_bytes([n])` to efficiently extract `bytes` (pythonGH-140128)pythongh-140601: Refactor ElementTree.iterparse() tests (pythonGH-141499)pythongh-135801: Add the module parameter to compile() etc (pythonGH-139652)pythongh-140260: fix data race in `_struct` module initialization with subinterpreters (python#140909)pythongh-137109: refactor warning about threads when forking (python#141438)pythongh-141004: Document `PyRun_InteractiveOneObject` (pythonGH-141405)pythongh-124111: Fix TCL 9 thread detection (pythonGH-128103)pythongh-141442: Add escaping to iOS testbed arguments (python#141443)pythongh-140936: Fix JIT assertion crash at finalization if some generator is alive (pythonGH-140969) Add details about JIT build infrastructure and updating dependencies to `Tools/jit` (python#141167)pythongh-141412: Use reliable target URL for urllib example (pythonGH-141428) ...
* 'main' of github.com:python/cpython: (464 commits)pythongh-140601: Add ResourceWarning to iterparse when not closed (pythonGH-140603)pythongh-137969: Fix double evaluation of `ForwardRef`s which rely on globals (python#140974)pythongh-139109: A new tracing JIT compiler frontend for CPython (pythonGH-140310)pythongh-141004: Document `PyErr_RangedSyntaxLocationObject` (python#141521)pythongh-140873: Add support of non-descriptor callables in functools.singledispatchmethod() (pythonGH-140884)pythongh-139653: Add PyUnstable_ThreadState_SetStackProtection() (python#139668)pythongh-141004: Document `PyCode_Optimize` (pythonGH-141378)pythongh-141004: Document C APIs for dictionary keys, values, and items (pythonGH-141009)pythongh-137959: Fix `TIER1_TO_TIER2` macro name in JIT InternalDocs (pythonGH-141496)pythongh-139871: Add `bytearray.take_bytes([n])` to efficiently extract `bytes` (pythonGH-140128)pythongh-140601: Refactor ElementTree.iterparse() tests (pythonGH-141499)pythongh-135801: Add the module parameter to compile() etc (pythonGH-139652)pythongh-140260: fix data race in `_struct` module initialization with subinterpreters (python#140909)pythongh-137109: refactor warning about threads when forking (python#141438)pythongh-141004: Document `PyRun_InteractiveOneObject` (pythonGH-141405)pythongh-124111: Fix TCL 9 thread detection (pythonGH-128103)pythongh-141442: Add escaping to iOS testbed arguments (python#141443)pythongh-140936: Fix JIT assertion crash at finalization if some generator is alive (pythonGH-140969) Add details about JIT build infrastructure and updating dependencies to `Tools/jit` (python#141167)pythongh-141412: Use reliable target URL for urllib example (pythonGH-141428) ...
Uh oh!
There was an error while loading.Please reload this page.
I've removed setting
interp->jittofalseat finalization.Because in rare case it may be a problem when some optimized code is used after
finalize_modules.New test needs subprocess since we have assertion crash only at the finalization stage.
On release builds there was no real problem, and test passed with this fix and without it.