FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.15] gh-158820: Add null checks to avoid segfaults with lazy imports at shutdown (GH-158821) by miss-islington · Pull Request #159062 · python/cpython · GitHub

Repository navigation

[3.15] gh-158820: Add null checks to avoid segfaults with lazy imports at shutdown (GH-158821) - #159062

Merged
JelleZijlstra merged 1 commit into
python:3.15from
miss-islington:backport-a6e6361-3.15
Oct 9, 2026
Merged

JelleZijlstra merged 1 commit into
python:3.15from
miss-islington:backport-a6e6361-3.15

Conversation

miss-islington commented Oct 9, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

Destructors can run after finalization has cleared the interpreter's
lazy_modules set and lazy_pending_submodules dict. Declaring or
resolving a lazy import from one of them passed NULL to PySet_Add(),
PySet_Discard() or the pending-submodules lookup.

Treat the bookkeeping as a no-op once the state is gone, as the other
readers of this state already do.
(cherry picked from commit a6e6361)

Co-authored-by: Brittany Reynoso breynoso@meta.com

… at shutdown (pythonGH-158821)

Destructors can run after finalization has cleared the interpreter's
lazy_modules set and lazy_pending_submodules dict. Declaring or
resolving a lazy import from one of them passed NULL to PySet_Add(),
PySet_Discard() or the pending-submodules lookup.

Treat the bookkeeping as a no-op once the state is gone, as the other
readers of this state already do.
(cherry picked from commit a6e6361)

Co-authored-by: Brittany Reynoso <breynoso@meta.com>

Copy link
Copy Markdown
Contributor

@JelleZijlstra This should probably end up in 3.15.1 as well.

JelleZijlstra merged commit f8375c2 into python:3.15 Oct 9, 2026
55 checks passed
miss-islington deleted the backport-a6e6361-3.15 branch October 9, 2026 19:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL