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

[Question] Failed to launch on Apple Silicon with ssh2 #15258

Closed
TerryChan opened this issue Sep 9, 2022 · 1 comment
Closed

[Question] Failed to launch on Apple Silicon with ssh2 #15258

TerryChan opened this issue Sep 9, 2022 · 1 comment

Comments

@TerryChan
Copy link
Contributor

TerryChan commented Sep 9, 2022

I know it's not an issue of Desktop, but I'd appreciate if anyone could offer some advice on how to fix this issue.

I'm developing a ssh tool with the codebase of Desktop, plus this ssh2 project. Which means I add ssh2 package to Desktop and test ssh feature, the steps are:

  1. clone latest Desktop code (with electron 19.0.0), and run it successfully
  2. add ssh2 to Desktop project: cd app ; yarn add ssh2
  3. Write test code of ssh2, and then build and run Desktop.

All work well on Windows and Mac with Apple Intel, but it failed to launch on Mac with Apple Silicon with errors below:

<--- Last few GCs --->

[87418:0x140008000]    13557 ms: Scavenge 23.1 (28.2) -> 20.2 (37.9) MB, 1.2 / 0.0 ms  (average mu = 0.999, current mu = 1.000) allocation failure; 
[87418:0x140008000]    13572 ms: Mark-sweep 22.2 (39.9) -> 17.3 (38.8) MB, 2.1 / 0.0 ms  (+ 2.0 ms in 84 steps since start of marking, biggest step 0.3 ms, walltime since start of marking 81 ms) (average mu = 0.998, current mu = 0.980) finalize incrementa

<--- JS stacktrace --->

[87418:0909/165933.595195:ERROR:v8_initializer.cc(689)] V8 process OOM: (WasmCodeManager::Commit: Cannot make pre-reserved region writable).

Looks like it's v8 error with Wasm.

On Apple Silicon, I made a lot of verification:

  1. Run the ssh2 in pure nodejs application, it worked well with the expected result.
  2. Run the ssh2 in pure electron application (with fiddle), it also worked well:

image

Maybe it's a issue caused by the build configuration?

I also asked the author of ssh2, and electron, and tried a higher electron(19.0.16), but still failed.

My environment is:
node: v16.17.0
OS: Macos v12.5.1, Apple M1 Pro

Any sugesstion to fixed this issue ?
Thanks anyway

@niik
Copy link
Member

niik commented Sep 9, 2022

Hi @TerryChan, I'm afraid we can't help you since we don't use wasm in Desktop today. I wouldn't be surprised, however, if our use of hardened runtime could have something to do with it. It's possible you might need to add one or more entitlements (probably the JIT entitlement). Hope that sets you on the right path.

@niik niik closed this as completed Sep 9, 2022
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