Skip to content
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

STATUS_ACCESS_VIOLATION when cross-compiling for nightly-2024-02-19-aarch64-pc-windows-msvc when compiling num-traits #121367

Closed
chyyran opened this issue Feb 20, 2024 · 2 comments · Fixed by #121395
Assignees
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. llvm-fixed-upstream Issue expected to be fixed by the next major LLVM upgrade

Comments

@chyyran
Copy link

chyyran commented Feb 20, 2024

Minimal reproducible example

fn main() {
    println!("Hello, world!");
}
[package]
name = "min-test"
version = "0.1.0"
edition = "2021"

[dependencies]
num-traits = "0.2.18"

cargo build --target aarch64-pc-windows-msvc

I expected to see this happen:
cargo builds the example

Instead, this happened:

PS F:\coding\min-test> cargo build --target aarch64-pc-windows-msvc                                             
   Compiling autocfg v1.1.0
   Compiling num-traits v0.2.18                                                                                                                                                                                                                                                                                                                                                                                                    
error: could not compile `num-traits` (lib)                                                                                                                                                                                                                                                                                                                                                                                        

Caused by:
  process didn't exit successfully: `rustc --crate-name num_traits --edition=2018 D:\Runtime\Rust\cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.18\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=419 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg "feature=\"default\"" --cfg "feature=\"std\"" -C met
adata=30bc9611b16064ab -C extra-filename=-30bc9611b16064ab --out-dir F:\coding\min-test\target\aarch64-pc-windows-msvc\debug\deps --target aarch64-pc-windows-msvc -L dependency=F:\coding\min-test\target\aarch64-pc-windows-msvc\debug\deps -L dependency=F:\coding\min-test\target\debug\deps --cap-lints allow --cfg has_to_int_unchecked --cfg has_reverse_bits --cfg has_leading_trailing_ones --cfg has_div_euclid --cfg has_copysign --cfg has_is_subnormal --cfg has_total_cmp --cfg has_int_to_from_bytes --cfg has_float_to_from_bytes` (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION)

The last working compiler that I've tried was nightly-2024-01-15-aarch64-pc-windows-msvc. I haven't attempted to bisect since then so there could be some compilers working after 2024-01-15.

rustc 1.78.0-nightly (3246e7951 2024-02-19)
binary: rustc
commit-hash: 3246e79513cb89ddbfc0f21cb5a877e5b321dcc5
commit-date: 2024-02-19
host: x86_64-pc-windows-msvc
release: 1.78.0-nightly
LLVM version: 18.1.0
@chyyran chyyran added the C-bug Category: This is a bug. label Feb 20, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 20, 2024
@chyyran chyyran changed the title STATUS_ACCESS_VIOLATION on nightly-2024-02-19-aarch64-pc-windows-msvc when compiling num-traits STATUS_ACCESS_VIOLATION when cross-compiling for nightly-2024-02-19-aarch64-pc-windows-msvc when compiling num-traits Feb 21, 2024
@nikic nikic added I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Feb 21, 2024
@nikic
Copy link
Contributor

nikic commented Feb 21, 2024

Reduced:

; RUN: llc -O0 < %s
target triple = "aarch64-pc-windows-msvc"

define float @test(float %x, i32 %n) {
  %res = call float @llvm.powi.f32.i32(float %x, i32 %n)
  ret float %res
}

declare float @llvm.powi.f32.i32(float, i32)

Does not reproduce on LLVM trunk.

@nikic nikic self-assigned this Feb 21, 2024
@nikic nikic added the llvm-fixed-upstream Issue expected to be fixed by the next major LLVM upgrade label Feb 21, 2024
@nikic
Copy link
Contributor

nikic commented Feb 21, 2024

Fixed by llvm/llvm-project@47c65cf and already backported upstream.

bors added a commit to rust-lang-ci/rust that referenced this issue Feb 21, 2024
bors added a commit to rust-lang-ci/rust that referenced this issue Feb 22, 2024
bors added a commit to rust-lang-ci/rust that referenced this issue Feb 22, 2024
bors added a commit to rust-lang-ci/rust that referenced this issue Feb 22, 2024
bors added a commit to rust-lang-ci/rust that referenced this issue Feb 24, 2024
bors added a commit to rust-lang-ci/rust that referenced this issue Mar 1, 2024
@bors bors closed this as completed in e612d07 Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. llvm-fixed-upstream Issue expected to be fixed by the next major LLVM upgrade
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants