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

Electron app crashes after closing the app #3196

Closed
maximilize opened this issue Sep 5, 2020 · 7 comments
Closed

Electron app crashes after closing the app #3196

maximilize opened this issue Sep 5, 2020 · 7 comments

Comments

@maximilize
Copy link

maximilize commented Sep 5, 2020

When using realm with electron, the app is crashing after the user quits the app on macOS.

Steps to Reproduce

Run the code below inside the main electron thread, start the app and exit it. Within 0 and 5 seconds there will be a crash.

import * as Realm from 'realm';
import { app } from 'electron';

const Test = {
  name: 'Test',
  primaryKey: 'id',
  properties: {
    id: 'string',
    n: 'int',
  },
};

const realm = new Realm({ schema: [Test] });

app.on('ready', async () => {
  const n = realm.objects('Test').length;
  console.log('n1 =', n);
});

Version of Realm and Tooling

  • Realm JS SDK Version: 6.1.0
  • Node: 14.9.0
  • Electron: 10.1.1
  • Client OS & Version: MacOS 19.6.0

Stack trace

{code}
Process: Electron [770]
Path: /Users/USER/*/Electron.app/Contents/MacOS/Electron
Identifier: com.github.Electron
Version: 10.1.1 (10.1.1)
Code Type: X86-64 (Native)
Parent Process: node [745]
Responsible: Electron [559]
User ID: 503

Date/Time: 2020-09-05 14:05:16.172 +0200
OS Version: Mac OS X 10.15.6 (19G2021)
Report Version: 12
Anonymous UUID: C3AE1A94-1776-E225-E892-22973C9F9154

Time Awake Since Boot: 170 seconds

System Integrity Protection: enabled

Crashed Thread: 0 CrBrowserMain Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY

Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [770]

VM Regions Near 0:
-->
__TEXT 000000010974e000-0000000109776000 [ 160K] r-x/r-x SM=COW /Users/USER/*/Electron.app/Contents/MacOS/Electron

Thread 0 Crashed:: CrBrowserMain Dispatch queue: com.apple.main-thread
0 com.github.Electron.framework 0x00000001098d6ebb ElectronInitializeICUandStartNode + 1390907
1 com.github.Electron.framework 0x000000010a584fee v8::internal::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*) + 862
2 com.github.Electron.framework 0x000000010a6f3f7f v8::internal::HandleScope::Extend(v8::internal::Isolate*) + 399
3 com.github.Electron.framework 0x000000010a5873c8 v8::HandleScope::CreateHandle(v8::internal::Isolate*, unsigned long) + 56
4 com.github.Electron.framework 0x000000010fb0b061 napi_get_reference_value + 65
5 realm.node 0x000000011710c0aa Napi::ObjectWrap<realm::node::WrappedObject<realm::js::RealmClassrealm::node::Types > >::~ObjectWrap() + 48 (napi-inl.h:3161)
6 realm.node 0x000000011710c19e realm::node::WrappedObject<realm::js::RealmClassrealm::node::Types >::~WrappedObject() + 38 (node_class.hpp:90)
7 com.github.Electron.framework 0x000000010fb0d560 napi_is_detached_arraybuffer + 832
8 com.github.Electron.framework 0x000000010fb22c67 napi_ref_threadsafe_function + 231
9 com.github.Electron.framework 0x000000010faf67b6 node::EmitAsyncDestroy(node::Environment*, node::async_context) + 207110
10 com.github.Electron.framework 0x000000010fac1f8e node::FreeEnvironment(node::Environment*) + 14
11 com.github.Electron.framework 0x000000010985626a ElectronInitializeICUandStartNode + 863466
12 com.github.Electron.framework 0x000000010b4ab93e v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 4315374
13 com.github.Electron.framework 0x000000010b4ad2c1 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 4321905
14 com.github.Electron.framework 0x000000010b4a8b0d v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 4303549
15 com.github.Electron.framework 0x000000010b344bee v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 2845598
16 com.github.Electron.framework 0x000000010b3448ee v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 2844830
17 com.github.Electron.framework 0x000000010d90a245 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 42451445
18 com.github.Electron.framework 0x000000010a4b9095 ElectronInitializeICUandStartNode + 13851413
19 com.github.Electron.framework 0x000000010978354a ElectronMain + 74
20 com.github.Electron 0x000000010974efb0 0x10974e000 + 4016
21 libdyld.dylib 0x00007fff723facc9 start + 1

Thread 1:
0 libsystem_pthread.dylib 0x00007fff725fab68 start_wqthread + 0

Thread 2:: ThreadPoolServiceThread
0 libsystem_kernel.dylib 0x00007fff72544b96 kevent64 + 10
1 com.github.Electron.framework 0x000000010c167c06 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17669046
2 com.github.Electron.framework 0x000000010c167aeb v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17668763
3 com.github.Electron.framework 0x000000010c116a91 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17336897
4 com.github.Electron.framework 0x000000010c0ec8da v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17164426
5 com.github.Electron.framework 0x000000010c12090d v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17377469
6 com.github.Electron.framework 0x000000010c13339a v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17453898
7 com.github.Electron.framework 0x000000010c14f8b7 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17569895
8 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
9 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 3:: ThreadPoolForegroundWorker
0 libsystem_kernel.dylib 0x00007fff7253bdfa mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff7253c170 mach_msg + 60
2 com.github.Electron.framework 0x000000010c15a8a0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17614928
3 com.github.Electron.framework 0x000000010c129ebe v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17415790
4 com.github.Electron.framework 0x000000010c12a6de v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17417870
5 com.github.Electron.framework 0x000000010c12a40d v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17417149
6 com.github.Electron.framework 0x000000010c14f8b7 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17569895
7 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
8 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 4:: ThreadPoolBackgroundWorker
0 libsystem_kernel.dylib 0x00007fff7253bdfa mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff7253c170 mach_msg + 60
2 com.github.Electron.framework 0x000000010c15a8a0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17614928
3 com.github.Electron.framework 0x000000010c129ebe v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17415790
4 com.github.Electron.framework 0x000000010c12a6de v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17417870
5 com.github.Electron.framework 0x000000010c12a37d v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17417005
6 com.github.Electron.framework 0x000000010c14f8b7 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17569895
7 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
8 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 5:: Chrome_IOThread
0 libsystem_kernel.dylib 0x00007fff72544b96 kevent64 + 10
1 com.github.Electron.framework 0x000000010c167c06 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17669046
2 com.github.Electron.framework 0x000000010c167aeb v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17668763
3 com.github.Electron.framework 0x000000010c116a91 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17336897
4 com.github.Electron.framework 0x000000010c0ec8da v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17164426
5 com.github.Electron.framework 0x000000010b4af467 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 4330519
6 com.github.Electron.framework 0x000000010c13339a v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17453898
7 com.github.Electron.framework 0x000000010c14f8b7 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17569895
8 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
9 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 6:: MemoryInfra
0 libsystem_kernel.dylib 0x00007fff7253bdfa mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff7253c170 mach_msg + 60
2 com.github.Electron.framework 0x000000010c15a8a0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17614928
3 com.github.Electron.framework 0x000000010c15a76e v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17614622
4 com.github.Electron.framework 0x000000010c0cd7cf v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17037183
5 com.github.Electron.framework 0x000000010c116a91 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17336897
6 com.github.Electron.framework 0x000000010c0ec8da v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17164426
7 com.github.Electron.framework 0x000000010c13339a v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17453898
8 com.github.Electron.framework 0x000000010c14f8b7 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17569895
9 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
10 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 7:
0 libsystem_kernel.dylib 0x00007fff72540766 kevent + 10
1 com.github.Electron.framework 0x000000010fc5e5f7 uv_free_interface_addresses + 1303
2 com.github.Electron.framework 0x000000010fc4e36d uv_run + 365
3 com.github.Electron.framework 0x000000010fbad303 node::MultiIsolatePlatform::CancelPendingDelayedTasks(v8::Isolate*) + 675
4 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
5 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 8:
0 libsystem_kernel.dylib 0x00007fff7253e882 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff725ff425 _pthread_cond_wait + 698
2 com.github.Electron.framework 0x000000010fc59979 uv_cond_wait + 9
3 com.github.Electron.framework 0x000000010fbad4c2 node::MultiIsolatePlatform::CancelPendingDelayedTasks(v8::Isolate*) + 1122
4 com.github.Electron.framework 0x000000010fbab349 node::Buffer::New(v8::Isolate*, char*, unsigned long, void ()(char, void*), void*) + 540521
5 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
6 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 9:
0 libsystem_kernel.dylib 0x00007fff7253e882 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff725ff425 _pthread_cond_wait + 698
2 com.github.Electron.framework 0x000000010fc59979 uv_cond_wait + 9
3 com.github.Electron.framework 0x000000010fbad4c2 node::MultiIsolatePlatform::CancelPendingDelayedTasks(v8::Isolate*) + 1122
4 com.github.Electron.framework 0x000000010fbab349 node::Buffer::New(v8::Isolate*, char*, unsigned long, void ()(char, void*), void*) + 540521
5 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
6 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 10:
0 libsystem_kernel.dylib 0x00007fff7253e882 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff725ff425 _pthread_cond_wait + 698
2 com.github.Electron.framework 0x000000010fc59979 uv_cond_wait + 9
3 com.github.Electron.framework 0x000000010fbad4c2 node::MultiIsolatePlatform::CancelPendingDelayedTasks(v8::Isolate*) + 1122
4 com.github.Electron.framework 0x000000010fbab349 node::Buffer::New(v8::Isolate*, char*, unsigned long, void ()(char, void*), void*) + 540521
5 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
6 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 11:
0 libsystem_kernel.dylib 0x00007fff7253be36 semaphore_wait_trap + 10
1 com.github.Electron.framework 0x000000010fc59ed0 uv_sem_wait + 16
2 com.github.Electron.framework 0x000000010fc0f923 node::inspector::Agent::GetWsUrl() const + 83
3 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
4 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 12:
0 libsystem_kernel.dylib 0x00007fff7253e882 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff725ff425 _pthread_cond_wait + 698
2 com.github.Electron.framework 0x000000010fc59979 uv_cond_wait + 9
3 com.github.Electron.framework 0x000000010fc4a6f2 uv_cancel + 514
4 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
5 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 13:
0 libsystem_kernel.dylib 0x00007fff7253e882 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff725ff425 _pthread_cond_wait + 698
2 com.github.Electron.framework 0x000000010fc59979 uv_cond_wait + 9
3 com.github.Electron.framework 0x000000010fc4a6f2 uv_cancel + 514
4 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
5 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 14:
0 libsystem_kernel.dylib 0x00007fff7253e882 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff725ff425 _pthread_cond_wait + 698
2 com.github.Electron.framework 0x000000010fc59979 uv_cond_wait + 9
3 com.github.Electron.framework 0x000000010fc4a6f2 uv_cancel + 514
4 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
5 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 15:
0 libsystem_kernel.dylib 0x00007fff7253e882 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff725ff425 _pthread_cond_wait + 698
2 com.github.Electron.framework 0x000000010fc59979 uv_cond_wait + 9
3 com.github.Electron.framework 0x000000010fc4a6f2 uv_cancel + 514
4 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
5 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 16:: NetworkConfigWatcher
0 libsystem_kernel.dylib 0x00007fff7253bdfa mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff7253c170 mach_msg + 60
2 com.apple.CoreFoundation 0x00007fff3838fef5 __CFRunLoopServiceMachPort + 247
3 com.apple.CoreFoundation 0x00007fff3838e9c2 __CFRunLoopRun + 1319
4 com.apple.CoreFoundation 0x00007fff3838de3e CFRunLoopRunSpecific + 462
5 com.apple.Foundation 0x00007fff3aa291c8 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
6 com.github.Electron.framework 0x000000010c155c59 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17595401
7 com.github.Electron.framework 0x000000010c154b92 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17591106
8 com.github.Electron.framework 0x000000010c116a91 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17336897
9 com.github.Electron.framework 0x000000010c0ec8da v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17164426
10 com.github.Electron.framework 0x000000010c13339a v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17453898
11 com.github.Electron.framework 0x000000010c14f8b7 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17569895
12 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
13 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 17:: CrShutdownDetector
0 libsystem_kernel.dylib 0x00007fff7253c81e read + 10
1 com.github.Electron.framework 0x0000000109856cec ElectronInitializeICUandStartNode + 866156
2 com.github.Electron.framework 0x000000010c14f8b7 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17569895
3 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
4 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 18:: NetworkConfigWatcher
0 libsystem_kernel.dylib 0x00007fff7253bdfa mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff7253c170 mach_msg + 60
2 com.apple.CoreFoundation 0x00007fff3838fef5 __CFRunLoopServiceMachPort + 247
3 com.apple.CoreFoundation 0x00007fff3838e9c2 __CFRunLoopRun + 1319
4 com.apple.CoreFoundation 0x00007fff3838de3e CFRunLoopRunSpecific + 462
5 com.apple.Foundation 0x00007fff3aa291c8 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
6 com.github.Electron.framework 0x000000010c155c59 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17595401
7 com.github.Electron.framework 0x000000010c154b92 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17591106
8 com.github.Electron.framework 0x000000010c116a91 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17336897
9 com.github.Electron.framework 0x000000010c0ec8da v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17164426
10 com.github.Electron.framework 0x000000010c13339a v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17453898
11 com.github.Electron.framework 0x000000010c14f8b7 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17569895
12 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
13 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 19:: ThreadPoolForegroundWorker
0 libsystem_kernel.dylib 0x00007fff7253bdfa mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff7253c170 mach_msg + 60
2 com.github.Electron.framework 0x000000010c15a8a0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17614928
3 com.github.Electron.framework 0x000000010c129ebe v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17415790
4 com.github.Electron.framework 0x000000010c12a6de v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17417870
5 com.github.Electron.framework 0x000000010c12a40d v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17417149
6 com.github.Electron.framework 0x000000010c14f8b7 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17569895
7 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
8 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 20:: ThreadPoolForegroundWorker
0 libsystem_kernel.dylib 0x00007fff7253bdfa mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff7253c170 mach_msg + 60
2 com.github.Electron.framework 0x000000010c15a8a0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17614928
3 com.github.Electron.framework 0x000000010c129ebe v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17415790
4 com.github.Electron.framework 0x000000010c12a6de v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17417870
5 com.github.Electron.framework 0x000000010c12a40d v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17417149
6 com.github.Electron.framework 0x000000010c14f8b7 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17569895
7 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
8 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 21:: CompositorTileWorker1
0 libsystem_kernel.dylib 0x00007fff7253e882 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff725ff425 _pthread_cond_wait + 698
2 com.github.Electron.framework 0x000000010c14e9a7 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17566039
3 com.github.Electron.framework 0x000000010d3c1461 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 36910097
4 com.github.Electron.framework 0x000000010c14f8b7 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17569895
5 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
6 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 22:: ThreadPoolSingleThreadForegroundBlocking0
0 libsystem_kernel.dylib 0x00007fff7253bdfa mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff7253c170 mach_msg + 60
2 com.github.Electron.framework 0x000000010c15a8a0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17614928
3 com.github.Electron.framework 0x000000010c15a76e v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17614622
4 com.github.Electron.framework 0x000000010c129ecd v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17415805
5 com.github.Electron.framework 0x000000010c12a6de v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17417870
6 com.github.Electron.framework 0x000000010c12a46d v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17417245
7 com.github.Electron.framework 0x000000010c14f8b7 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17569895
8 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
9 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 23:
0 libsystem_kernel.dylib 0x00007fff7253be36 semaphore_wait_trap + 10
1 com.github.Electron.framework 0x000000010fc59ed0 uv_sem_wait + 16
2 com.github.Electron.framework 0x00000001098f3149 ElectronInitializeICUandStartNode + 1506249
3 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
4 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 24:: com.apple.NSEventThread
0 libsystem_kernel.dylib 0x00007fff7253bdfa mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff7253c170 mach_msg + 60
2 com.apple.CoreFoundation 0x00007fff3838fef5 __CFRunLoopServiceMachPort + 247
3 com.apple.CoreFoundation 0x00007fff3838e9c2 __CFRunLoopRun + 1319
4 com.apple.CoreFoundation 0x00007fff3838de3e CFRunLoopRunSpecific + 462
5 com.apple.AppKit 0x00007fff357a1954 _NSEventThread + 132
6 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
7 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 25:
0 libsystem_pthread.dylib 0x00007fff725fab68 start_wqthread + 0

Thread 26:: Realm notification listener
0 libsystem_kernel.dylib 0x00007fff72540766 kevent + 10
1 realm.node 0x0000000117240c6f realm::_impl::ExternalCommitHelper::listen() + 147 (external_commit_helper.cpp:217)
2 realm.node 0x0000000117241072 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_deletestd::__1::__thread_struct >, realm::_impl::ExternalCommitHelper::ExternalCommitHelper(realm::_impl::RealmCoordinator&)::$_0> >(void*) + 46 (thread:353)
3 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
4 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 27:: ThreadPoolBackgroundWorker
0 libsystem_kernel.dylib 0x00007fff7253bdfa mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff7253c170 mach_msg + 60
2 com.github.Electron.framework 0x000000010c15a8a0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17614928
3 com.github.Electron.framework 0x000000010c129ebe v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17415790
4 com.github.Electron.framework 0x000000010c12a51f v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17417423
5 com.github.Electron.framework 0x000000010c12a37d v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17417005
6 com.github.Electron.framework 0x000000010c14f8b7 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17569895
7 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
8 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 28:: NetworkConfigWatcher
0 libsystem_kernel.dylib 0x00007fff7253bdfa mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff7253c170 mach_msg + 60
2 com.apple.CoreFoundation 0x00007fff3838fef5 __CFRunLoopServiceMachPort + 247
3 com.apple.CoreFoundation 0x00007fff3838e9c2 __CFRunLoopRun + 1319
4 com.apple.CoreFoundation 0x00007fff3838de3e CFRunLoopRunSpecific + 462
5 com.apple.Foundation 0x00007fff3aa291c8 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
6 com.github.Electron.framework 0x000000010c155c59 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17595401
7 com.github.Electron.framework 0x000000010c154b92 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17591106
8 com.github.Electron.framework 0x000000010c116a91 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17336897
9 com.github.Electron.framework 0x000000010c0ec8da v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17164426
10 com.github.Electron.framework 0x000000010c13339a v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17453898
11 com.github.Electron.framework 0x000000010c14f8b7 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17569895
12 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
13 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 29:: ThreadPoolForegroundWorker
0 libsystem_kernel.dylib 0x00007fff7253bdfa mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff7253c170 mach_msg + 60
2 com.github.Electron.framework 0x000000010c15a8a0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17614928
3 com.github.Electron.framework 0x000000010c129ebe v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17415790
4 com.github.Electron.framework 0x000000010c12a6de v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17417870
5 com.github.Electron.framework 0x000000010c12a40d v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17417149
6 com.github.Electron.framework 0x000000010c14f8b7 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17569895
7 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
8 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 30:: ThreadPoolForegroundWorker
0 libsystem_kernel.dylib 0x00007fff7253bdfa mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff7253c170 mach_msg + 60
2 com.github.Electron.framework 0x000000010c15a8a0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17614928
3 com.github.Electron.framework 0x000000010c129ebe v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17415790
4 com.github.Electron.framework 0x000000010c12a6de v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17417870
5 com.github.Electron.framework 0x000000010c12a40d v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17417149
6 com.github.Electron.framework 0x000000010c14f8b7 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17569895
7 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
8 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 31:: ThreadPoolForegroundWorker
0 libsystem_kernel.dylib 0x00007fff7253bdfa mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff7253c170 mach_msg + 60
2 com.github.Electron.framework 0x000000010c15a8a0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17614928
3 com.github.Electron.framework 0x000000010c129ebe v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17415790
4 com.github.Electron.framework 0x000000010c12a51f v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17417423
5 com.github.Electron.framework 0x000000010c12a40d v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17417149
6 com.github.Electron.framework 0x000000010c14f8b7 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17569895
7 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
8 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 32:: CacheThread_BlockFile
0 libsystem_kernel.dylib 0x00007fff72544b96 kevent64 + 10
1 com.github.Electron.framework 0x000000010c167c06 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17669046
2 com.github.Electron.framework 0x000000010c167aeb v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17668763
3 com.github.Electron.framework 0x000000010c116a91 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17336897
4 com.github.Electron.framework 0x000000010c0ec8da v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17164426
5 com.github.Electron.framework 0x000000010c13339a v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17453898
6 com.github.Electron.framework 0x000000010c14f8b7 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17569895
7 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
8 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 33:
0 libsystem_pthread.dylib 0x00007fff725fab68 start_wqthread + 0

Thread 34:: ThreadPoolSingleThreadSharedBackgroundBlocking1
0 libsystem_kernel.dylib 0x00007fff7253bdfa mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff7253c170 mach_msg + 60
2 com.github.Electron.framework 0x000000010c15a8a0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17614928
3 com.github.Electron.framework 0x000000010c15a76e v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17614622
4 com.github.Electron.framework 0x000000010c129ecd v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17415805
5 com.github.Electron.framework 0x000000010c12a51f v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17417423
6 com.github.Electron.framework 0x000000010c12a3ad v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17417053
7 com.github.Electron.framework 0x000000010c14f8b7 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 17569895
8 libsystem_pthread.dylib 0x00007fff725ff109 _pthread_start + 148
9 libsystem_pthread.dylib 0x00007fff725fab8b thread_start + 15

Thread 35:
0 libsystem_pthread.dylib 0x00007fff725fab68 start_wqthread + 0

Thread 36:
0 libsystem_pthread.dylib 0x00007fff725fab68 start_wqthread + 0

Thread 37:
0 libsystem_pthread.dylib 0x00007fff725fab68 start_wqthread + 0

Thread 38:
0 libsystem_pthread.dylib 0x00007fff725fab68 start_wqthread + 0

Thread 39:
0 libsystem_pthread.dylib 0x00007fff725fab68 start_wqthread + 0

Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x0000000000000307 rbx: 0x8000000000000020 rcx: 0x0000000000000000 rdx: 0x0000000000107770
rdi: 0x0000000000000002 rsi: 0x00007fcfe0f00000 rbp: 0x00007ffee64ad530 rsp: 0x00007ffee64ad3a0
r8: 0x0000000000004b29 r9: 0x0000000000000001 r10: 0x00007fcfe0f00000 r11: 0x00007fcfe0f2aed0
r12: 0x00007fcfe0f4f300 r13: 0x000000000000001f r14: 0x000000010ff0eaf2 r15: 0x00007ffee64ad4f0
rip: 0x00000001098d6ebb rfl: 0x0000000000010202 cr2: 0x0000000000000000

Logical CPU: 4
Error Code: 0x00000006 (no mapping for user data write)
Trap Number: 14

Binary Images:
0x10974e000 - 0x109775ff3 +com.github.Electron (10.1.1 - 10.1.1) <5CF444E6-280A-33A3-87FF-B5

@kneth
Copy link
Contributor

kneth commented Sep 7, 2020

I notice one particular line in the stack trace: v8::internal::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*). It seems that you are running out of memory. Also, I notice ReadOnly portion of Libraries: Total=806.2M resident=0K(0%) swapped_out_or_unallocated=806.2M(100%).

How large is your Realm file?

@maximilize
Copy link
Author

I tested this also with the code snipped above, and created a test repo here: https://github.com/maximilize/electron-realm-crash

The realm is empty. The crash happens also when only the realm database was opened (new Realm()).
Of course the error also happens if there are calls to realm.objects or similar.

Actually, is realm in combination with electron used in production projects?
Since I was not able to find a solution to this, we will switch to sqlite now.

@kneth
Copy link
Contributor

kneth commented Oct 7, 2020

@maximilize We are using Electron internally in Realm Studio, and we are in the process of documenting what we support.

@RealmBot RealmBot closed this as completed Oct 7, 2020
@xatuke
Copy link

xatuke commented Nov 4, 2020

Any updates on this? @kneth

@kneth
Copy link
Contributor

kneth commented Nov 5, 2020

@blagoev Can you provide any insights or updates?

@kneth
Copy link
Contributor

kneth commented Nov 5, 2020

We need to reopen the issue and investigate it further.

@kneth kneth reopened this Nov 5, 2020
@kraenhansen
Copy link
Member

We believe #4237 fixed this, please try upgrading to the latest version and reopen if the issue remains.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants