Skip to content

gh-144774: Add critical section in BaseException.__setstate__#150578

Merged
kumaraditya303 merged 9 commits into
python:mainfrom
brijkapadia:exception-data-race
May 30, 2026
Merged

gh-144774: Add critical section in BaseException.__setstate__#150578
kumaraditya303 merged 9 commits into
python:mainfrom
brijkapadia:exception-data-race

Conversation

@brijkapadia

@brijkapadia brijkapadia commented May 29, 2026

Copy link
Copy Markdown
Contributor

Adds a critical section to prevent a data race in exceptions.c.
Unsure if the test is in the right location.
I don't think that a news entry is necessary.

Comment thread Objects/exceptions.c Outdated
Comment thread Objects/exceptions.c Outdated
@picnixz picnixz changed the title gh-144774: Add critical section in exceptions.c with PyDict_Next gh-144774: Add critical section in BaseException.__setstate__ May 29, 2026
@picnixz

picnixz commented May 29, 2026

Copy link
Copy Markdown
Member

I don't think that a news entry is necessary.

Usually a bug fix always includes a NEWS entry, at least to indicate that a crash has been fixed. In this case, it's a data race that has been fixed when an exception is being copied while being mutated.

Co-authored-by: Sam Gross <colesbury@gmail.com>
Comment thread Lib/test/test_exceptions.py Outdated
Comment thread Lib/test/test_exceptions.py Outdated
Comment thread Lib/test/test_exceptions.py
@kumaraditya303

Copy link
Copy Markdown
Contributor

You need to do make regen-clinic again.

@kumaraditya303 kumaraditya303 merged commit f586fd9 into python:main May 30, 2026
55 checks passed
@brijkapadia brijkapadia deleted the exception-data-race branch May 30, 2026 15:57
@kumaraditya303 kumaraditya303 added the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jul 15, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @brijkapadia for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Jul 15, 2026

Copy link
Copy Markdown

GH-153746 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jul 15, 2026
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.

4 participants