Skip to content

externref changes in Rust 1.82/wasm-bindgen 0.2.95 broke some usages #2

@gbj

Description

@gbj

This bug occurs with:

  • rustc 1.82 or later, and
  • wasm-bindgen 0.2.95 or later

It does not occur with rustc 1.81 or with wasm-bindgen 0.2.93.

With current versions if you run build.py and click either button, you get an error like:

gzip.wasm:0x53d5 Uncaught RuntimeError: null function or function signature mismatch
    at _ZN12wasm_bindgen21__wbindgen_string_new17h34635f42ec3f8243E (gzip.wasm:0x53d5)
    at __wasm_split_00gzip00_export_20d6a7f0f88943de7b336e5e40732cad_get_gzip_decoder (gzip.wasm:0x348)
    at __wasm_split_00gzip00_export_20d6a7f0f88943de7b336e5e40732cad_get_gzip_decoder (main_bg.wasm:0x102bd)
    at _ZN20wasm_bindgen_futures17future_to_promise28_$u7b$$u7b$closure$u7d$$u7d$28_$u7b$$u7b$closure$u7d$$u7d$17h98255a77f8bf9146E (main_bg.wasm:0x2489)
    at _ZN20wasm_bindgen_futures5queue10QueueState7run_all17h810a685d939e3cd5E (main_bg.wasm:0x94a9)
    at _ZN20wasm_bindgen_futures5queue5Queue3new28_$u7b$$u7b$closure$u7d$$u7d$17h86f17381260997ddE (main_bg.wasm:0xf9be)
    at _ZN136_$LT$dyn$u20$core..ops..function..FnMut$LT$$LP$A$C$$RP$$GT$$u2b$Output$u20$$u3d$$u20$R$u20$as$u20$wasm_bindgen..closure..WasmClosure$GT$8describe6invoke17hd495452de4bc2c45E (main_bg.wasm:0xf9b0)
    at closure112 externref shim (main_bg.wasm:0xff5e)
    at __wbg_adapter_28 (main.js:225:10)
    at real (main.js:134:20)

I assume this is due to the changes introduced in 1.82 that enabled externref by default, and which changed the binary encoding of call_indirect.

This is a bit over my head, so I'm hoping you can point me to the right place to look in wasm_split_cli to update it to the new convention.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions