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

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 Resolved
Comment thread Objects/exceptions.c Resolved
@picnixz picnixz changed the title gh-144774: Add critical section in exceptions.c with PyDict_Next 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 Resolved
Comment thread Lib/test/test_exceptions.py Resolved
Comment thread Lib/test/test_exceptions.py Resolved
@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
51 checks passed
@brijkapadia
brijkapadia deleted the exception-data-race branch May 30, 2026 15:57
@kumaraditya303 kumaraditya303 added the needs backport to 3.15 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 bugs and security fixes label Jul 15, 2026
kumaraditya303 pushed a commit that referenced this pull request Jul 15, 2026
GH-150578) (#153746)

gh-144774: Add critical section in `BaseException.__setstate__` (GH-150578)
(cherry picked from commit f586fd9)

Co-authored-by: Brij Kapadia <97006829+brijkapadia@users.noreply.github.com>
@bedevere-app

bedevere-app Bot commented Jul 16, 2026

Copy link
Copy Markdown

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

nascheme added a commit that referenced this pull request Jul 17, 2026
GH-150578) (GH-153819)

(cherry picked from commit f586fd9)

Co-authored-by: Brij Kapadia <97006829+brijkapadia@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

4 participants