-
Notifications
You must be signed in to change notification settings - Fork 239
Stack overflow in memcmp on x86_64 when used in extern "C" memcmp implementation with -Zbuild-std #487
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
Comments
The actual condition in rustc seems to be to call @Demindiro Could you look into this? We might have to remove the |
With Still, relying on the whims of the compiler is clearly a poor idea so I'll just remove it. |
Fixed in compiler-builtins 0.1.79 |
This Rust testcase:
runs successfully with Rust nightly 2022-08-07, fails in Rust nightly 2022-08-08 on x86_64-unknown-linux-gnu with -Zbuild-std:
It overflows the stack with unbounded recursion, with iterations looking like this:
It looks like Rust 2022-08-08 included rust-lang/rust#100218, which updated compiler-builtins from 1.73 to 1.78, which pulled in #471. This target has SSE2, so unless I'm mistaken about what's happening here, it appears the observation "targets with SSE(2) do not seem to generate a call to
memcmp
even in debug mode" doesn't hold in this situation.The text was updated successfully, but these errors were encountered: