You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[WASM Exception]: WasmOffsetConverter fails with: bad import kind: 12 #18592
$ em++ liblib.cpp -o liblib.so -g -sASSERTIONS -sSIDE_MODULE -O0 -fwasm-exceptions -sENVIRONMENT=shell
$ em++ main.cpp -o main.js -sMAIN_MODULE=2 -O0 -fwasm-exceptions -sASSERTIONS liblib.so -sENVIRONMENT=shell
$ d8 main.jsaheejin@aheejin:~/test/stack/dylink$ d8 main.jsexiting due to exception: [object WebAssembly.Exception],Error: int, at wasm://wasm/00073456:wasm-function[149]:0xb639 at side_throw() (wasm://wasm/6d51dda6:wasm-function[4]:0x140) at __Z10side_throwv (main.js:2069:41) at wasm://wasm/00073456:wasm-function[12]:0x525a at wasm://wasm/00073456:wasm-function[13]:0x5277 at callMain (main.js:5050:15) at doRun (main.js:5118:23) at run (main.js:5133:5) at runCaller (main.js:5024:19)
Activity
sbc100 commentedon Jan 25, 2023
I guess we must not have any testing of that particular configuration. We should fix that.
aheejin commentedon Feb 3, 2023
Can you provide a reproducer? I did a simple test but it seemed working. What I did was:
main.cpp:liblib.cpp:gl84 commentedon Feb 3, 2023
I've created a small repro case:
reader.hpp:
reader.cpp:
exported_api.cpp:
Compile it with:
em++ -fPIC -o lib.so -sSIDE_MODULE=2 -sEXPORTED_FUNCTIONS=[_ZN6readerD1Ev] -fwasm-exceptions reader.cppem++ -fwasm-exceptions -o exported_api.cpp.o -c exported_api.cppem++ -fsanitize=null -sMAIN_MODULE=2 -sASSERTIONS=2 -sEXPORTED_FUNCTIONS=_main -fwasm-exceptions exported_api.cpp.o -o exported_api.js lib.soand execute it.
Fix tag import parsing in WasmOffsetConverter