GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-154037: Fix race in the Decimal.__hash__() by skirpichev · Pull Request #154045 · python/cpython

Conversation

@skirpichev

@skirpichev skirpichev commented Jul 19, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Issue: Data race in Decimal.__hash__() #154037

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@skirpichev
pythongh-154037: Fix race in the Decimal.__hash__()
ef09f8c
@skirpichev skirpichev added the skip news label Jul 19, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Jul 19, 2026
Data race in Decimal.__hash__() #154037
Closed
@bedevere-app bedevere-app Bot added the awaiting review label Jul 19, 2026
@skirpichev

skirpichev commented Jul 19, 2026

Copy link
Copy Markdown
Member Author

I think it's safe enough to backport. Though, I doubt it worth: this patch just prevents hash recomputing in some cases.

moritajavier239-rgb reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@encukou

encukou commented Jul 19, 2026

Copy link
Copy Markdown
Member

Does the compiler always optimize the duplicate ATOMIC_LOAD?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@skirpichev
use local variable
d3d8268
@skirpichev

skirpichev commented Jul 19, 2026

Copy link
Copy Markdown
Member Author

Does the compiler always optimize the duplicate ATOMIC_LOAD?

Well, maybe some not. Lets use a local variable, anyway.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@skirpichev
+1
c9e1c79
@IvyXu420 IvyXu420 mentioned this pull request Jul 23, 2026
gh-153852: Fix data race in hash cal for Decimal #154519
Closed
@devdanzin devdanzin mentioned this pull request Jul 23, 2026
Free-threading data races in CPython: 15 findings (9 new + 6 residual of existing FT work) #153852
Open
kumaraditya303
kumaraditya303 approved these changes Jul 30, 2026
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Jul 30, 2026
@kumaraditya303
kumaraditya303 enabled auto-merge (squash) July 30, 2026 15:02
@kumaraditya303
kumaraditya303 merged commit 2f381f5 into python:main Jul 30, 2026
55 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label Jul 30, 2026
@skirpichev
skirpichev deleted the fix-race-in-Decimal-hash/154037 branch July 30, 2026 16:27
mbeijen pushed a commit to mbeijen/cpython that referenced this pull request Aug 14, 2026
@skirpichev @mbeijen
pythongh-154037: Fix race in the hash(Decimal) (python#154045)
c367fd1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@kumaraditya303 kumaraditya303 kumaraditya303 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@skirpichev @encukou @kumaraditya303
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.