gh-149816: fix a race when fetching OpenSSL digests by picnixz · Pull Request #153019 · python/cpython · GitHub
Skip to content

gh-149816: fix a race when fetching OpenSSL digests#153019

Open
picnixz wants to merge 1 commit into
python:mainfrom
picnixz:fix/free-threading/hashlib-evp-md-149816
Open

gh-149816: fix a race when fetching OpenSSL digests#153019
picnixz wants to merge 1 commit into
python:mainfrom
picnixz:fix/free-threading/hashlib-evp-md-149816

Conversation

@picnixz

@picnixz picnixz commented Jul 4, 2026

Copy link
Copy Markdown
Member

@devdanzin Your didn't include a reproducer for this issue so could you actually check whether this fix would be suitable. I'm not a FT expert but the problem was essentially a race ref leak right?

@picnixz picnixz requested a review from gpshead as a code owner July 4, 2026 11:25
@bedevere-app bedevere-app Bot mentioned this pull request Jul 4, 2026
24 tasks
@picnixz picnixz force-pushed the fix/free-threading/hashlib-evp-md-149816 branch from 4dcd5d4 to 5e4cdc8 Compare July 4, 2026 11:26
@picnixz picnixz force-pushed the fix/free-threading/hashlib-evp-md-149816 branch from 5e4cdc8 to f58811f Compare July 4, 2026 11:27
@picnixz picnixz added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Jul 4, 2026
@devdanzin

Copy link
Copy Markdown
Member

@picnixz

picnixz commented Jul 4, 2026

Copy link
Copy Markdown
Member Author

On the fixed build the counter reports the same number of race-losers under
the same contention (~1800), but each one now frees its fetch instead of leaking
— demonstrating the fix handles the identical race with zero leaked references.
./python -m test test_hashlib passes and TSan reports no races.

IIUC my fix is also correct so.

@picnixz picnixz requested a review from ZeroIntensity July 5, 2026 07:51
@picnixz

picnixz commented Jul 5, 2026

Copy link
Copy Markdown
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants