gh-154014: Initialize cold executor vm_data fields#154142
Conversation
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Fidget-Spinner
left a comment
There was a problem hiding this comment.
Looks good, just needs style cleanups.
|
Please add a news entry as well, and a test reproducer in |
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
|
Thanks for the review @Fidget-Spinner I've addressed the requested changes:
The CI is now running on the updated branch. I'd appreciate another look when you have a chance. Thanks! |
cocolato
left a comment
There was a problem hiding this comment.
we can release unregistered cold executors directly
|
Thanks! let's wait for Ken Jin's review :) |
|
@cocolato do you know if this fixes the reproducer on your system? If you're able to, can you please check? Really appreciate being able to outsource some of the work to you, thanks a lot! |
I have verified that the cold executor assertion in the issue has been fixed. I also reproduced a scenario where |
|
Thanks @BHUVANSH855 for the PR, and @Fidget-Spinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15. |
|
GH-154457 is a backport of this pull request to the 3.15 branch. |
|
Note: The SC has paused all JIT development with the exception of bugfixes. As this is a bugfix, I'm merging it. |
Issue
Fixes gh-154014.
Summary
make_cold_executor()allocates cold executors directly viaallocate_executor()and bypasses_Py_ExecutorInit(). As a result,vm_data.validandvm_data.pending_deletionremain uninitialized.During interpreter shutdown,
interpreter_clear()asserts thatcold->vm_data.validis true, causing assertion failures when CPython isbuilt with
--enable-experimental-jit --with-assertions.This change initializes the required
vm_datafields for cold executors,restoring the expected invariant during shutdown.
Testing
Reproduced the original crash reported in the issue using:
./configure --enable-experimental-jit --with-assertions make -j$(nproc)Before this change,
_bootstrap_pythonaborted with:After this change:
make -j$(nproc)completes successfully.