Issue 1:
Preflight Checklist

I have read the Contributing Guidelines for this project.

I agree to follow the Code of Conduct that this project adheres to.

I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

Electron crashes because of node 14.16.0 on Apple M1 if using RealmJS (that internally triggers code path that uses WASM).

You can check the issue reported on node repo (nodejs/node#37061) that is related to the same crash happening on Electron built for ARM64.

Electron Version:

v12.0.0

Operating System:

macOS 11.2

Last Known Working Electron version:

Never worked

Expected Behavior

When building Electron for ARM64 on OSX (Apple Silicon M1) and using RealmJS, the app should not crash.

Actual Behavior

When opening the Electron App, it crashes.

To Reproduce

Initialise RealmJS in the BrowserWindow, the app will crash.

Screenshots

Additional Information

Crash report:

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&) + 1324
10 com.github.Electron.framework	0x000000010340c1e8 v8::internal::wasm::NativeModule::CreateEmptyJumpTableInRegion(int, v8::base::AddressRegion, v8::internal::wasm::WasmCodeAllocator::OptionalLock const&) + 68
11 com.github.Electron.framework	0x000000010340b278 v8::internal::wasm::NativeModule::AddCodeSpace(v8::base::AddressRegion, v8::internal::wasm::WasmCodeAllocator::OptionalLock const&) + 252
12 com.github.Electron.framework	0x000000010340bf18 v8::internal::wasm::NativeModule::NativeModule(v8::internal::wasm::WasmEngine*, v8::internal::wasm::WasmFeatures const&, v8::internal::VirtualMemory, std::__1::shared_ptr<v8::internal::wasm::WasmModule const>, std::__1::shared_ptr<v8::internal::Counters>, std::__1::shared_ptr<v8::internal::wasm::NativeModule>*) + 632
13 com.github.Electron.framework	0x0000000105f85404 v8::internal::wasm::WasmCodeManager::NewNativeModule(v8::internal::wasm::WasmEngine*, v8::internal::Isolate*, v8::internal::wasm::WasmFeatures const&, unsigned long, std::__1::shared_ptr<v8::internal::wasm::WasmModule const>) + 388
14 com.github.Electron.framework	0x0000000105f8e2f8 v8::internal::wasm::WasmEngine::NewNativeModule(v8::internal::Isolate*, v8::internal::wasm::WasmFeatures const&, std::__1::shared_ptr<v8::internal::wasm::WasmModule const>, 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&, v8::internal::wasm::ErrorThrower*, v8::internal::wasm::ModuleWireBytes const&) + 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

Issue 2:
As this issue said: #15412

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.