Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Conversation

@efimov-mikhail
Copy link
Member

@efimov-mikhailefimov-mikhail commentedNov 3, 2025
edited by bedevere-appbot
Loading

I've removed settinginterp->jit tofalse at finalization.
Because in rare case it may be a problem when some optimized code is used afterfinalize_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.

@Fidget-Spinner
Copy link
Member

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 ifinterp->jit is false in_PyOptimizer_Optimize and immediately return if not.

@efimov-mikhail
Copy link
MemberAuthor

CC@brandtbucher as author of#129194

@efimov-mikhail
Copy link
MemberAuthor

The real fix should be to check ifinterp->jit is false in_PyOptimizer_Optimize and immediately return if not.

Ok, I've provided this fix.

@Fidget-Spinner
Copy link
Member

@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
Copy link
MemberAuthor

On my system new test passes with this fix and fails without it on debug build.
And all others tests also pass.

Fidget-Spinner reacted with thumbs up emoji

Copy link
Contributor

@sergey-miryanovsergey-miryanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM

efimov-mikhail reacted with heart emoji
@efimov-mikhail
Copy link
MemberAuthor

Friendly ping,@Fidget-Spinner,@ZeroIntensity .
Can we merge this or there's something else that I have to address?

@Fidget-SpinnerFidget-Spinner merged commit35ed3e4 intopython:mainNov 12, 2025
62 checks passed
@miss-islington-app
Copy link

Thanks@efimov-mikhail for the PR, and@Fidget-Spinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

@miss-islington-app
Copy link

Sorry,@efimov-mikhail and@Fidget-Spinner, I could not cleanly backport this to3.14 due to a conflict.
Please backport usingcherry_picker on command line.

cherry_picker 35ed3e4cedc8aef3936da81a6b64e90374532b13 3.14

@efimov-mikhail
Copy link
MemberAuthor

Thanks for the merge,@Fidget-Spinner. I'll provide manual backport for 3.14.

Fidget-Spinner reacted with heart emoji

efimov-mikhail added a commit to efimov-mikhail/cpython that referenced this pull requestNov 13, 2025
@bedevere-app
Copy link

GH-141494 is a backport of this pull request to the3.14 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.14bugs and security fixes labelNov 13, 2025
Fidget-Spinner pushed a commit that referenced this pull requestNov 13, 2025
…erator is alive (GH-140969) (GH-141494)gh-140936: Fix JIT assertion crash at finalization if some generator is alive (GH-140969)
CuriousLearner added a commit to CuriousLearner/cpython that referenced this pull requestNov 13, 2025
* 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)  ...
CuriousLearner added a commit to CuriousLearner/cpython that referenced this pull requestNov 14, 2025
* '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)  ...
CuriousLearner added a commit to CuriousLearner/cpython that referenced this pull requestNov 14, 2025
* '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)  ...
StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull requestDec 6, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@Fidget-SpinnerFidget-SpinnerFidget-Spinner approved these changes

@sergey-miryanovsergey-miryanovsergey-miryanov approved these changes

@ericsnowcurrentlyericsnowcurrentlyAwaiting requested review from ericsnowcurrently

@markshannonmarkshannonAwaiting requested review from markshannonmarkshannon is a code owner

@ZeroIntensityZeroIntensityAwaiting requested review from ZeroIntensity

Assignees

@Fidget-SpinnerFidget-Spinner

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@efimov-mikhail@Fidget-Spinner@sergey-miryanov@ZeroIntensity

[8]ページ先頭

©2009-2025 Movatter.jp