-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Dumb bugs are dumb, but still bugs: Huge types generate illegal instructions #55878
Comments
This:
gives a graceful error:
Taking a reference, however, reproduces the illegal instruction:
The LLVM IR for the latter function, by the way, is just a call to |
Backtrace for the miri error:
Looks like |
The problem is the reporting in rust/src/librustc_mir/const_eval.rs Line 693 in d1d79ae
rust/src/librustc/mir/interpret/error.rs Lines 114 to 117 in 8315b11
We should keep reporting these as a hard error if we are in a |
@oli-obk would it make sense to use |
I think we should add a rust/src/librustc/mir/interpret/error.rs Line 107 in 8315b11
RevealAll , we emit the error again?
But yea, as an intermediate step, add |
@oli-obk Removing the early return only for
|
@Centril AFAIK this generates a trap, no UB. Why is this a soundness issue? |
@RalfJung Well I didn't know that then. ;) I typically add I-unsound when I hear "illegal instruction", "segfault", or similar things and then someone can remove the label if they think otherwise + explanation. |
Always error on `SizeOverflow` during mir evaluation Fix rust-lang#55878, fix rust-lang#25116. r? @oli-obk
Always error on `SizeOverflow` during mir evaluation Fix rust-lang#55878, fix rust-lang#25116. r? @oli-obk
Having huge data structures (larger than
u64::MAX
) results in incorrect binaries being built.I tried this code:
I expected this to happen: Output of
Size: 18446744073709551616
, or a compiler error telling me the structure is too bigInstead, this happened: Binary compiled successfully, but running it results in
Illegal instruction (core dumped)
Meta
rustc --version --verbose
The text was updated successfully, but these errors were encountered: