Skip to content

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

Merged
ambv merged 6 commits into
python:3.11from
ChuBoning:ChuBoning-patch-1
Sep 4, 2024
Merged

ambv merged 6 commits into
python:3.11from
ChuBoning:ChuBoning-patch-1

Conversation

@ChuBoning

@ChuBoning ChuBoning commented Nov 23, 2023 •

Copy link
Copy Markdown

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

ghost commented Nov 23, 2023 •

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app

bedevere-app Bot commented Nov 23, 2023

Copy link
Copy Markdown

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

bedevere-app Bot commented Nov 28, 2023

Copy link
Copy Markdown

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

picnixz commented Sep 4, 2024

Copy link
Copy Markdown
Member

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

@ambv

ambv commented Sep 4, 2024

Copy link
Copy Markdown
Contributor

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
@miss-islington-app

Copy link
Copy Markdown

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 <102216855+ChuBoning@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
@miss-islington-app

Copy link
Copy Markdown

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

bedevere-app Bot commented Sep 4, 2024

Copy link
Copy Markdown

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

@miss-islington-app

Copy link
Copy Markdown

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

ambv commented Sep 4, 2024

Copy link
Copy Markdown
Contributor

I'll make the 3.8 and 3.9 backports manually.

@bedevere-app

bedevere-app Bot commented Sep 4, 2024

Copy link
Copy Markdown

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 <102216855+ChuBoning@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
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 <102216855+ChuBoning@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
@bedevere-app

bedevere-app Bot commented Sep 4, 2024

Copy link
Copy Markdown

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

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 <102216855+ChuBoning@users.noreply.github.com>
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 <lukasz@langa.pl>
Co-authored-by: ChuBoning <102216855+ChuBoning@users.noreply.github.com>
@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 <lukasz@langa.pl>
Co-authored-by: ChuBoning <102216855+ChuBoning@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants