Skip to content

gh-141536: Fix a crash when running test_capi *after* test_code in the same process - #141537

Merged
Yhg1s merged 3 commits into
python:mainfrom
Yhg1s:test_code_crash
Jan 7, 2026
Merged

Yhg1s merged 3 commits into
python:mainfrom
Yhg1s:test_code_crash

Conversation

@Yhg1s

@Yhg1s Yhg1s commented Nov 13, 2025 •

Copy link
Copy Markdown
Member

@efimov-mikhail

efimov-mikhail commented Nov 14, 2025 •

Copy link
Copy Markdown
Member

There's CI problem with test_import for UBSan build. I have two sequential problems on my PR:
#139717

See also #141545, #131229

Comment thread Lib/test/test_code.py Resolved
meta-codesync Bot pushed a commit to facebookincubator/MetaPython that referenced this pull request Nov 20, 2025
Summary:
We need this PR to resolve a segfault - python/cpython#141537
Patching it in now since it may be some time before it lands in upstream + get backported to 3.14

This diff adds a patch to the `third-party/python/3.14` Meta-internal fork.

Fix a crash when running test_capi *after* test_code in the same process

Reviewed By: itamaro

Differential Revision: D87464010

fbshipit-source-id: 79e515ab5733a365ef52c821b06c59f59ded0a7a

@itamaro itamaro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

TIL about late_deletion in test.support!

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. I confirm that this change fix the issue #141536.

@Yhg1s
Yhg1s merged commit b2827de into python:main Jan 7, 2026
4 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @Yhg1s for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 7, 2026
… in the same process (pythonGH-141537)

(cherry picked from commit b2827de)

Co-authored-by: T. Wouters <thomas@python.org>
@miss-islington-app

Copy link
Copy Markdown

Sorry, @Yhg1s, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker b2827de18fe88152dc38c1aa76c39b69ef59cb6f 3.13

@bedevere-app

bedevere-app Bot commented Jan 7, 2026

Copy link
Copy Markdown

GH-143522 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jan 7, 2026
StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request Jan 9, 2026
…st_code in the same process (pythonGH-141537)

(cherry picked from commit b2827de)

Co-authored-by: T. Wouters <thomas@python.org>
@bedevere-app

bedevere-app Bot commented Jan 9, 2026

Copy link
Copy Markdown

GH-143625 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Jan 9, 2026
kumaraditya303 pushed a commit that referenced this pull request Jan 10, 2026
…e in the same process (GH-141537) (#143522)

gh-141536: Fix a crash when running test_capi *after* test_code in the same process (GH-141537)
(cherry picked from commit b2827de)

Co-authored-by: T. Wouters <thomas@python.org>
serhiy-storchaka pushed a commit that referenced this pull request Jan 12, 2026
…e in the same process (GH-141537) (GH-143625)

(cherry picked from commit b2827de)

Co-authored-by: T. Wouters <thomas@python.org>
thunder-coding pushed a commit to thunder-coding/cpython that referenced this pull request Feb 15, 2026
@Yhg1s
Yhg1s deleted the test_code_crash branch August 13, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants