-
Notifications
You must be signed in to change notification settings - Fork 509
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
Integer overflow in rayon-core 1.8 causes process abort on 32 bit CPUs #797
Comments
Hmm, I thought the JEC was supposed to use wrapping add -- @nikomatsakis do you know why that's a bare addition? |
Prior to a0efb4a it was using |
A minimal reproduction of this bug on 32-bit platforms is:
|
Thanks - I can reliably reproduce the overflow panic with 100,000 iterations, and it works when changing |
@cuviper I believe it was meant to be a wrapping add indeed, I think I just wasn't thinking. I guess I will review the code to double check my understanding. |
From reading the code, and the README.md in particular, I definitely think it was meant to rollover. |
I have some software that aborts when compiled as a 32-bit executable but runs fine as a 64-bit executable. It seems that
Counters::plus()
is causingword
to overflow leading to Rayon aborting the process.The abort is in a deadlock detection test that tries to trigger a race condition that affected the software's original deadlock detection, so it ends up calling
rayon::join
quite a lot in a short space of time (but not anywhere near 2^32 times). It occurs in debug and release mode (with overflow checks enabled).Reverting to rayon 1.3.1 and rayon-core 1.7.1 fixes the issue.
I'm working on a minimal example as I can't share the original software.
Backtrace
The text was updated successfully, but these errors were encountered: