Skip to content

wasm-bindgen's CLI panics with _ZN4FMOD16RuntimeBankModelC2Ev: non-i32 constant #4491

Open
@melody-rs

Description

@melody-rs

Describe the Bug

wasm-bindgen's interpreter chokes on emscripten compiled code. I'm running into this specifically when trying to use FMOD's HTML5 build and using the currently unstable -Zwasm-c-abi=spec flag

[2025-04-28T06:26:40Z DEBUG wasm_bindgen_wasm_interpreter] arguments []
[2025-04-28T06:26:40Z DEBUG wasm_bindgen_wasm_interpreter] starting a call of Id { idx: 26 } Some("__wasm_call_ctors")
[2025-04-28T06:26:40Z DEBUG wasm_bindgen_wasm_interpreter] arguments []
[2025-04-28T06:26:40Z DEBUG wasm_bindgen_wasm_interpreter] starting a call of Id { idx: 1511 } Some("_GLOBAL__sub_I_fmod_bankmodel.cpp")
[2025-04-28T06:26:40Z DEBUG wasm_bindgen_wasm_interpreter] arguments []
[2025-04-28T06:26:40Z DEBUG wasm_bindgen_wasm_interpreter] starting a call of Id { idx: 1399 } Some("_ZN4FMOD16RuntimeBankModelC2Ev")
[2025-04-28T06:26:40Z DEBUG wasm_bindgen_wasm_interpreter] arguments [32768]

thread 'main' panicked at crates/wasm-interpreter/src/lib.rs:245:21:
_ZN4FMOD16RuntimeBankModelC2Ev: non-i32 constant

I'm suspicious of that argument count- [32768] looks to me like a magic value for vaargs

Steps to Reproduce

  1. Clone https://github.com/melody-rs/fmod-oxide
  2. Download FMOD's HTML5 build, and place it in fmod-sys/fmod (fmod-oxide's README goes into more detail)
  3. Run RUSTFLAGS="-Zwasm-c-abi=spec" cargo build -p wasm-unknown --target wasm32-unknown-unknown
  4. Run RUST_LOG=debug wasm-bindgen target/wasm32-unknown-unknown/debug/wasm_unknown.wasm --out-dir out

Additional Context

melody-rs/fmod-oxide#7

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions