Skip to content

WASM usage causes Node 16.1+ crash on ARMv6 #41402

Closed
@adriancable

Description

@adriancable

Version

16.1 and above, including 17.x

Platform

Linux

Subsystem

No response

What steps will reproduce the bug?

Lots of packages do something like this: (extract from long)

try {
  wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([
    0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1$
  ])), {}).exports;
} catch (e) {
  // no wasm support :(
}

I understand WASM support for ARMv6 has been removed in Node 16.1+ which is fine. But unfortunately the above code causes a hard crash in Node 16.1+ on ARMv6.

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

Do not crash - instead throw an exception, so the code can fall back to non-WASM usage. (like long tries to do, but fails because node just crashes.)

What do you see instead?

Hard crash.

#
# Fatal error in , line 0
# Liftoff bailout should not happen. Cause: Armv6 not supported

#
#
#
#FailureMessage Object: 0xb49faf50
Trace/breakpoint trap (core dumped)

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    v8 engineIssues and PRs related to the V8 dependency.wasmIssues and PRs related to WebAssembly.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions