Skip to content

[3.11]GH-112275: Fix HEAD_LOCK deadlock in child process after fork #112336

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Sep 4, 2024

Conversation

ChuBoning
Copy link

@ChuBoning ChuBoning commented Nov 23, 2023

HEAD_LOCK is called from _PyEval_ReInitThreads->_PyThreadState_DeleteExcept before _PyRuntimeState_ReInitThreads reinit runtime->interpreters.mutex which might be locked before fork.

HEAD_LOCK is called from _PyEval_ReInitThreads->_PyThreadState_DeleteExcept before _PyRuntimeState_ReInitThreads reinit runtime->interpreters.mutex which might be locked before fork.
@ghost
Copy link

ghost commented Nov 23, 2023

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Nov 23, 2023

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 skip news label instead.

@bedevere-app
Copy link

bedevere-app bot commented Nov 28, 2023

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 skip news label instead.

@picnixz
Copy link
Member

picnixz commented Sep 4, 2024

@ambv I'm not sure this warrants a backport to security-only branches.

@ambv
Copy link
Contributor

ambv commented Sep 4, 2024

Crashes and denial of service (like a dead lock) can be treated as security-adjacent fixes. I've been allowing those for my releases.

@ambv ambv merged commit 522799a into python:3.11 Sep 4, 2024
22 checks passed
@miss-islington-app
Copy link

Thanks @ChuBoning for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9, 3.10.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 4, 2024
…fork (pythonGH-112336)

HEAD_LOCK is called from _PyEval_ReInitThreads->_PyThreadState_DeleteExcept before _PyRuntimeState_ReInitThreads reinit runtime->interpreters.mutex which might be locked before fork.

(cherry picked from commit 522799a)

Co-authored-by: ChuBoning <[email protected]>
Co-authored-by: Łukasz Langa <[email protected]>
@miss-islington-app
Copy link

Sorry, @ChuBoning and @ambv, I could not cleanly backport this to 3.9 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 522799a05e3e820339718151ac055af6d864d463 3.9

@bedevere-app
Copy link

bedevere-app bot commented Sep 4, 2024

GH-123687 is a backport of this pull request to the 3.10 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.10 only security fixes label Sep 4, 2024
@miss-islington-app
Copy link

Sorry, @ChuBoning and @ambv, I could not cleanly backport this to 3.8 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 522799a05e3e820339718151ac055af6d864d463 3.8

@ambv
Copy link
Contributor

ambv commented Sep 4, 2024

I'll make the 3.8 and 3.9 backports manually.

@bedevere-app
Copy link

bedevere-app bot commented Sep 4, 2024

GH-123687 is a backport of this pull request to the 3.10 branch.

ambv added a commit to ambv/cpython that referenced this pull request Sep 4, 2024
…after fork (pythonGH-112336)

HEAD_LOCK is called from _PyEval_ReInitThreads->_PyThreadState_DeleteExcept before _PyRuntimeState_ReInitThreads reinit runtime->interpreters.mutex which might be locked before fork.

(cherry picked from commit 522799a)

Co-authored-by: ChuBoning <[email protected]>
Co-authored-by: Łukasz Langa <[email protected]>
ambv added a commit that referenced this pull request Sep 4, 2024
…H-112336) (#123687)

HEAD_LOCK is called from _PyEval_ReInitThreads->_PyThreadState_DeleteExcept before _PyRuntimeState_ReInitThreads reinit runtime->interpreters.mutex which might be locked before fork.

(cherry picked from commit 522799a)

Co-authored-by: ChuBoning <[email protected]>
Co-authored-by: Łukasz Langa <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Sep 4, 2024

GH-123688 is a backport of this pull request to the 3.9 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.9 only security fixes label Sep 4, 2024
ambv added a commit that referenced this pull request Sep 4, 2024
…H-112336) (#123688)

HEAD_LOCK is called from _PyEval_ReInitThreads->_PyThreadState_DeleteExcept before _PyRuntimeState_ReInitThreads reinit runtime->interpreters.mutex which might be locked before fork.

(cherry picked from commit 522799a)

Co-authored-by: ChuBoning <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 4, 2024
…fork (pythonGH-112336) (pythonGH-123688)

HEAD_LOCK is called from _PyEval_ReInitThreads->_PyThreadState_DeleteExcept before _PyRuntimeState_ReInitThreads reinit runtime->interpreters.mutex which might be locked before fork.

(cherry picked from commit 522799a)

(cherry picked from commit 0152431)

Co-authored-by: Łukasz Langa <[email protected]>
Co-authored-by: ChuBoning <[email protected]>
@ChuBoning ChuBoning deleted the ChuBoning-patch-1 branch September 5, 2024 08:55
ambv added a commit that referenced this pull request Sep 5, 2024
…H-112336) (GH-123688) (#123713)

HEAD_LOCK is called from _PyEval_ReInitThreads->_PyThreadState_DeleteExcept before _PyRuntimeState_ReInitThreads reinit runtime->interpreters.mutex which might be locked before fork.

(cherry picked from commit 522799a)
(cherry picked from commit 0152431)

Co-authored-by: Łukasz Langa <[email protected]>
Co-authored-by: ChuBoning <[email protected]>
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