binaryen icon indicating copy to clipboard operation
binaryen copied to clipboard

wasm2js: unhandled unaligned store, UNREACHABLE executed at, Aborted

Open regnaio opened this issue 1 year ago • 3 comments

Trying to run wasm2js on HavokPhysics.wasm in https://github.com/BabylonJS/Babylon.js/tree/master/packages/tools/babylonServer/public/havok

Getting the error:

./wasm2js ../../../Babylon.js/packages/tools/babylonServer/public/havok/HavokPhysics.wasm -o ../../../Babylon.js/packages/tools/babylonServer/public/havok/HavokPhysics.js

unhandled unaligned store
UNREACHABLE executed at /src/src/passes/AlignmentLowering.cpp:334!
Aborted

Using version: https://github.com/WebAssembly/binaryen/releases/tag/version_112 Linux: binaryen-version_112-x86_64-linux.tar.gz

regnaio avatar Apr 25 '23 18:04 regnaio

Looks like the basic types are handled in that switch, so what is likely the problem is that there is an unaligned v128 store, that the pass would need to be updated to handle.

kripken avatar Apr 25 '23 19:04 kripken

I'm sorry, but I'm having the same issue. I'm just new to using Linux, so I have no idea what kripken is talking about, so if he is talking about how to fix it, I can't tell. Can someone please dumb it down for me?

Pokeplays09125 avatar Apr 27 '24 00:04 Pokeplays09125

To fix the problem, we need to write more code in src/passes/AlignmentLowering.cpp around line 334. That code needs to break stores of 16-byte values into multiple stores of 1 byte each.

tlively avatar Apr 27 '24 00:04 tlively