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 :) |
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.