-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
possible ASAN miscompile #121028
Comments
I don't know -- the symptoms look different, but UB could have the same root cause.
Is that a specific bisected date, or just one that you happened to try? |
|
This does look the same as #75839 to me. We really shouldn't be generating aggregate loads like that. |
I think the load is generated here: rust/compiler/rustc_codegen_ssa/src/mir/block.rs Lines 436 to 437 in bb89df6
|
Eh, I meant this one: rust/compiler/rustc_codegen_ssa/src/mir/block.rs Lines 1402 to 1403 in bb89df6
The above is for returns rather than argument passing -- though it probably has the same/similar issue. |
@rustbot label +requires-nightly +A-sanitizers +T-compiler +C-optimization -needs-triage |
Rust lint output from this testcase:
|
Duplicate of #75839. |
Use the aligned size for alloca at args/ret when the pass mode is cast Fixes rust-lang#75839. Fixes rust-lang#121028. The `load` and `store` instructions in LLVM access the aligned size. For example, `load { i64, i32 }` accesses 16 bytes on x86_64: https://alive2.llvm.org/ce/z/n8CHAp. BTW, this example is expected to be optimized to immediate UB by Alive2: https://rust.godbolt.org/z/b7xK7hv1c and https://alive2.llvm.org/ce/z/vZDtZH. r? compiler
Rollup merge of rust-lang#127168 - DianQK:cast-size, r=workingjubilee Use the aligned size for alloca at args/ret when the pass mode is cast Fixes rust-lang#75839. Fixes rust-lang#121028. The `load` and `store` instructions in LLVM access the aligned size. For example, `load { i64, i32 }` accesses 16 bytes on x86_64: https://alive2.llvm.org/ce/z/n8CHAp. BTW, this example is expected to be optimized to immediate UB by Alive2: https://rust.godbolt.org/z/b7xK7hv1c and https://alive2.llvm.org/ce/z/vZDtZH. r? compiler
I tried this code with ASAN nightly rust (https://godbolt.org/z/KE6P9xYsY):
I expected to see this happen: program executes successfully.
Instead, this happened: program failed with ASAN warning.
Meta
Requires nightly with
-Zsanitizer=address --target x86_64-unknown-linux-gnu -Copt-level=0
: https://godbolt.org/z/KE6P9xYsY.It looks this is not a recent regression, it's present in rust from 2021.
The text was updated successfully, but these errors were encountered: