-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Rust 1.56 injected a valgrind incompatibility for Linux/AAarch64 #90316
Comments
My current hypothesis is that this is a bug entirely on the valgrind side. I reached out to the valgrind developers, and they floated a few hypotheses. E.g. that we might not be doing sufficient CPU detection on our side before going down code paths with instructions that valgrind does not yet handle. But they also said that they were mystified that we were encountering this. In the meantime, here is the corresponding bug that I filed on the valgrind side: https://bugs.kde.org/show_bug.cgi?id=444399 (I believe the valgrind developers will be investigating it more in the next few days.) |
Assigning priority as discussed in the Zulip thread of the Prioritization Working Group. @rustbot label -I-prioritize +P-high |
Just to simplify the code, as the original example does no longer reproduce for me on nightly. This: let _x = AtomicU128::new(3).fetch_max(7, Relaxed); compiles with current nightly on aarch64-unknown-linux-gnu to: atomictest::main:
sub sp, sp, #16
mov w9, #3
mov x8, sp
stp x9, xzr, [sp]
mov w9, #7
.LBB5_1:
ldxp x10, x11, [x8]
cmp x10, #7
cset w12, hi
cmp x11, #0
cset w13, ne
csel w12, w12, w13, eq
cmp w12, #0
csel x11, x11, xzr, ne
csel x10, x10, x9, ne
stxp w12, x10, x11, [x8]
cbnz w12, .LBB5_1
add sp, sp, #16
ret Valgrind complains about opcode 1100'1000 0111'1111 0010'1101 1000'1001, which is |
Added a C++ reproducer to the valgrind bug report: https://bugs.kde.org/show_bug.cgi?id=444399#c3 |
Should this be closed now that it has been acknowledged to be a shortcoming of valgrind: https://bugs.kde.org/show_bug.cgi?id=444399#c5? |
Closing as assumed fixed with https://sourceware.org/git/?p=valgrind.git;a=commit;h=530df882b8f60ecacaf2b9b8a719f7ea1c1d1650 |
Code
I tried this code:
and ran it under
valgrind
.I expected to see this happen: Successful program run with 0 errors from valgrind.
Instead, this happened:
Version it worked on
It most recently worked on: Rust 1.55
Version with regression
rustc --version --verbose
:I also narrowed it down to which nightly injected the bug:
which makes sense, because I believe this was injected by PR #83093
(The above transcript includes an invocation of valgrind, v 3.15.0, that is not the latest. But I did a build of 3.18 and reproduced the same bug there as well.)
The text was updated successfully, but these errors were encountered: