Stream: git-wasmtime

Topic: wasmtime / Issue #1403 wasmtime-debug assertion failure


view this post on Zulip Wasmtime GitHub notifications bot (Mar 25 2020 at 19:06):

abrown labeled Issue #1403:

cargo run --bin wasmtime -- run -g --enable-simd --disable-cache /codecbench-simd.wasm

thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `1`,
 right: `0`', crates/debug/src/transform/expression.rs:330:13
stack backtrace:
...
12: std::panicking::begin_panic_fmt
             at src/libstd/panicking.rs:326
  13: wasmtime_debug::transform::expression::compile_expression
             at crates/debug/src/transform/expression.rs:330
  14: wasmtime_debug::transform::unit::clone_unit
             at crates/debug/src/transform/unit.rs:302
  15: wasmtime_debug::transform::transform_dwarf
             at crates/debug/src/transform/mod.rs:90
  16: wasmtime_debug::emit_debugsections_image
             at crates/debug/src/lib.rs:82
  17: wasmtime_jit::compiler::Compiler::compile
             at crates/jit/src/compiler.rs:215
  18: wasmtime_jit::instantiate::RawCompiledModule::new
             at crates/jit/src/instantiate.rs:83

https://github.com/abrown/wasmtime/tree/additional-i8x16-shift

I built the attached Wasm file with /opt/wasi-sdk/bin/clang++ tools/codecbench.cpp src/vertexcodec.cpp src/vertexfilter.cpp src/overdrawanalyzer.cpp src/indexgenerator.cpp src/vcacheoptimizer.cpp src/indexcodec.cpp src/vfetchanalyzer.cpp src/spatialorder.cpp src/clusterizer.cpp src/allocator.cpp src/vcacheanalyzer.cpp src/vfetchoptimizer.cpp src/overdrawoptimizer.cpp src/simplifier.cpp src/stripifier.cpp -O3 -DNDEBUG -g -fno-exceptions -Wl,--initial-memory=268435456 -msimd128 -o codecbench-simd.wasm

codecbench-simd.txt

view this post on Zulip Wasmtime GitHub notifications bot (Mar 25 2020 at 19:06):

abrown opened Issue #1403:

cargo run --bin wasmtime -- run -g --enable-simd --disable-cache /codecbench-simd.wasm

thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `1`,
 right: `0`', crates/debug/src/transform/expression.rs:330:13
stack backtrace:
...
12: std::panicking::begin_panic_fmt
             at src/libstd/panicking.rs:326
  13: wasmtime_debug::transform::expression::compile_expression
             at crates/debug/src/transform/expression.rs:330
  14: wasmtime_debug::transform::unit::clone_unit
             at crates/debug/src/transform/unit.rs:302
  15: wasmtime_debug::transform::transform_dwarf
             at crates/debug/src/transform/mod.rs:90
  16: wasmtime_debug::emit_debugsections_image
             at crates/debug/src/lib.rs:82
  17: wasmtime_jit::compiler::Compiler::compile
             at crates/jit/src/compiler.rs:215
  18: wasmtime_jit::instantiate::RawCompiledModule::new
             at crates/jit/src/instantiate.rs:83

https://github.com/abrown/wasmtime/tree/additional-i8x16-shift

I built the attached Wasm file with /opt/wasi-sdk/bin/clang++ tools/codecbench.cpp src/vertexcodec.cpp src/vertexfilter.cpp src/overdrawanalyzer.cpp src/indexgenerator.cpp src/vcacheoptimizer.cpp src/indexcodec.cpp src/vfetchanalyzer.cpp src/spatialorder.cpp src/clusterizer.cpp src/allocator.cpp src/vcacheanalyzer.cpp src/vfetchoptimizer.cpp src/overdrawoptimizer.cpp src/simplifier.cpp src/stripifier.cpp -O3 -DNDEBUG -g -fno-exceptions -Wl,--initial-memory=268435456 -msimd128 -o codecbench-simd.wasm

codecbench-simd.txt

view this post on Zulip Wasmtime GitHub notifications bot (Mar 25 2020 at 19:08):

abrown edited Issue #1403:

cargo run -- run -g --enable-simd --disable-cache codecbench-simd.wasm (see attached file at bottom)

thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `1`,
 right: `0`', crates/debug/src/transform/expression.rs:330:13
stack backtrace:
...
12: std::panicking::begin_panic_fmt
             at src/libstd/panicking.rs:326
  13: wasmtime_debug::transform::expression::compile_expression
             at crates/debug/src/transform/expression.rs:330
  14: wasmtime_debug::transform::unit::clone_unit
             at crates/debug/src/transform/unit.rs:302
  15: wasmtime_debug::transform::transform_dwarf
             at crates/debug/src/transform/mod.rs:90
  16: wasmtime_debug::emit_debugsections_image
             at crates/debug/src/lib.rs:82
  17: wasmtime_jit::compiler::Compiler::compile
             at crates/jit/src/compiler.rs:215
  18: wasmtime_jit::instantiate::RawCompiledModule::new
             at crates/jit/src/instantiate.rs:83

https://github.com/abrown/wasmtime/tree/additional-i8x16-shift

I built the attached Wasm file with /opt/wasi-sdk/bin/clang++ tools/codecbench.cpp src/vertexcodec.cpp src/vertexfilter.cpp src/overdrawanalyzer.cpp src/indexgenerator.cpp src/vcacheoptimizer.cpp src/indexcodec.cpp src/vfetchanalyzer.cpp src/spatialorder.cpp src/clusterizer.cpp src/allocator.cpp src/vcacheanalyzer.cpp src/vfetchoptimizer.cpp src/overdrawoptimizer.cpp src/simplifier.cpp src/stripifier.cpp -O3 -DNDEBUG -g -fno-exceptions -Wl,--initial-memory=268435456 -msimd128 -o codecbench-simd.wasm

codecbench-simd.txt

view this post on Zulip Wasmtime GitHub notifications bot (Mar 25 2020 at 19:10):

abrown commented on Issue #1403:

I think it is important to note that if I don't build codecbench-simd.wasm with clang++ ... -g ... then I get the following:

$ cargo run -- run -g --enable-simd --disable-cache ../meshoptimizer/codecbench-simd.wasm
    Finished dev [unoptimized + debuginfo] target(s) in 0.07s
     Running `target/debug/wasmtime run -g --enable-simd --disable-cache ../meshoptimizer/codecbench-simd.wasm`
source: vertex data 32064032 bytes, index data 24000000 bytes
pass 0: vertex data 18518385 bytes, index data 2332680 bytes
Error: failed to run main module `../meshoptimizer/codecbench-simd.wasm`

Caused by:
    0: failed to invoke `_start`
    1: wasm trap: out of bounds memory access, source location: @22a4
       wasm backtrace:
         0: <unknown>!meshopt::decodeVertexBlockSimd(unsigned char const*, unsigned char const*, unsigned char*, unsigned long, unsigned long, unsigned char*)
         1: <unknown>!meshopt_decodeVertexBuffer
         2: <unknown>!benchCodecs(std::__2::vector<Vertex, std::__2::allocator<Vertex> > const&, std::__2::vector<unsigned int, std::__2::allocator<unsigned int> > const&)
         3: <unknown>!__original_main
         4: <unknown>!_start

Where the Wasm code for that offset is:

$ wasm-objdump -d ../meshoptimizer/codecbench-simd.wasm | grep -B5 -A5 22a4
 002297: fd 06 00                   |                     i8x16.extract_lane_u 0
 00229a: 6a                         |                     i32.add
 00229b: 20 17                      |                     local.get 23
 00229d: 41 f0 b0 80 80 00          |                     i32.const 6256
 0022a3: 6a                         |                     i32.add
>0022a4: 2d 00 00                   |                     i32.load8_u 0 0
 0022a7: 6a                         |                     i32.add
 0022a8: 21 00                      |                     local.set 0
 0022aa: 0c 02                      |                     br 2
 0022ac: 0b                         |                   end
 0022ad: 20 0f                      |                   local.get 15

view this post on Zulip Wasmtime GitHub notifications bot (Mar 25 2020 at 19:15):

abrown edited a comment on Issue #1403:

I think it is important to note that if I don't build codecbench-simd.wasm without clang++ ... -g ... then I get the following:

$ cargo run -- run -g --enable-simd --disable-cache ../meshoptimizer/codecbench-simd.wasm
    Finished dev [unoptimized + debuginfo] target(s) in 0.07s
     Running `target/debug/wasmtime run -g --enable-simd --disable-cache ../meshoptimizer/codecbench-simd.wasm`
source: vertex data 32064032 bytes, index data 24000000 bytes
pass 0: vertex data 18518385 bytes, index data 2332680 bytes
Error: failed to run main module `../meshoptimizer/codecbench-simd.wasm`

Caused by:
    0: failed to invoke `_start`
    1: wasm trap: out of bounds memory access, source location: @22a4
       wasm backtrace:
         0: <unknown>!meshopt::decodeVertexBlockSimd(unsigned char const*, unsigned char const*, unsigned char*, unsigned long, unsigned long, unsigned char*)
         1: <unknown>!meshopt_decodeVertexBuffer
         2: <unknown>!benchCodecs(std::__2::vector<Vertex, std::__2::allocator<Vertex> > const&, std::__2::vector<unsigned int, std::__2::allocator<unsigned int> > const&)
         3: <unknown>!__original_main
         4: <unknown>!_start

Where the Wasm code for that offset is:

$ wasm-objdump -d ../meshoptimizer/codecbench-simd.wasm | grep -B5 -A5 22a4
 002297: fd 06 00                   |                     i8x16.extract_lane_u 0
 00229a: 6a                         |                     i32.add
 00229b: 20 17                      |                     local.get 23
 00229d: 41 f0 b0 80 80 00          |                     i32.const 6256
 0022a3: 6a                         |                     i32.add
>0022a4: 2d 00 00                   |                     i32.load8_u 0 0
 0022a7: 6a                         |                     i32.add
 0022a8: 21 00                      |                     local.set 0
 0022aa: 0c 02                      |                     br 2
 0022ac: 0b                         |                   end
 0022ad: 20 0f                      |                   local.get 15

view this post on Zulip Wasmtime GitHub notifications bot (Mar 25 2020 at 19:17):

abrown edited a comment on Issue #1403:

I think it is important to note that if I build codecbench-simd.wasm __without__ clang++ ... -g ... then I get the following:

$ cargo run -- run -g --enable-simd --disable-cache ../meshoptimizer/codecbench-simd.wasm
    Finished dev [unoptimized + debuginfo] target(s) in 0.07s
     Running `target/debug/wasmtime run -g --enable-simd --disable-cache ../meshoptimizer/codecbench-simd.wasm`
source: vertex data 32064032 bytes, index data 24000000 bytes
pass 0: vertex data 18518385 bytes, index data 2332680 bytes
Error: failed to run main module `../meshoptimizer/codecbench-simd.wasm`

Caused by:
    0: failed to invoke `_start`
    1: wasm trap: out of bounds memory access, source location: @22a4
       wasm backtrace:
         0: <unknown>!meshopt::decodeVertexBlockSimd(unsigned char const*, unsigned char const*, unsigned char*, unsigned long, unsigned long, unsigned char*)
         1: <unknown>!meshopt_decodeVertexBuffer
         2: <unknown>!benchCodecs(std::__2::vector<Vertex, std::__2::allocator<Vertex> > const&, std::__2::vector<unsigned int, std::__2::allocator<unsigned int> > const&)
         3: <unknown>!__original_main
         4: <unknown>!_start

Where the Wasm code for that offset is:

$ wasm-objdump -d ../meshoptimizer/codecbench-simd.wasm | grep -B5 -A5 22a4
 002297: fd 06 00                   |                     i8x16.extract_lane_u 0
 00229a: 6a                         |                     i32.add
 00229b: 20 17                      |                     local.get 23
 00229d: 41 f0 b0 80 80 00          |                     i32.const 6256
 0022a3: 6a                         |                     i32.add
>0022a4: 2d 00 00                   |                     i32.load8_u 0 0
 0022a7: 6a                         |                     i32.add
 0022a8: 21 00                      |                     local.set 0
 0022aa: 0c 02                      |                     br 2
 0022ac: 0b                         |                   end
 0022ad: 20 0f                      |                   local.get 15

view this post on Zulip Wasmtime GitHub notifications bot (Mar 25 2020 at 21:03):

yurydelendik closed Issue #1403:

cargo run -- run -g --enable-simd --disable-cache codecbench-simd.wasm (see attached file at bottom)

thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `1`,
 right: `0`', crates/debug/src/transform/expression.rs:330:13
stack backtrace:
...
12: std::panicking::begin_panic_fmt
             at src/libstd/panicking.rs:326
  13: wasmtime_debug::transform::expression::compile_expression
             at crates/debug/src/transform/expression.rs:330
  14: wasmtime_debug::transform::unit::clone_unit
             at crates/debug/src/transform/unit.rs:302
  15: wasmtime_debug::transform::transform_dwarf
             at crates/debug/src/transform/mod.rs:90
  16: wasmtime_debug::emit_debugsections_image
             at crates/debug/src/lib.rs:82
  17: wasmtime_jit::compiler::Compiler::compile
             at crates/jit/src/compiler.rs:215
  18: wasmtime_jit::instantiate::RawCompiledModule::new
             at crates/jit/src/instantiate.rs:83

https://github.com/abrown/wasmtime/tree/additional-i8x16-shift

I built the attached Wasm file with /opt/wasi-sdk/bin/clang++ tools/codecbench.cpp src/vertexcodec.cpp src/vertexfilter.cpp src/overdrawanalyzer.cpp src/indexgenerator.cpp src/vcacheoptimizer.cpp src/indexcodec.cpp src/vfetchanalyzer.cpp src/spatialorder.cpp src/clusterizer.cpp src/allocator.cpp src/vcacheanalyzer.cpp src/vfetchoptimizer.cpp src/overdrawoptimizer.cpp src/simplifier.cpp src/stripifier.cpp -O3 -DNDEBUG -g -fno-exceptions -Wl,--initial-memory=268435456 -msimd128 -o codecbench-simd.wasm

codecbench-simd.txt


Last updated: Oct 23 2024 at 20:03 UTC