Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use wrapping addition for JEC #800

Merged
merged 5 commits into from
Sep 17, 2020
Merged

Use wrapping addition for JEC #800

merged 5 commits into from
Sep 17, 2020

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Sep 15, 2020

32-bit targets only have 12 bits in the atomic counters to represent the Jobs Event Counter (JEC). This should be fine with wrapping addition, but commit a0efb4a changed from wrapping fetch_add to a plain +, which is a checked addition in debug builds. We simply need to make this an explicit wrapping_add instead.

In theory, 64-bit targets had a problem too, but 44 bits for JEC is pretty good headroom in debug mode.

Fixes #797.

@cuviper
Copy link
Member Author

cuviper commented Sep 15, 2020

Let's make sure the new CI target works:

bors try

bors bot added a commit that referenced this pull request Sep 15, 2020
@cuviper
Copy link
Member Author

cuviper commented Sep 15, 2020

bors try

@bors
Copy link
Contributor

bors bot commented Sep 15, 2020

try

Already running a review

@cuviper
Copy link
Member Author

cuviper commented Sep 15, 2020

bors try-

@cuviper
Copy link
Member Author

cuviper commented Sep 15, 2020

bors try

bors bot added a commit that referenced this pull request Sep 15, 2020
@ebarnard
Copy link

Just tested on the software mentioned in #797 and this has fixed it.

@cuviper
Copy link
Member Author

cuviper commented Sep 17, 2020

OK, I'll go ahead and publish rayon-core 1.8.1.

bors r+

@bors bors bot merged commit 8c9ada2 into rayon-rs:master Sep 17, 2020
@cuviper
Copy link
Member Author

cuviper commented Sep 17, 2020

Published!

@cuviper cuviper mentioned this pull request Jan 17, 2023
3 tasks
@cuviper cuviper deleted the wrap-jec branch February 25, 2023 17:58
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.

Integer overflow in rayon-core 1.8 causes process abort on 32 bit CPUs
2 participants