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
Copy link
Copy Markdown
Contributor

@brijkapadia brijkapadia commented May 29, 2026

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
Copy link
Copy Markdown
Member

picnixz commented May 29, 2026

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
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