Skip to content

SIMD [iu]8xN tests SIGILL in --release #88769

Description

@workingjubilee

Hello, we have encountered an issue in the portable-simd CI unique to tests on our i8xN and u8xN types on x86_64. It emits a SIGTRAP, or sometimes a SIGILL, or on Windows, a STATUS_ACCESS_VIOLATION! How exciting! I can reproduce this locally. Our other tests do not do this, and it only happens in --release, so I suspect this is a miscompilation by LLVM 13 inappropriately optimizing something. Full command to repro: cargo test --release --test [iu]8_ops

I am going to try to minimize this from "literally the entire test suite" but I might take a bit. The issue became apparent about 7 days ago. Tests were passing about 2030 days ago (August 818) judging by the last green in rust-lang/portable-simd#155. I believe the time frame is correct for this to have been due to #87570

More minutiae

RUSTFLAGS="-Copt-level=1" passes with the above tests.
RUSTFLAGS="-Copt-level=2" crashes with them.

Version it worked on

It most recently worked on: Rust 1.56 nightly (2021-07-17)

Version with regression

rustc --version --verbose:

rustc 1.57.0-nightly (fdf65053e 2021-09-07)
binary: rustc
commit-hash: fdf65053e99e8966f9bd83b5a8491326cb33d638
commit-date: 2021-09-07
host: x86_64-pc-windows-msvc
release: 1.57.0-nightly
LLVM version: 13.0.0

but it also happened on rustc 1.57.0-nightly 2021-09-01

Sample Crash

Caused by:
process didn't exit successfully: rustc --crate-name i8_ops --edition=2018 crates/core_simd/tests/i8_ops.rs --error-format=json --json=diagnostic-rendered-ansi --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no --test --cfg 'feature="default"' --cfg 'feature="generic_const_exprs"' --cfg 'feature="std"' -C metadata=1cde5fc9e82e90f1 -C extra-filename=-1cde5fc9e82e90f1 --out-dir /home/runner/work/portable-simd/portable-simd/target/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/home/runner/work/portable-simd/portable-simd/target/x86_64-unknown-linux-gnu/release/deps -L dependency=/home/runner/work/portable-simd/portable-simd/target/release/deps --extern core_simd=/home/runner/work/portable-simd/portable-simd/target/x86_64-unknown-linux-gnu/release/deps/libcore_simd-4b00e5b4ae8d8fde.rlib --extern proptest=/home/runner/work/portable-simd/portable-simd/target/x86_64-unknown-linux-gnu/release/deps/libproptest-31d0a88e0e450c3e.rlib --extern test_helpers=/home/runner/work/portable-simd/portable-simd/target/x86_64-unknown-linux-gnu/release/deps/libtest_helpers-14b4f1f175a370d0.rlib --extern wasm_bindgen_test=/home/runner/work/portable-simd/portable-simd/target/x86_64-unknown-linux-gnu/release/deps/libwasm_bindgen_test-52095b4799b0069f.rlib (signal: 5, SIGTRAP: trace/breakpoint trap)
warning: build failed, waiting for other jobs to finish...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-SIMDArea: SIMD (Single Instruction Multiple Data)C-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.I-monomorphizationIssue: An error at monomorphization time.PG-portable-simdProject group: Portable SIMD (https://github.com/rust-lang/project-portable-simd)requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions