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
When readAheadLocalGetIfExists reads ahead in computeExprResultPosition it can encounter unknown / unsupported bytecodes; 0x1f in this specific case.
When it looks for a local.set code ahead, and finds one, it uses this data to index into a vector (m_localInfo) that is empty, causing a Segmentation Fault.
Surrounding bytes when inspected when stopped with the debugger (using lookaheadUnsigned8()):
The problem is, it uses an unsupported byte code, called try_table. The wabt will catch this, but the byte prescanning (readAheadLocalGetIfExists) happens too early.
Found while running dhrystone (from https://github.com/bytecodealliance/wasm-micro-runtime/tree/main/tests/benchmarks/dhrystone) compiled with
emcc
with-O0
When
readAheadLocalGetIfExists
reads ahead incomputeExprResultPosition
it can encounter unknown / unsupported bytecodes;0x1f
in this specific case.When it looks for a
local.set
code ahead, and finds one, it uses this data to index into a vector (m_localInfo
) that is empty, causing a Segmentation Fault.Surrounding bytes when inspected when stopped with the debugger (using
lookaheadUnsigned8()
):However I was not able to find this byte sequence when I disassembled the
.wasm
file withwasm-objdump
.This is a functional but inelegant workaround that eliminated the crash:
dhrystone_emcc_O0.zip
The text was updated successfully, but these errors were encountered: