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

Crash on M1 Mac when calling many commands like login, link, etc. #1800

Closed
MarcoZehe opened this issue Jan 24, 2021 · 22 comments
Closed

Crash on M1 Mac when calling many commands like login, link, etc. #1800

MarcoZehe opened this issue Jan 24, 2021 · 22 comments
Labels
type: bug code to address defects in shipped code

Comments

@MarcoZehe
Copy link

Describe the bug

Netlify-cli crashes with many commands. Only simple commands like "help" work.

To Reproduce

Steps to reproduce the behavior:

  1. Install Netlify-cli via either npm or Homebrew, as described in the Readme.
  2. Type Netlify login.

Configuration

Not applicable, I don't even get as far as this becoming relevant.

Expected behavior

No crash, I should be able to log in.

CLI Output

#
# Fatal error in , line 0
# Check failed: allocator->SetPermissions(reinterpret_cast<void*>(region.begin()), region.size(), PageAllocator::kNoAccess).
#
#
#
#FailureMessage Object: 0x16dd2d9a8
 1: 0x1021b9d34 node::NodePlatform::GetStackTracePrinter()::$_3::__invoke() [/opt/homebrew/bin/node]
 2: 0x102b41f64 V8_Fatal(char const*, ...) [/opt/homebrew/bin/node]
 3: 0x10272ade4 v8::internal::wasm::WasmCodeAllocator::GetNumCodeSpaces() const [/opt/homebrew/bin/node]
 4: 0x10272ac84 v8::internal::wasm::WasmCodeAllocator::FreeCode(v8::internal::Vector<v8::internal::wasm::WasmCode* const>) [/opt/homebrew/bin/node]
 5: 0x10272dad4 v8::internal::wasm::NativeModule::FreeCode(v8::internal::Vector<v8::internal::wasm::WasmCode* const>) [/opt/homebrew/bin/node]
 6: 0x10273b658 v8::internal::wasm::WasmEngine::FreeDeadCodeLocked(std::__1::unordered_map<v8::internal::wasm::NativeModule*, std::__1::vector<v8::internal::wasm::WasmCode*, std::__1::allocator<v8::internal::wasm::WasmCode*> >, std::__1::hash<v8::internal::wasm::NativeModule*>, std::__1::equal_to<v8::internal::wasm::NativeModule*>, std::__1::allocator<std::__1::pair<v8::internal::wasm::NativeModule* const, std::__1::vector<v8::internal::wasm::WasmCode*, std::__1::allocator<v8::internal::wasm::WasmCode*> > > > > const&) [/opt/homebrew/bin/node]
 7: 0x102739678 v8::internal::wasm::WasmEngine::PotentiallyFinishCurrentGC() [/opt/homebrew/bin/node]
 8: 0x10273a8b4 v8::internal::wasm::WasmEngine::ReportLiveCodeForGC(v8::internal::Isolate*, v8::internal::Vector<v8::internal::wasm::WasmCode*>) [/opt/homebrew/bin/node]
 9: 0x10273aba4 v8::internal::wasm::WasmEngine::ReportLiveCodeFromStackForGC(v8::internal::Isolate*) [/opt/homebrew/bin/node]
10: 0x10239eb74 v8::internal::StackGuard::HandleInterrupts() [/opt/homebrew/bin/node]
11: 0x10262e3c4 v8::internal::Runtime_StackGuard(int, unsigned long*, v8::internal::Isolate*) [/opt/homebrew/bin/node]
12: 0x1028b022c Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/opt/homebrew/bin/node]
13: 0x102848fd0 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
14: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
15: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
16: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
17: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
18: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
19: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
20: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
21: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
22: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
23: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
24: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
25: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
26: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
27: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
28: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
29: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
30: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
31: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
32: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
33: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
34: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
35: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
36: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
37: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
38: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
39: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
40: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
41: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
42: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
43: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
44: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
45: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
46: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
47: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
48: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
49: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
50: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
51: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
52: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
53: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
54: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
55: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
56: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
57: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
58: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
59: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
60: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
61: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
62: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
63: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
64: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
65: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
66: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
67: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
68: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
69: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
70: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
71: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
72: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
73: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
74: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
75: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
76: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
77: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
78: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
79: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
80: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
81: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
82: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
83: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
84: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
85: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
86: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
87: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
88: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
89: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
90: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
91: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
92: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
93: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
94: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
95: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
96: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
97: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
98: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
99: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
100: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
101: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
102: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
103: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
104: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
105: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
106: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
107: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
108: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
109: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
110: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
111: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
112: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
113: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
114: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
115: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
116: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
117: 0x102848f34 Builtins_InterpreterEntryTrampoline [/opt/homebrew/bin/node]
118: 0x102875334 Builtins_AsyncFunctionAwaitResolveClosure [/opt/homebrew/bin/node]
119: 0x1028fc4bc Builtins_PromiseFulfillReactionJob [/opt/homebrew/bin/node]
120: 0x1028680a8 Builtins_RunMicrotasks [/opt/homebrew/bin/node]
121: 0x1028466c8 Builtins_JSRunMicrotasksEntry [/opt/homebrew/bin/node]
122: 0x160008000 
zsh: trace trap  netlify login

Additional context

Worked a few weeks ago, on the same M1 machine, but stopped working when I tried it again yesterday. Also updating from 2.7 to 3.4.2 didn't help. Neither did uninstalling, reinstalling, clearing both the Library cache and Preference Netlify folder nor the .netlify folder in my home directory.

The CLI is completely dysfunctional ATM.

@MarcoZehe MarcoZehe added the type: bug code to address defects in shipped code label Jan 24, 2021
@erezrokah
Copy link
Contributor

Hi @MarcoZehe, thank you for reporting this issue. Does the command npx envinfo --system --binaries --npmPackages netlify-cli --npmGlobalPackages netlify-cli give you any output? Can you share how you installed Node.js (e.g. via nvm)

@MarcoZehe
Copy link
Author

Hi @erezrokah , thanks for the reply! That command gives me the following output:

  System:
    OS: macOS 11.2
    CPU: (8) arm64 Apple M1
    Memory: 445.44 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 15.6.0 - /opt/homebrew/bin/node
    Yarn: 1.22.10 - /opt/homebrew/bin/yarn
    npm: 7.4.0 - /opt/homebrew/bin/npm
    Watchman: 4.9.0 - /opt/homebrew/bin/watchman
  npmGlobalPackages:
    netlify-cli: 3.4.2

I originally installed Node and NVM via the installer from nodes.org, but I think later, when I got Homebrew running on the M1 Mac, it Tok over the installation and management of Node. Anyway the latest update to Node to v15.6 was done via Homebrew.

@erezrokah
Copy link
Contributor

Thanks again @MarcoZehe that helps.
Does installing using nvm work? Or using Node.js v14? Or both? Asking for debugging purposes in an attempt to scope down the cause (since it was working before).

@MarcoZehe
Copy link
Author

No, since those versions didn't support the M1 yet, I had to go for the latest 15.x. And Netlify-CLI 2.69 was the initial version installed on this machine, and that one worked. Then some time later came an update, which I did, but didn't immediately use it afterwards. Now as I wanted to debug a build problem locally, I found the crash over the weekend.

I tried installing Netlify-CLI both through npm as well as Homebrew, with no difference. As it appears: I'm stuck.

@MarcoZehe
Copy link
Author

I think what updated in the meantime as well was Node from V15.5.1 to 15.6.0. I believe v15.5.0 was the initial version I installed onto this M1 Mac, and 15.5.1 came out early January around the time I was experimenting with the CLI for the first time. And the initial version I got was 2.69. And 2.70 came out shortly after.

@erezrokah
Copy link
Contributor

Does reverting to 2.69 work? e.g. running npm install -g netlify-cli@2.69.0? I apologize for all the questions - I'm trying to understand if this is something that we changed in the CLI, or something that changed with the Node.js update.

@MarcoZehe
Copy link
Author

I just had the same idea. Unfortunately, 2.69 now crashes with a similar stack trace.

@erezrokah
Copy link
Contributor

Are you able to run other Node.js programs? Can you verify you're running the latest version of brew? It should be 2.7.5. Looks like they added macOS Big Sur support for M1 just recently.
Maybe this comment is related?

@MarcoZehe
Copy link
Author

Yes, I can run Eleventy to build a site, for example. And Homebrew is definitely 2.7.5, I only installed it on this Mac after its installation script no longer complained that it needed Rosetta 2. In fact, I don't even have brew at /usr/local/bin, so I couldn't even dump the package from there as the follow-up comment suggests.

@erezrokah
Copy link
Contributor

Thanks for the additional information @MarcoZehe.
We're trying to reproduce this internally on a M1 machine.
To clarify the steps you took are:

  1. Install Homebrew via /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" (based on https://brew.sh/)
  2. Run brew install node
  3. Run npm install -g netlify-cli

Is that correct?

@MarcoZehe
Copy link
Author

Essentially yes.

@MarcoZehe
Copy link
Author

@erezrokah You may be interested in the following issue which was filed yesterday by @andreialecu: nodejs/node#37061. I am on 11.2 RC2 as well, and this seems to be a deciding factor.

@reecebguida
Copy link

reecebguida commented Feb 3, 2021

Hi @erezrokah! I'm also having the same problem, documented in detail here. The issue seemed to resolve itself for @MarcoZehe, but I'm still stuck.

@erezrokah
Copy link
Contributor

erezrokah commented Feb 4, 2021

Thank you for the additional context @reecebguida. I'm tracking the Node.js issue and haven't seen a simple workaround yet.

I recommend posting the dependencies and Node.js versions you're using in nodejs/node#37061 to see if someone can help.

A possible workaround is to deploy from a CI service (GitHub Actions, Netlify, etc.) by running netlify deploy --build as a part of a CI job. This might not be as fast as deploying locally, but for the long run you'd get the benefits of the git workflow.

@reecebguida
Copy link

@erezrokah Thanks for the update and recommendation!

I'm using v15.7.0 but don't know how to figure out what dependencies I'm using.

I'm a newbie and my Googling to answer this question has proven unsuccessful.

I'm getting zsh: command not found: node_modules from this recommendation and $ otool -L menubar.app/Contents/MacOS/menubar menubar.app/Contents/MacOS/menubar: from this recommendation.

I've been getting a lot of zsh and $ related errors earlier on as I've tried to solve this the past couple days.

If you have time, would you please help me understand how to do that before I take this to nodejs/node#37061? Thanks!

@erezrokah
Copy link
Contributor

If you have time, would you please help me understand how to do that before I take this to nodejs/node#37061? Thanks!

You can try via https://github.com/tabrindle/envinfo. e.g. npx envinfo --npmPackages

@reecebguida
Copy link

Thanks for getting back to me @erezrokah! I tried that and it looks like I'm getting another zsh error...Any ideas?

Screen Shot 2021-02-04 at 8 51 09 AM

If not, would it be proper etiquette to open a new discussion for this issue and link it back to this one?

@crock
Copy link

crock commented Feb 15, 2021

 System:
    OS: macOS 11.2
    CPU: (8) arm64 Apple M1
    Memory: 1.89 GB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 15.8.0 - ~/.nvm/versions/node/v15.8.0/bin/node
    Yarn: 1.22.10 - ~/Sites/domaincord/node_modules/.bin/yarn
    npm: 7.5.1 - ~/.nvm/versions/node/v15.8.0/bin/npm
  npmPackages:
    netlify-cli: ^3.8.1 => 3.8.1 

Same issue here.

When running netlify dev on both Node 14 and 15...

FATAL ERROR: wasm code commit Allocation failed - process out of memory
 1: 0x1030169d8 node::Abort() [/Users/croc/.nvm/versions/node/v14.15.5/bin/node]
 2: 0x103016b58 node::errors::TryCatchScope::~TryCatchScope() [/Users/croc/.nvm/versions/node/v14.15.5/bin/node]

@erezrokah
Copy link
Contributor

Per nodejs/node#37061 (comment) this should be fixed in Node.js v15.9.0 which is expected to be released today.

@erezrokah
Copy link
Contributor

So Node.js v15.9.0 was released and should fix this issue. Closing - please comment if still happens after upgrading to the latest version.

@reecebguida
Copy link

Confirming that it's fixed @erezrokah. Thank you!

@mirairoad
Copy link

I was able to working around it, I use bash rather than zsh, and I use node 16 and not NVM, it works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

5 participants