Skip to content

Debugging "local.set type must match function" validation errors #2177

@rth

Description

@rth

I'm trying to dynamically link the BLAS/LAPACK libraries for scipy (Python) in pyodide (pyodide/pyodide#473) and am getting the following validation errors in asm2wasm,

[wasm-validator error in function $_wsdot_] 4 != 3: set_local type must match function, on 
[none] (set_local $5
 [f32] (f32.demote/f64
  [f64] (call $_sdot_)
 )
)
[wasm-validator error in function $_wsnrm2_] 4 != 3: local.set type must match function, on
[none] (local.set $3
 [f32] (f32.demote_f64
  [f64] (call $_snrm2_)
 )
)

which is raised in src/wasm/wasm-validator.cpp here.

The command executed internally by emcc was,

emsdk/binaryen/tag-1.38.30_64bit_binaryen/bin/asm2wasm build/lib.linux-x86_64-3.7/scipy/linalg/_fblas.cpython-37m-x86
_64-linux-gnu.temp.asm.js --total-memory=16777216 --trap-mode=clamp -O3 --mem-init=build/lib.linux-x86_64-3.7/scipy/linalg/_fblas.cpython-37m-x
86_64-linux-gnu.wasm.mem --table-max=-1 --mem-max=-1 -g -o build/lib.linux-x86_64-3.7/scipy/linalg/_fblas.cpython-37m-x86_64-linux-gnu.wast -S 
--mvp-features

If I link those same files statically no error is raised.

Any suggestions would be very much appreciated, so far I don't even understand what 4 != 3 failed condition implies. I haven't seen any existing user reports on this topic in the emscripten repository either.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions