Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WASM check causes Node 16.1+ crash on ARMv6 #107

Open
adriancable opened this issue Jan 4, 2022 · 3 comments
Open

WASM check causes Node 16.1+ crash on ARMv6 #107

adriancable opened this issue Jan 4, 2022 · 3 comments

Comments

@adriancable
Copy link

adriancable commented Jan 4, 2022

Node 16.1+ does not support WASM on ARMv6. Unfortunately rather than failing nice, this code causes node to exit with an error, which unnecessarily prevents any packages that depend on long from running on ARMv6 for Node 16.1+:

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 :(
}

makes node crash with:

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

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

Possible workaround: if os.cpus().find(cpu => cpu.model.includes('ARMv6')) then skip the WASM check.

Cc: @ebaauw, @Supereg, @oznu

@dcodeIO
Copy link
Owner

dcodeIO commented Jan 5, 2022

Hmm, this looks pretty bad. Has this been reported to Node.js already / is there a response? Not sure that working around this in every package using Wasm is the right approach.

@adriancable
Copy link
Author

@dcodeIO - yes, I have just filed an issue with node (nodejs/node#41402). I hope this issue will be given airtime and resolved very quickly! Unfortunately realism suggests we should expect this may not happen, and even if it does, old node versions have a habit of staying around.

I agree that working around this in every package that uses WASM is tiresome, but long is very very broadly used (4M downloads/week on npm) and so if there is a good candidate package for the 'morally hazardous' option of working around this at the package level might be the right one in this case. Thoughts?

@adriancable
Copy link
Author

Update: this looks like a V8 bug. I have filed a ticket for it: https://bugs.chromium.org/p/v8/issues/detail?id=12527

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants