Skip to content

gh-117657: Fix TSAN reported race in _PyEval_IsGILEnabled. - #119921

Merged
colesbury merged 1 commit into
python:mainfrom
colesbury:gh-117657-is-gil-enabled
Jun 2, 2024
Merged

colesbury merged 1 commit into
python:mainfrom
colesbury:gh-117657-is-gil-enabled

Conversation

@colesbury

@colesbury colesbury commented Jun 1, 2024 •

Copy link
Copy Markdown
Contributor

The GIL may be disabled concurrently with this call so we need to use a relaxed atomic load.

The GIL may be disabled concurrently with this call so we need to use a
relaxed atomic load.

@corona10 corona10 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.

_PyEval_IsGILEnabled is called at free-threaded build only so using atomic operation directly looks reasonable.

LGTM

@colesbury
colesbury merged commit f3b89a6 into python:main Jun 2, 2024
@miss-islington-app

Copy link
Copy Markdown

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

@colesbury
colesbury deleted the gh-117657-is-gil-enabled branch June 2, 2024 14:19
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 2, 2024
…ythonGH-119921)

The GIL may be disabled concurrently with this call so we need to use a
relaxed atomic load.
(cherry picked from commit f3b89a6)

Co-authored-by: Sam Gross <colesbury@gmail.com>
@bedevere-app

bedevere-app Bot commented Jun 2, 2024

Copy link
Copy Markdown

GH-119939 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 Jun 2, 2024
colesbury added a commit that referenced this pull request Jun 2, 2024
…H-119921) (#119939)

The GIL may be disabled concurrently with this call so we need to use a
relaxed atomic load.
(cherry picked from commit f3b89a6)

Co-authored-by: Sam Gross <colesbury@gmail.com>
mliezun pushed a commit to mliezun/cpython that referenced this pull request Jun 3, 2024
…ython#119921)

The GIL may be disabled concurrently with this call so we need to use a
relaxed atomic load.
barneygale pushed a commit to barneygale/cpython that referenced this pull request Jun 5, 2024
…ython#119921)

The GIL may be disabled concurrently with this call so we need to use a
relaxed atomic load.
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
…ython#119921)

The GIL may be disabled concurrently with this call so we need to use a
relaxed atomic load.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants