-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Compiling project makes rustc emit STATUS_ILLEGAL_INSTRUCTION #77667
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 issue does not seem to occur on Linux.
That's odd. Does this come from LLVM? |
Oops, misread the Rust versions, doesn't look like a regression so far |
Does not reproduce on Windows 10 with windows-gnu. Can you run it in debugger? Also you have some flags in your |
I did some more testing:
I can try, but how would I best do that? |
Ok, I honestly have no idea how to debug it:
|
I was able to reproduce this under Linux with a stage1 rustc, using the following hack:
This allowed me to obtain the following backtrace (with LLVM debug assertions enabled):
The following LLVM code looks relevant: It looks like LLVM may be trying to serialize a very long Rust type, which ends up exceeding |
#77948 rebases rustc onto the final LLVM 11.0 release. According to that MR's milestone, it is scheduled for Rust 1.49. It isn't clear to me how to verify whether the Rust 1.49 release will actually contain that fix though. @ralfbiedert and others who are having this issue, could you update Rust Beta to the latest version (presumably, one very close to what will be released as Rust 1.49 final) and report back whether the latest Rust Beta fixes this issue for you? |
FWIW, my team has encountered an issue very similar to this in 1.47, but not 1.46, and only when we're compiling for 64-bit Android targets. This would indicate to me that this isn't a Windows-specific bug. |
The beta channel is now already 1.50.0-beta. Instead you can follow the directions at https://blog.rust-lang.org/inside-rust/2020/12/29/1.49.0-prerelease.html to install the 1.49.0 pre-release. I followed those instructions and built my projects with the 1.49.0 pre-release targeting Android and my build succeeded where previously the same configuration failed with 1.48.0 with |
Ok, I just updated stable via
When I run
Update, |
I managed to hit this same issue with a different crate using To reproduce, check out the Does not reproduce on WSL. Compiles fine on Windows with
It's worth noting that I'm abusing the type system pretty bad. |
I was trying to compile this 3rd party project with
cargo build
when I received anexit code: 0xc000001d, STATUS_ILLEGAL_INSTRUCTION
.Depending on what Rust version I use I get slightly different errors, but I can reproduce the behavior as follows:
cargo build
STATUS_ILLEGAL_INSTRUCTION
cargo +beta build
STATUS_STACK_BUFFER_OVERRUN
cargo +nightly build
STATUS_STACK_BUFFER_OVERRUN
.cargo build --release
cargo +beta build --release
cargo +nightly build --release
cargo check
In other words
--release
builds are fine, while debug builds fail.A failing build that produces a
STATUS_STACK_BUFFER_OVERRUN
looks like this:A build that fails with
STATUS_ILLEGAL_INSTRUCTION
looks similar but outputs this instead at the end:Running
rustc --version --verbose
for my latest stable givesAdditional Info
RUST_BACKTRACE
does not really change anything about that behavior and provides no further insights.cargo clean
does not change anything eitherThe text was updated successfully, but these errors were encountered: