<h3 dir="auto">Preflight Checklist</h3>

<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the issue tracker for an issue that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Issue Details</h3>
<p dir="auto">Electron crashes because of node 14.16.0 on Apple M1 if using RealmJS (that internally triggers code path that uses WASM).<br>
You can check the issue reported on node repo (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="793190120" data-permission-text="Title is private" data-url="https://github.com/nodejs/node/issues/37061" data-hovercard-type="issue" data-hovercard-url="/nodejs/node/issues/37061/hovercard" href="https://github.com/nodejs/node/issues/37061">nodejs/node#37061</a>) that is related to the same crash happening on Electron built for ARM64.</p>
<ul dir="auto">
<li><strong>Electron Version:</strong>
<ul dir="auto">
<li>v12.0.0</li>
</ul>
</li>
<li><strong>Operating System:</strong>
<ul dir="auto">
<li>macOS 11.2</li>
</ul>
</li>
<li><strong>Last Known Working Electron version:</strong>
<ul dir="auto">
<li>Never worked</li>
</ul>
</li>
</ul>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">When building Electron for ARM64 on OSX (Apple Silicon M1) and using RealmJS, the app should not crash.</p>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto">When opening the Electron App, it crashes.</p>
<h3 dir="auto">To Reproduce</h3>
<p dir="auto">Initialise RealmJS in the BrowserWindow, the app will crash.</p>



<h3 dir="auto">Screenshots</h3>

<h3 dir="auto">Additional Information</h3>
<p dir="auto">Crash report:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
Application Specific Information:
abort() called

Thread 0 Crashed:: CrRendererMain  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	0x0000000193ceccec __pthread_kill + 8
1   libsystem_pthread.dylib       	0x0000000193d1dc24 pthread_kill + 292
2   libsystem_c.dylib             	0x0000000193c65864 abort + 104
3   com.github.Electron.framework 	0x0000000106b1b240 v8::internal::compiler::ZoneStats::GetCurrentAllocatedBytes() const + 10710128
4   com.github.Electron.framework 	0x0000000107db9f00 v8::internal::compiler::ZoneStats::GetCurrentAllocatedBytes() const + 30234928
5   com.github.Electron.framework 	0x0000000107db9994 v8::internal::compiler::ZoneStats::GetCurrentAllocatedBytes() const + 30233540
6   com.github.Electron.framework 	0x0000000105d07adc v8::internal::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*) + 696
7   com.github.Electron.framework 	0x0000000105d07aa0 v8::internal::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*) + 636
8   com.github.Electron.framework 	0x0000000105f84564 v8::internal::wasm::WasmCodeManager::Commit(v8::base::AddressRegion) + 180
9   com.github.Electron.framework 	0x000000010340b6a8 v8::internal::wasm::NativeModule::AddCodeSpace(v8::base::AddressRegion, v8::internal::wasm::WasmCodeAllocator::OptionalLock const&amp;) + 1324
10  com.github.Electron.framework 	0x000000010340c1e8 v8::internal::wasm::NativeModule::CreateEmptyJumpTableInRegion(int, v8::base::AddressRegion, v8::internal::wasm::WasmCodeAllocator::OptionalLock const&amp;) + 68
11  com.github.Electron.framework 	0x000000010340b278 v8::internal::wasm::NativeModule::AddCodeSpace(v8::base::AddressRegion, v8::internal::wasm::WasmCodeAllocator::OptionalLock const&amp;) + 252
12  com.github.Electron.framework 	0x000000010340bf18 v8::internal::wasm::NativeModule::NativeModule(v8::internal::wasm::WasmEngine*, v8::internal::wasm::WasmFeatures const&amp;, v8::internal::VirtualMemory, std::__1::shared_ptr&lt;v8::internal::wasm::WasmModule const&gt;, std::__1::shared_ptr&lt;v8::internal::Counters&gt;, std::__1::shared_ptr&lt;v8::internal::wasm::NativeModule&gt;*) + 632
13  com.github.Electron.framework 	0x0000000105f85404 v8::internal::wasm::WasmCodeManager::NewNativeModule(v8::internal::wasm::WasmEngine*, v8::internal::Isolate*, v8::internal::wasm::WasmFeatures const&amp;, unsigned long, std::__1::shared_ptr&lt;v8::internal::wasm::WasmModule const&gt;) + 388
14  com.github.Electron.framework 	0x0000000105f8e2f8 v8::internal::wasm::WasmEngine::NewNativeModule(v8::internal::Isolate*, v8::internal::wasm::WasmFeatures const&amp;, std::__1::shared_ptr&lt;v8::internal::wasm::WasmModule const&gt;, unsigned long) + 84
15  com.github.Electron.framework 	0x0000000105f6b930 v8::internal::wasm::CompilationState::failed() const + 2736
16  com.github.Electron.framework 	0x0000000103411004 v8::internal::wasm::WasmEngine::SyncCompile(v8::internal::Isolate*, v8::internal::wasm::WasmFeatures const&amp;, v8::internal::wasm::ErrorThrower*, v8::internal::wasm::ModuleWireBytes const&amp;) + 448
17  com.github.Electron.framework 	0x0000000103418110 v8::internal::WasmJs::Install(v8::internal::Isolate*, bool) + 5776
18  com.github.Electron.framework 	0x00000001030ec68c v8::internal::ClassScope::ResolvePrivateNamesPartially() + 15712
19  com.github.Electron.framework 	0x00000001030ec034 v8::internal::ClassScope::ResolvePrivateNamesPartially() + 14088
20  com.github.Electron.framework 	0x00000001030ebc04 v8::internal::ClassScope::ResolvePrivateNamesPartially() + 13016
21  com.github.Electron.framework 	0x000000010370da8c v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 462956
22  com.github.Electron.framework 	0x00000001036a2a1c v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 24572
23  com.github.Electron.framework 	0x000000010379c5f0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 1047504
24  com.github.Electron.framework 	0x00000001036a5db0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 37776
25  com.github.Electron.framework 	0x00000001036a5db0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 37776
26  com.github.Electron.framework 	0x00000001036a5db0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 37776
27  com.github.Electron.framework 	0x00000001036a5db0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 37776
28  com.github.Electron.framework 	0x00000001036a5db0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 37776
29  com.github.Electron.framework 	0x00000001036a5db0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 37776
30  com.github.Electron.framework 	0x00000001036a5db0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 37776
31  com.github.Electron.framework 	0x00000001036a5db0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 37776
32  com.github.Electron.framework 	0x00000001036a5db0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 37776
33  com.github.Electron.framework 	0x00000001036a5db0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 37776
34  com.github.Electron.framework 	0x00000001036a366c v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 27724
35  com.github.Electron.framework 	0x00000001036a3308 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 26856
36  ???                           	0x000000016d649570 0 + 6130275696"><pre class="notranslate"><code class="notranslate">
Application Specific Information:
abort() called

Thread 0 Crashed:: CrRendererMain  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	0x0000000193ceccec __pthread_kill + 8
1   libsystem_pthread.dylib       	0x0000000193d1dc24 pthread_kill + 292
2   libsystem_c.dylib             	0x0000000193c65864 abort + 104
3   com.github.Electron.framework 	0x0000000106b1b240 v8::internal::compiler::ZoneStats::GetCurrentAllocatedBytes() const + 10710128
4   com.github.Electron.framework 	0x0000000107db9f00 v8::internal::compiler::ZoneStats::GetCurrentAllocatedBytes() const + 30234928
5   com.github.Electron.framework 	0x0000000107db9994 v8::internal::compiler::ZoneStats::GetCurrentAllocatedBytes() const + 30233540
6   com.github.Electron.framework 	0x0000000105d07adc v8::internal::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*) + 696
7   com.github.Electron.framework 	0x0000000105d07aa0 v8::internal::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*) + 636
8   com.github.Electron.framework 	0x0000000105f84564 v8::internal::wasm::WasmCodeManager::Commit(v8::base::AddressRegion) + 180
9   com.github.Electron.framework 	0x000000010340b6a8 v8::internal::wasm::NativeModule::AddCodeSpace(v8::base::AddressRegion, v8::internal::wasm::WasmCodeAllocator::OptionalLock const&amp;) + 1324
10  com.github.Electron.framework 	0x000000010340c1e8 v8::internal::wasm::NativeModule::CreateEmptyJumpTableInRegion(int, v8::base::AddressRegion, v8::internal::wasm::WasmCodeAllocator::OptionalLock const&amp;) + 68
11  com.github.Electron.framework 	0x000000010340b278 v8::internal::wasm::NativeModule::AddCodeSpace(v8::base::AddressRegion, v8::internal::wasm::WasmCodeAllocator::OptionalLock const&amp;) + 252
12  com.github.Electron.framework 	0x000000010340bf18 v8::internal::wasm::NativeModule::NativeModule(v8::internal::wasm::WasmEngine*, v8::internal::wasm::WasmFeatures const&amp;, v8::internal::VirtualMemory, std::__1::shared_ptr&lt;v8::internal::wasm::WasmModule const&gt;, std::__1::shared_ptr&lt;v8::internal::Counters&gt;, std::__1::shared_ptr&lt;v8::internal::wasm::NativeModule&gt;*) + 632
13  com.github.Electron.framework 	0x0000000105f85404 v8::internal::wasm::WasmCodeManager::NewNativeModule(v8::internal::wasm::WasmEngine*, v8::internal::Isolate*, v8::internal::wasm::WasmFeatures const&amp;, unsigned long, std::__1::shared_ptr&lt;v8::internal::wasm::WasmModule const&gt;) + 388
14  com.github.Electron.framework 	0x0000000105f8e2f8 v8::internal::wasm::WasmEngine::NewNativeModule(v8::internal::Isolate*, v8::internal::wasm::WasmFeatures const&amp;, std::__1::shared_ptr&lt;v8::internal::wasm::WasmModule const&gt;, unsigned long) + 84
15  com.github.Electron.framework 	0x0000000105f6b930 v8::internal::wasm::CompilationState::failed() const + 2736
16  com.github.Electron.framework 	0x0000000103411004 v8::internal::wasm::WasmEngine::SyncCompile(v8::internal::Isolate*, v8::internal::wasm::WasmFeatures const&amp;, v8::internal::wasm::ErrorThrower*, v8::internal::wasm::ModuleWireBytes const&amp;) + 448
17  com.github.Electron.framework 	0x0000000103418110 v8::internal::WasmJs::Install(v8::internal::Isolate*, bool) + 5776
18  com.github.Electron.framework 	0x00000001030ec68c v8::internal::ClassScope::ResolvePrivateNamesPartially() + 15712
19  com.github.Electron.framework 	0x00000001030ec034 v8::internal::ClassScope::ResolvePrivateNamesPartially() + 14088
20  com.github.Electron.framework 	0x00000001030ebc04 v8::internal::ClassScope::ResolvePrivateNamesPartially() + 13016
21  com.github.Electron.framework 	0x000000010370da8c v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 462956
22  com.github.Electron.framework 	0x00000001036a2a1c v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 24572
23  com.github.Electron.framework 	0x000000010379c5f0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 1047504
24  com.github.Electron.framework 	0x00000001036a5db0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 37776
25  com.github.Electron.framework 	0x00000001036a5db0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 37776
26  com.github.Electron.framework 	0x00000001036a5db0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 37776
27  com.github.Electron.framework 	0x00000001036a5db0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 37776
28  com.github.Electron.framework 	0x00000001036a5db0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 37776
29  com.github.Electron.framework 	0x00000001036a5db0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 37776
30  com.github.Electron.framework 	0x00000001036a5db0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 37776
31  com.github.Electron.framework 	0x00000001036a5db0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 37776
32  com.github.Electron.framework 	0x00000001036a5db0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 37776
33  com.github.Electron.framework 	0x00000001036a5db0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 37776
34  com.github.Electron.framework 	0x00000001036a366c v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 27724
35  com.github.Electron.framework 	0x00000001036a3308 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 26856
36  ???                           	0x000000016d649570 0 + 6130275696
</code></pre></div>
<p dir="auto">As this issue said: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="374305711" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/15412" data-hovercard-type="issue" data-hovercard-url="/electron/electron/issues/15412/hovercard" href="https://github.com/electron/electron/issues/15412">#15412</a><br>
Last time I opened this issue but wrote the expected behavior and the actual behavior on the wrong sides, and it was closed before I modified it. I hope someone can check this issue once again.</p>