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

Failed to run on Macos Electron project #1212

Closed
TerryChan opened this issue Sep 7, 2022 · 4 comments
Closed

Failed to run on Macos Electron project #1212

TerryChan opened this issue Sep 7, 2022 · 4 comments
Labels

Comments

@TerryChan
Copy link

When I add ssh2 to my electron project, build and run, but it failed with errors below:

<--- Last few GCs --->

[35512:0x140008000] 6795 ms: Scavenge 41.1 (54.0) -> 40.0 (56.5) MB, 17.2 / 0.0 ms (average mu = 1.000, current mu = 1.000) allocation failure;
[35512:0x140008000] 6889 ms: Scavenge 45.8 (56.5) -> 41.9 (58.7) MB, 7.1 / 0.0 ms (average mu = 1.000, current mu = 1.000) allocation failure;

<--- JS stacktrace --->

[35512:0907/210137.736266:ERROR:v8_initializer.cc(689)] V8 process OOM: (WasmCodeManager::Commit: Cannot make pre-reserved region writable).
[35509:0907/210137.806207:ERROR:CONSOLE(160)] "Electron sandbox_bundle.js script failed to run", source: node:electron/js2c/sandbox_bundle (160)
[35509:0907/210137.806230:ERROR:CONSOLE(160)] "TypeError: object null is not iterable (cannot read property Symbol(Symbol.iterator))", source: node:electron/js2c/sandbox_bundle (160)
[35509:0907/210137.806596:ERROR:CONSOLE(160)] "Electron sandbox_bundle.js script failed to run", source: node:electron/js2c/sandbox_bundle (160)
[35509:0907/210137.806644:ERROR:CONSOLE(160)] "TypeError: object null is not iterable (cannot read property Symbol(Symbol.iterator))", source: node:electron/js2c/sandbox_bundle (160)

Any sugesstion to fixed this issue ?
Thanks anyway

OS: Macos 12.4
Electron: v19

@mscdex
Copy link
Owner

mscdex commented Sep 7, 2022

A quick google search reveals this issue occurred only on Apple Silicon when using WASM and was fixed in node.js some time ago via patches from upstream V8. Since Electron utilizes its own copy of V8 though, I'm not sure if they have pulled in the same fix or not in the copy of Electron you have.

My suggestion would be to try the latest v19.x version of Electron or the the latest major version of Electron (v20.x as of this writing -- or perhaps even the v21.x beta). If it still doesn't work after that, I would recommend creating an issue on Electron's issue tracker as the error is coming from their copy of V8.

@mscdex mscdex closed this as completed Sep 7, 2022
@mscdex mscdex added the question label Sep 7, 2022
@TerryChan
Copy link
Author

TerryChan commented Sep 7, 2022

@mscdex Thanks for your reply.
Yes, I'm using Mac M1, and my Electron version is 19.0.0, it includes Chromium 102, V8 10.2, and Node.js 16.14.2.
I will try a higher version of Electron. And it would be great if you can share some links on that v8 or node.js has fixed this issue. Thanks again.

@codebytere
Copy link

@mscdex do you happen to have a link to the patches that resolved this so i can cross-check them?

@mscdex
Copy link
Owner

mscdex commented Sep 8, 2022

@codebytere I don't know for sure that this resolves the issue, it's just based on what others reported: nodejs/node#35986

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

No branches or pull requests

3 participants