Wasmer: RuntimeError with Trap(StackOverflow) on Windows+singlepass

Created on 5 Dec 2020  路  4Comments  路  Source: wasmerio/wasmer

Describe the bug

We're currently using Wasmer as a library using singlepass (master at 5937b37064) and experience errors on Windows that do not occur on Linux/Mac in the same setup.

---- proper_initialization stdout ----
thread 'proper_initialization' panicked at 'VM error: RuntimeErr { msg: "Wasmer runtime error: RuntimeError { source: Trap(StackOverflow), wasm_trace: [], native_trace:    0: <unknown>\n   1: <unknown>\n   2: <unknown>\n   3: <unknown>\n   4: <unknown>\n   5: <unknown>\n   6: <unknown>\n   7: <unknown>\n   8: <unknown>\n   9: <unknown>\n  10: <unknown>\n  11: <unknown>\n  12: <unknown>\n  13: <unknown>\n  14: <unknown>\n  15: <unknown>\n  16: <unknown>\n  17: <unknown>\n  18: <unknown>\n  19: <unknown>\n  20: <unknown>\n  21: <unknown>\n  22: <unknown>\n  23: <unknown>\n  24: <unknown>\n  25: <unknown>\n  26: <unknown>\n  27: <unknown>\n  28: <unknown>\n  29: <unknown>\n  30: <unknown>\n  31: <unknown>\n  32: <unknown>\n  33: <unknown>\n  34: <unknown>\n  35: <unknown>\n  36: <unknown>\n  37: <unknown>\n  38: <unknown>\n  39: <unknown>\n  40: <unknown>\n  41: <unknown>\n  42: <unknown>\n  43: <unknown>\n  44: <unknown>\n  45: <unknown>\n  46: <unknown>\n  47: <unknown>\n  48: <unknown>\n  49: <unknown>\n  50: <unknown>\n  51: <unknown>\n  52: <unknown>\n  53: <unknown>\n  54: <unknown>\n  55: <unknown>\n  56: <unknown>\n  57: <unknown>\n  58: <unknown>\n  59: <unknown>\n  60: <unknown>\n  61: <unknown>\n  62: <unknown>\n  63: <unknown>\n  64: <unknown>\n  65: <unknown>\n  66: <unknown>\n  67: <unknown>\n  68: <unknown>\n  69: <unknown>\n  70: <unknown>\n }" }', D:\a\cosmwasm\cosmwasm\packages\vm\src\testing\calls.rs:34:55
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39\/library\std\src\panicking.rs:475
   1: core::panicking::panic_fmt
             at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39\/library\core\src\panicking.rs:85
   2: core::option::expect_none_failed
             at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39\/library\core\src\option.rs:1221
   3: core::result::Result<cosmwasm_std::results::contract_result::ContractResult<cosmwasm_std::results::init::InitResponse<cosmwasm_std::types::Empty>>, cosmwasm_vm::errors::vm_error::VmError>::expect<cosmwasm_std::results::contract_result::ContractResult<cosm
             at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39\library\core\src\result.rs:933
   4: cosmwasm_vm::testing::calls::init<cosmwasm_vm::testing::storage::MockStorage,cosmwasm_vm::testing::mock::MockApi,cosmwasm_vm::testing::querier::MockQuerier<cosmwasm_std::types::Empty>,hackatom::contract::InitMsg,cosmwasm_std::types::Empty>
             at D:\a\cosmwasm\cosmwasm\packages\vm\src\testing\calls.rs:34
   5: integration::proper_initialization
             at .\tests\integration.rs:69
   6: integration::proper_initialization::{{closure}}
             at .\tests\integration.rs:51
   7: core::ops::function::FnOnce::call_once<closure-0,tuple<>>
             at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39\library\core\src\ops\function.rs:227
   8: core::ops::function::FnOnce::call_once
             at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39\library\core\src\ops\function.rs:227

Steps to reproduce

  1. Check out https://github.com/CosmWasm/cosmwasm/pull/504
  2. cd contracts/hackatom && cargo wasm && cargo integration-test

or simply look into the GitHub Actions job "Contract Development / Windows (pull_request)"

Expected behavior

Tests pass (as they do on Linux and Mac)

Actual behavior

All tests fail with an error message very similar to the one above.

Additional context

The newly identified problems were detected by adding Windows CI testing to our migration PR.

馃悶 bug

Most helpful comment

We don't yet support singlepass on Windows. The calling convention is a bit different than what the compilers use internally.

Here's a list of what's supported in the different compilers:
https://docs.wasmer.io/ecosystem/wasmer/wasmer-features

All 4 comments

We don't yet support singlepass on Windows. The calling convention is a bit different than what the compilers use internally.

Here's a list of what's supported in the different compilers:
https://docs.wasmer.io/ecosystem/wasmer/wasmer-features

I see, thank you. What do you think about panicking with a helpful message when instantiating Singlepass on Windows? This could avoid some debugging and support time on both sides.

Yeah, that would be a great idea! We can have a simple check in the compile_module that returns an Error if it's Windows.

Was this page helpful?
0 / 5 - 0 ratings