-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Opt-level profile override causes function miscompile to ud2 on MacOS #63258
Comments
Can you make a reproducer without using any dependencies? |
@Centril I'm not so sure... Not every function gets optimized away, I only got that in my pet project with this particular dependency. I'll try that, though I can't promise I'll be able to get a reproducer without external dependencies. |
The example is using an old version of specs, which is using an old version of crossbeam, which has this suspicious line creating an uninitialized |
@Centril I tried to reproduce the bug with a workspace dependency (without using of external ones), but I've got no luck so far. Can't really identify the code which causes the miscompilation |
I do not think this is a miscompilation, just dubious code dating back from when we really didn't know much about UB in Rust that results from the rest of the language design. The code in question executes UB, or tries to. Since #66059, this code just panics:
|
Great, I'm going to close this out now then. |
Opt-level profile override causes function miscompile to ud2 on MacOS. I wasn't able to reproduce this bug on Windows 10.
rustc version: 1.38.0-nightly (6e0d27d 2019-08-03)
The most minimal example I could come up with:
https://github.com/mvlabat/ud2
src/main.rs: https://github.com/mvlabat/ud2/blob/master/src/main.rs
Cargo.toml: https://github.com/mvlabat/ud2/blob/master/Cargo.toml
Note that I use
profile-overrides
nightly feature, and specifyopt-level = 3
for the dependencies. (Also tested with level 2, it works the same way.)Compiling and running this example in debug mode yields the following result:
(lldb) run:
(lldb) thread backtrace all:
(lldb) disas:
The text was updated successfully, but these errors were encountered: