alexcrichton opened issue #3161:
Found via fuzzing last night, feeding this wasm into wasmtime yields:
$ cargo run testcase0.wat --enable-simd Finished dev [unoptimized + debuginfo] target(s) in 0.22s Running `target/debug/wasmtime testcase0.wat --enable-simd` thread '<unnamed>' panicked at 'assertion failed: input_ty == types::I32X4 || output_ty == types::F64X2', cranelift/codegen/src/isa/x64/lower.rs:4587:17 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
abrown commented on issue #3161:
Helpful link to the assertion failure: https://github.com/bytecodealliance/wasmtime/blob/main/cranelift/codegen/src/isa/x64/lower.rs#L4587.
alexcrichton commented on issue #3161:
Reducing this a bit I got three separate panics:
$ cat foo.wat foo1.wat foo2.wat (module (func (result v128) f32.const 0 f32x4.splat i32x4.extend_low_i16x8_u i32x4.extend_low_i16x8_u i32x4.extend_low_i16x8_u f64x2.convert_low_i32x4_u i64x2.extend_high_i32x4_s i32x4.extend_low_i16x8_u i32x4.extend_low_i16x8_u i32x4.extend_low_i16x8_u f32x4.convert_i32x4_u i16x8.extadd_pairwise_i8x16_s) (memory 1) ) (module (func (result v128) f32.const 0 f32x4.splat f32x4.nearest) (memory 1) ) (module (func (result v128) f32.const 0 f32x4.splat f64x2.ceil) (memory 1) ) $ cargo run --features all-arch compile --enable-simd --target x86_64 ./foo.wat Finished dev [unoptimized] target(s) in 0.12s Running `target/debug/wasmtime compile --enable-simd --target x86_64 ./foo.wat` thread 'main' panicked at 'assertion failed: input_ty == types::I32X4 || output_ty == types::F64X2', cranelift/codegen/src/isa/x64/lower.rs:4587:17 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace $ cargo run --features all-arch compile --enable-simd --target x86_64 ./foo1.wat Finished dev [unoptimized] target(s) in 0.12s Running `target/debug/wasmtime compile --enable-simd --target x86_64 ./foo1.wat` thread 'main' panicked at 'unexpected type/opcode types::F32X4/Nearest in Ceil/Floor/Nearest/Trunc', cranelift/codegen/src/isa/x64/lower.rs:5520:26 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace $ cargo run --features all-arch compile --enable-simd --target x86_64 ./foo2.wat Finished dev [unoptimized] target(s) in 0.12s Running `target/debug/wasmtime compile --enable-simd --target x86_64 ./foo2.wat` thread 'main' panicked at 'unexpected type/opcode types::F64X2/Ceil in Ceil/Floor/Nearest/Trunc', cranelift/codegen/src/isa/x64/lower.rs:5520:26 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
alexcrichton labeled issue #3161:
Found via fuzzing last night, feeding this wasm into wasmtime yields:
$ cargo run testcase0.wat --enable-simd Finished dev [unoptimized + debuginfo] target(s) in 0.22s Running `target/debug/wasmtime testcase0.wat --enable-simd` thread '<unnamed>' panicked at 'assertion failed: input_ty == types::I32X4 || output_ty == types::F64X2', cranelift/codegen/src/isa/x64/lower.rs:4587:17 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
alexcrichton labeled issue #3161:
Found via fuzzing last night, feeding this wasm into wasmtime yields:
$ cargo run testcase0.wat --enable-simd Finished dev [unoptimized + debuginfo] target(s) in 0.22s Running `target/debug/wasmtime testcase0.wat --enable-simd` thread '<unnamed>' panicked at 'assertion failed: input_ty == types::I32X4 || output_ty == types::F64X2', cranelift/codegen/src/isa/x64/lower.rs:4587:17 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
alexcrichton labeled issue #3161:
Found via fuzzing last night, feeding this wasm into wasmtime yields:
$ cargo run testcase0.wat --enable-simd Finished dev [unoptimized + debuginfo] target(s) in 0.22s Running `target/debug/wasmtime testcase0.wat --enable-simd` thread '<unnamed>' panicked at 'assertion failed: input_ty == types::I32X4 || output_ty == types::F64X2', cranelift/codegen/src/isa/x64/lower.rs:4587:17 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
abrown commented on issue #3161:
Here's a link for the
Ceil
/Nearest
libcall assertion: https://github.com/bytecodealliance/wasmtime/blob/main/cranelift/codegen/src/isa/x64/lower.rs#L5520.
abrown commented on issue #3161:
For
Ceil
andNearest
it looks like you need to enable SSE4.1... is it--target "x86_64 nehalem"
or something like that?
abrown edited a comment on issue #3161:
For
Ceil
andNearest
it looks like you need to enable SSE4.1... is it--target "x86_64 nehalem"
or something like that? (That's the type of thing I would have to do using the Cranelift CLI).
jlb6740 commented on issue #3161:
This is asserting on a recent patch. Am I reading this correct, the input to i16x8.extadd_pairwise_i8x16_s is f32x4.convert_i32x4_u here?
abrown commented on issue #3161:
(That's the type of thing I would have to do using the Cranelift CLI).
But this highlights that we might want to have a better default feature baseline in the Wasmtime CLI. SSE4.1 is very, very common.
alexcrichton commented on issue #3161:
Er yes looks like my reduction went astray, I was assuming the target features didn't matter for the panics I was seeing. I've hidden my comment to avoid distractions, and the re-reduction is:
(module (func (result i32) v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000 i32x4.extend_low_i16x8_u f32x4.convert_i32x4_u i8x16.extract_lane_s 10))
alexcrichton edited a comment on issue #3161:
Er yes looks like my reduction went astray, I was assuming the target features didn't matter for the panics I was seeing. I've hidden my comment to avoid distractions, and the re-reduction is:
(module (func (result i32) v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000 i32x4.extend_low_i16x8_u f32x4.convert_i32x4_u i8x16.extract_lane_s 10))
jlb6740 commented on issue #3161:
This is something I recently wrote. There is tension here between the strictness of our assertions for cranelift instructions versus what the wasm spec says is allowed.
jlb6740 commented on issue #3161:
I think the assert line highlighted can be removed.
jlb6740 assigned issue #3161 (assigned to jlb6740):
Found via fuzzing last night, feeding this wasm into wasmtime yields:
$ cargo run testcase0.wat --enable-simd Finished dev [unoptimized + debuginfo] target(s) in 0.22s Running `target/debug/wasmtime testcase0.wat --enable-simd` thread '<unnamed>' panicked at 'assertion failed: input_ty == types::I32X4 || output_ty == types::F64X2', cranelift/codegen/src/isa/x64/lower.rs:4587:17 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
alexcrichton commented on issue #3161:
Fixed in #3209, so closing.
alexcrichton closed issue #3161 (assigned to jlb6740):
Found via fuzzing last night, feeding this wasm into wasmtime yields:
$ cargo run testcase0.wat --enable-simd Finished dev [unoptimized + debuginfo] target(s) in 0.22s Running `target/debug/wasmtime testcase0.wat --enable-simd` thread '<unnamed>' panicked at 'assertion failed: input_ty == types::I32X4 || output_ty == types::F64X2', cranelift/codegen/src/isa/x64/lower.rs:4587:17 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Last updated: Nov 22 2024 at 16:03 UTC