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 app closes #4150

Closed
abhishekmatta999 opened this issue Dec 15, 2021 · 30 comments · Fixed by #4237
Closed

Electron app crashes after app closes #4150

abhishekmatta999 opened this issue Dec 15, 2021 · 30 comments · Fixed by #4237

Comments

@abhishekmatta999
Copy link

abhishekmatta999 commented Dec 15, 2021

How frequently does the bug occur?

All the time

Description

Electron app crashes with realm when the app is closed.
Here's the crash report:

{code:Process}
Path: /Applications/Documents_Development.app/Contents/MacOS/Documents_Development
Identifier: onl.accura.electron.app
Version: 2.3.57 (2.3.57.91)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Documents_Development [34737]
User ID: 501

Date/Time: 2021-12-15 18:27:10.012 +0530
OS Version: macOS 11.5.2 (20G95)
Report Version: 12
Bridge OS Version: 5.5 (18P4759a)
Anonymous UUID: D17C99DC-FF05-A368-58B5-B786E3FDF5A1

Sleep/Wake UUID: 7C9C47EC-B52B-4E38-83E9-10B324F9D343

Time Awake Since Boot: 170000 seconds
Time Since Wake: 31000 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 [34737]

VM Regions Near 0:
-->
__TEXT 10dde5000-10de39000 [ 336K] r-x/r-x SM=COW /Applications/Documents_Development.app/Contents/MacOS/Documents_Development

Thread 0 Crashed:: CrBrowserMain Dispatch queue: com.apple.main-thread
0 com.github.Electron.framework 0x0000000111a27f8e v8::internal::GlobalHandles::MakeWeak(unsigned long*, void*, void ()(v8::WeakCallbackInfo const&), v8::WeakCallbackType) + 14
1 com.github.Electron.framework 0x0000000113a524fa napi_reference_unref + 74
2 .onl.accura.electron.app.FK4HR1 0x000000011aa73aee realm::node::ProtectedNapi::Function::~Protected() + 46
3 .onl.accura.electron.app.FK4HR1 0x000000011aa6ed22 std::__1::__function::__func<realm::js::SyncSessionErrorHandlerFunctorrealm::node::Types, std::__1::allocator<realm::js::SyncSessionErrorHandlerFunctorrealm::node::Types >, void (std::__1::shared_ptrrealm::SyncSession, realm::SyncError)>::destroy_deallocate() + 18
4 .onl.accura.electron.app.FK4HR1 0x000000011aa71e31 std::__1::__function::__func<realm::util::EventLoopDispatcher<void (std::__1::shared_ptrrealm::SyncSession, realm::SyncError)>::EventLoopDispatcher(std::__1::function<void (std::__1::shared_ptrrealm::SyncSession, realm::SyncError)>)::'lambda'(), std::__1::allocator<realm::util::EventLoopDispatcher<void (std::__1::shared_ptrrealm::SyncSession, realm::SyncError)>::EventLoopDispatcher(std::__1::function<void (std::__1::shared_ptrrealm::SyncSession, realm::SyncError)>)::'lambda'()>, void ()>::destroy() + 49
5 .onl.accura.electron.app.FK4HR1 0x000000011ac942ce realm::util::UvMainLoopScheduler::set_notify_callback(std::__1::function<void ()>)::'lambda'(uv_async_s
)::operator()(uv_async_s*) const::'lambda'(uv_handle_s*)::__invoke(uv_handle_s*) + 46
6 com.github.Electron.framework 0x0000000111349624 uv_run + 580
7 com.github.Electron.framework 0x0000000113a3eb63 node::EmitAsyncDestroy(node::Environment*, node::async_context) + 236163
8 com.github.Electron.framework 0x0000000113a3f04d node::EmitAsyncDestroy(node::Environment*, node::async_context) + 237421
9 com.github.Electron.framework 0x0000000113a01f93 node::FreeEnvironment(node::Environment*) + 99
10 com.github.Electron.framework 0x0000000111434605 ElectronInitializeICUandStartNode + 890757
11 com.github.Electron.framework 0x000000011142aec4 ElectronInitializeICUandStartNode + 852036
12 com.github.Electron.framework 0x00000001121afaac v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 2183260
13 com.github.Electron.framework 0x00000001121b12ba v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 2189418
14 com.github.Electron.framework 0x00000001121acbb5 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 2171237
15 com.github.Electron.framework 0x000000011190fa36 electron::fuses::IsRunAsNodeEnabled() + 4146790
16 com.github.Electron.framework 0x000000011190f743 electron::fuses::IsRunAsNodeEnabled() + 4146035
17 com.github.Electron.framework 0x000000011190e410 electron::fuses::IsRunAsNodeEnabled() + 4141120
18 com.github.Electron.framework 0x000000011190e8d2 electron::fuses::IsRunAsNodeEnabled() + 4142338
19 com.github.Electron.framework 0x000000011135ae48 ElectronMain + 136
20 onl.accura.electron.app 0x000000010dde8426 0x10dde5000 + 13350
21 libdyld.dylib 0x00007fff2037cf3d start + 1

Thread 1:: ThreadPoolServiceThread
0 libsystem_kernel.dylib 0x00007fff203351d2 kevent64 + 10
1 com.github.Electron.framework 0x000000011259e59a v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6306634
2 com.github.Electron.framework 0x000000011259e4be v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6306414
3 com.github.Electron.framework 0x000000011255ad8f v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6030143
4 com.github.Electron.framework 0x00000001125380a9 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 5887577
5 com.github.Electron.framework 0x0000000112563b8d v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6066493
6 com.github.Electron.framework 0x0000000112574179 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6133545
7 com.github.Electron.framework 0x0000000112589c88 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6222392
8 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
9 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

Thread 2:: ThreadPoolBackgroundWorker
0 libsystem_kernel.dylib 0x00007fff2032c2ba mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff2032c62c mach_msg + 60
2 com.github.Electron.framework 0x0000000112591c67 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6255127
3 com.github.Electron.framework 0x000000011256b99e v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6098766
4 com.github.Electron.framework 0x000000011256c1aa v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6100826
5 com.github.Electron.framework 0x000000011256be4d v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6099965
6 com.github.Electron.framework 0x0000000112589c88 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6222392
7 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
8 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

Thread 3:: Chrome_IOThread
0 libsystem_kernel.dylib 0x00007fff203351d2 kevent64 + 10
1 com.github.Electron.framework 0x000000011259e59a v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6306634
2 com.github.Electron.framework 0x000000011259e4be v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6306414
3 com.github.Electron.framework 0x000000011255ad8f v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6030143
4 com.github.Electron.framework 0x00000001125380a9 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 5887577
5 com.github.Electron.framework 0x00000001121b181f v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 2190799
6 com.github.Electron.framework 0x0000000112574179 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6133545
7 com.github.Electron.framework 0x0000000112589c88 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6222392
8 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
9 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

Thread 4:: MemoryInfra
0 libsystem_kernel.dylib 0x00007fff2032c2ba mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff2032c62c mach_msg + 60
2 com.github.Electron.framework 0x0000000112591c67 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6255127
3 com.github.Electron.framework 0x0000000112591aee v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6254750
4 com.github.Electron.framework 0x0000000112521500 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 5794480
5 com.github.Electron.framework 0x000000011255ad8f v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6030143
6 com.github.Electron.framework 0x00000001125380a9 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 5887577
7 com.github.Electron.framework 0x0000000112574179 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6133545
8 com.github.Electron.framework 0x0000000112589c88 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6222392
9 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
10 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

Thread 5:
0 libsystem_kernel.dylib 0x00007fff20330c4a kevent + 10
1 com.github.Electron.framework 0x000000011135a42a uv_free_interface_addresses + 1322
2 com.github.Electron.framework 0x000000011134954c uv_run + 364
3 com.github.Electron.framework 0x0000000113af80ef node::MultiIsolatePlatform::CancelPendingDelayedTasks(v8::Isolate*) + 687
4 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
5 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

Thread 6:
0 libsystem_kernel.dylib 0x00007fff2032ecde __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff20361e49 _pthread_cond_wait + 1298
2 com.github.Electron.framework 0x00000001113554f9 uv_cond_wait + 9
3 com.github.Electron.framework 0x0000000113af82c2 node::MultiIsolatePlatform::CancelPendingDelayedTasks(v8::Isolate*) + 1154
4 com.github.Electron.framework 0x0000000113af5b87 node::OnFatalError(char const*, char const*) + 438327
5 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
6 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

Thread 7:
0 libsystem_kernel.dylib 0x00007fff2032ecde __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff20361e49 _pthread_cond_wait + 1298
2 com.github.Electron.framework 0x00000001113554f9 uv_cond_wait + 9
3 com.github.Electron.framework 0x0000000113af82c2 node::MultiIsolatePlatform::CancelPendingDelayedTasks(v8::Isolate*) + 1154
4 com.github.Electron.framework 0x0000000113af5b87 node::OnFatalError(char const*, char const*) + 438327
5 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
6 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

Thread 8:
0 libsystem_kernel.dylib 0x00007fff2032ecde __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff20361e49 _pthread_cond_wait + 1298
2 com.github.Electron.framework 0x00000001113554f9 uv_cond_wait + 9
3 com.github.Electron.framework 0x0000000113af82c2 node::MultiIsolatePlatform::CancelPendingDelayedTasks(v8::Isolate*) + 1154
4 com.github.Electron.framework 0x0000000113af5b87 node::OnFatalError(char const*, char const*) + 438327
5 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
6 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

Thread 9:
0 libsystem_kernel.dylib 0x00007fff2032c2f6 semaphore_wait_trap + 10
1 com.github.Electron.framework 0x0000000111355aa0 uv_sem_wait + 16
2 com.github.Electron.framework 0x0000000113b5f383 node::SetTracingController(v8::TracingController*) + 65091
3 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
4 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

Thread 10:: NetworkConfigWatcher
0 libsystem_kernel.dylib 0x00007fff2032c2ba mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff2032c62c mach_msg + 60
2 com.apple.CoreFoundation 0x00007fff2045ab2f __CFRunLoopServiceMachPort + 316
3 com.apple.CoreFoundation 0x00007fff2045920f __CFRunLoopRun + 1328
4 com.apple.CoreFoundation 0x00007fff2045861c CFRunLoopRunSpecific + 563
5 com.apple.Foundation 0x00007fff211e8607 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
6 com.github.Electron.framework 0x000000011258ea24 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6242260
7 com.github.Electron.framework 0x000000011258da6b v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6238235
8 com.github.Electron.framework 0x000000011255ad8f v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6030143
9 com.github.Electron.framework 0x00000001125380a9 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 5887577
10 com.github.Electron.framework 0x0000000112574179 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6133545
11 com.github.Electron.framework 0x0000000112589c88 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6222392
12 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
13 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

Thread 11:: CrShutdownDetector
0 libsystem_kernel.dylib 0x00007fff2032ccce read + 10
1 com.github.Electron.framework 0x00000001115058cf ElectronInitializeICUandStartNode + 1747535
2 com.github.Electron.framework 0x0000000112589c88 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6222392
3 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
4 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

Thread 12:: NetworkConfigWatcher
0 libsystem_kernel.dylib 0x00007fff2032c2ba mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff2032c62c mach_msg + 60
2 com.apple.CoreFoundation 0x00007fff2045ab2f __CFRunLoopServiceMachPort + 316
3 com.apple.CoreFoundation 0x00007fff2045920f __CFRunLoopRun + 1328
4 com.apple.CoreFoundation 0x00007fff2045861c CFRunLoopRunSpecific + 563
5 com.apple.Foundation 0x00007fff211e8607 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
6 com.github.Electron.framework 0x000000011258ea24 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6242260
7 com.github.Electron.framework 0x000000011258da6b v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6238235
8 com.github.Electron.framework 0x000000011255ad8f v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6030143
9 com.github.Electron.framework 0x00000001125380a9 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 5887577
10 com.github.Electron.framework 0x0000000112574179 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6133545
11 com.github.Electron.framework 0x0000000112589c88 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6222392
12 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
13 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

Thread 13:: ThreadPoolForegroundWorker
0 libsystem_kernel.dylib 0x00007fff2032c2ba mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff2032c62c mach_msg + 60
2 com.github.Electron.framework 0x0000000112591c67 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6255127
3 com.github.Electron.framework 0x000000011256b99e v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6098766
4 com.github.Electron.framework 0x000000011256c1aa v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6100826
5 com.github.Electron.framework 0x000000011256bead v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6100061
6 com.github.Electron.framework 0x0000000112589c88 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6222392
7 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
8 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

Thread 14:: CompositorTileWorker1
0 libsystem_kernel.dylib 0x00007fff2032ecde __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff20361e49 _pthread_cond_wait + 1298
2 com.github.Electron.framework 0x0000000112589260 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6219792
3 com.github.Electron.framework 0x0000000112c50e55 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 13329413
4 com.github.Electron.framework 0x0000000112589c88 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6222392
5 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
6 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

Thread 15:: ThreadPoolSingleThreadForegroundBlocking0
0 libsystem_kernel.dylib 0x00007fff20331a8a __wait4 + 10
1 com.github.Electron.framework 0x000000011569d92d v8::internal::compiler::ZoneStats::GetCurrentAllocatedBytes() const + 12711053
2 com.github.Electron.framework 0x000000011501ee6e v8::internal::compiler::ZoneStats::GetCurrentAllocatedBytes() const + 5900750
3 com.github.Electron.framework 0x0000000114c8d865 v8::internal::compiler::ZoneStats::GetCurrentAllocatedBytes() const + 2159557
4 com.github.Electron.framework 0x000000011254bce9 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 5968537
5 com.github.Electron.framework 0x0000000112565657 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6073351
6 com.github.Electron.framework 0x0000000112564d92 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6071106
7 com.github.Electron.framework 0x000000011258988c v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6221372
8 com.github.Electron.framework 0x0000000112564869 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6069785
9 com.github.Electron.framework 0x000000011256c0d4 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6100612
10 com.github.Electron.framework 0x000000011256bf0d v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6100157
11 com.github.Electron.framework 0x0000000112589c88 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6222392
12 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
13 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

Thread 16:
0 libsystem_kernel.dylib 0x00007fff2032c2f6 semaphore_wait_trap + 10
1 com.github.Electron.framework 0x0000000111355aa0 uv_sem_wait + 16
2 com.github.Electron.framework 0x00000001114adda9 ElectronInitializeICUandStartNode + 1388329
3 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
4 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

Thread 17:: ThreadPoolSingleThreadSharedForegroundBlocking1
0 libsystem_kernel.dylib 0x00007fff2032c2ba mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff2032c62c mach_msg + 60
2 com.github.Electron.framework 0x0000000112591c67 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6255127
3 com.github.Electron.framework 0x0000000112591aee v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6254750
4 com.github.Electron.framework 0x000000011256b9ad v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6098781
5 com.github.Electron.framework 0x000000011256bfd1 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6100353
6 com.github.Electron.framework 0x000000011256bedd v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6100109
7 com.github.Electron.framework 0x0000000112589c88 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6222392
8 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
9 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

Thread 18:: NetworkConfigWatcher
0 libsystem_kernel.dylib 0x00007fff2032c2ba mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff2032c62c mach_msg + 60
2 com.apple.CoreFoundation 0x00007fff2045ab2f __CFRunLoopServiceMachPort + 316
3 com.apple.CoreFoundation 0x00007fff2045920f __CFRunLoopRun + 1328
4 com.apple.CoreFoundation 0x00007fff2045861c CFRunLoopRunSpecific + 563
5 com.apple.Foundation 0x00007fff211e8607 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
6 com.github.Electron.framework 0x000000011258ea24 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6242260
7 com.github.Electron.framework 0x000000011258da6b v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6238235
8 com.github.Electron.framework 0x000000011255ad8f v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6030143
9 com.github.Electron.framework 0x00000001125380a9 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 5887577
10 com.github.Electron.framework 0x0000000112574179 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6133545
11 com.github.Electron.framework 0x0000000112589c88 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6222392
12 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
13 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

Thread 19:: CacheThread_BlockFile
0 libsystem_kernel.dylib 0x00007fff203351d2 kevent64 + 10
1 com.github.Electron.framework 0x000000011259e59a v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6306634
2 com.github.Electron.framework 0x000000011259e4be v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6306414
3 com.github.Electron.framework 0x000000011255ad8f v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6030143
4 com.github.Electron.framework 0x00000001125380a9 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 5887577
5 com.github.Electron.framework 0x0000000112574179 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6133545
6 com.github.Electron.framework 0x0000000112589c88 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6222392
7 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
8 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

Thread 20:
0 libsystem_kernel.dylib 0x00007fff2032ecde __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff20361e49 _pthread_cond_wait + 1298
2 com.github.Electron.framework 0x00000001113554f9 uv_cond_wait + 9
3 com.github.Electron.framework 0x00000001113456a0 uv_cancel + 512
4 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
5 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

Thread 21:
0 libsystem_kernel.dylib 0x00007fff2032ecde __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff20361e49 _pthread_cond_wait + 1298
2 com.github.Electron.framework 0x00000001113554f9 uv_cond_wait + 9
3 com.github.Electron.framework 0x00000001113456a0 uv_cancel + 512
4 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
5 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

Thread 22:
0 libsystem_kernel.dylib 0x00007fff2032ecde __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff20361e49 _pthread_cond_wait + 1298
2 com.github.Electron.framework 0x00000001113554f9 uv_cond_wait + 9
3 com.github.Electron.framework 0x00000001113456a0 uv_cancel + 512
4 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
5 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

Thread 23:
0 libsystem_kernel.dylib 0x00007fff2032ecde __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff20361e49 _pthread_cond_wait + 1298
2 com.github.Electron.framework 0x00000001113554f9 uv_cond_wait + 9
3 com.github.Electron.framework 0x00000001113456a0 uv_cancel + 512
4 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
5 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

Thread 24:: com.apple.NSEventThread
0 libsystem_kernel.dylib 0x00007fff2032c2ba mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff2032c62c mach_msg + 60
2 com.apple.CoreFoundation 0x00007fff2045ab2f __CFRunLoopServiceMachPort + 316
3 com.apple.CoreFoundation 0x00007fff2045920f __CFRunLoopRun + 1328
4 com.apple.CoreFoundation 0x00007fff2045861c CFRunLoopRunSpecific + 563
5 com.apple.AppKit 0x00007fff22de623a _NSEventThread + 124
6 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
7 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

Thread 25:: ThreadPoolSingleThreadSharedBackgroundBlocking2
0 libsystem_kernel.dylib 0x00007fff2032c2ba mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff2032c62c mach_msg + 60
2 com.github.Electron.framework 0x0000000112591c67 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6255127
3 com.github.Electron.framework 0x0000000112591aee v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6254750
4 com.github.Electron.framework 0x000000011256b9ad v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6098781
5 com.github.Electron.framework 0x000000011256bfd1 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6100353
6 com.github.Electron.framework 0x000000011256be7d v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6100013
7 com.github.Electron.framework 0x0000000112589c88 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6222392
8 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
9 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

Thread 26:: NetworkConfigWatcher
0 libsystem_kernel.dylib 0x00007fff2032c2ba mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff2032c62c mach_msg + 60
2 com.apple.CoreFoundation 0x00007fff2045ab2f __CFRunLoopServiceMachPort + 316
3 com.apple.CoreFoundation 0x00007fff2045920f __CFRunLoopRun + 1328
4 com.apple.CoreFoundation 0x00007fff2045861c CFRunLoopRunSpecific + 563
5 com.apple.Foundation 0x00007fff211e8607 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
6 com.github.Electron.framework 0x000000011258ea24 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6242260
7 com.github.Electron.framework 0x000000011258da6b v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6238235
8 com.github.Electron.framework 0x000000011255ad8f v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6030143
9 com.github.Electron.framework 0x00000001125380a9 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 5887577
10 com.github.Electron.framework 0x0000000112574179 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6133545
11 com.github.Electron.framework 0x0000000112589c88 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6222392
12 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
13 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

Thread 27:
0 libsystem_malloc.dylib 0x00007fff2018d305 tiny_free_no_lock + 250
1 libsystem_malloc.dylib 0x00007fff2018d0c9 free_tiny + 442
2 com.apple.CoreFoundation 0x00007fff205256ef _CFRelease + 1145
3 com.apple.CoreFoundation 0x00007fff203fb583 RELEASE_OBJECTS_IN_THE_ARRAY + 118
4 com.apple.CoreFoundation 0x00007fff203fb4c6 -[__NSArrayM dealloc] + 279
5 com.apple.security 0x00007fff222f8f22 SecTrustDestroy + 59
6 com.apple.CoreFoundation 0x00007fff2052536a _CFRelease + 244
7 com.apple.security 0x00007fff2247adcb SSLContextDestroy + 433
8 com.apple.CoreFoundation 0x00007fff2052536a _CFRelease + 244
9 .onl.accura.electron.app.FK4HR1 0x000000011ae215d7 realm::util::network::ssl::Stream::ssl_destroy() + 23
10 .onl.accura.electron.app.FK4HR1 0x000000011ae31580 realm::util::websocket::(anonymous namespace)::EZSocketImpl::~EZSocketImpl() + 128
11 .onl.accura.electron.app.FK4HR1 0x000000011ae3164e realm::util::websocket::(anonymous namespace)::EZSocketImpl::~EZSocketImpl() + 14
12 .onl.accura.electron.app.FK4HR1 0x000000011adbcc6a realm::sync::ClientImpl::Connection::disconnect(std::__1::error_code, bool, realm::StringData*) + 874
13 .onl.accura.electron.app.FK4HR1 0x000000011adbc0e7 realm::sync::ClientImpl::Connection::handle_disconnect_wait(std::__1::error_code) + 151
14 .onl.accura.electron.app.FK4HR1 0x000000011adc4ece realm::util::network::DeadlineTimer::WaitOperrealm::sync::ClientImpl::Connection::initiate_disconnect_wait()::$_8::recycle_and_execute() + 222
15 .onl.accura.electron.app.FK4HR1 0x000000011ae234e4 realm::util::network::Service::Impl::run() + 484
16 .onl.accura.electron.app.FK4HR1 0x000000011ade7a3d realm::sync::Client::run() + 29
17 .onl.accura.electron.app.FK4HR1 0x000000011acd6f6d 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::SyncClient::SyncClient(std::__1::unique_ptr<realm::util::Logger, std::__1::default_deleterealm::util::Logger >, realm::SyncClientConfig const&, std::__1::weak_ptr<realm::SyncManager const>)::'lambda0'()> >(void*) + 45
18 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
19 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

Thread 28:
0 libsystem_kernel.dylib 0x00007fff2032ecde __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff20361e49 _pthread_cond_wait + 1298
2 .onl.accura.electron.app.FK4HR1 0x000000011ae264a2 realm::util::network::Service::Impl::resolver_thread() + 178
3 .onl.accura.electron.app.FK4HR1 0x000000011ae2637d void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_deletestd::__1::__thread_struct >, realm::util::network::Service::Impl::add_resolve_oper(std::__1::unique_ptr<realm::util::network::Service::ResolveOperBase, realm::util::network::Service::LendersOperDeleter>)::'lambda'()> >(void*) + 45
4 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
5 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

Thread 29:
0 libsystem_pthread.dylib 0x00007fff2035d420 start_wqthread + 0

Thread 30:
0 libsystem_pthread.dylib 0x00007fff2035d420 start_wqthread + 0

Thread 31:
0 libsystem_pthread.dylib 0x00007fff2035d420 start_wqthread + 0

Thread 32:: ThreadPoolForegroundWorker
0 libsystem_kernel.dylib 0x00007fff2032c2ba mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff2032c62c mach_msg + 60
2 com.github.Electron.framework 0x0000000112591c67 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6255127
3 com.github.Electron.framework 0x000000011256b99e v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6098766
4 com.github.Electron.framework 0x000000011256c1aa v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6100826
5 com.github.Electron.framework 0x000000011256bead v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6100061
6 com.github.Electron.framework 0x0000000112589c88 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6222392
7 libsystem_pthread.dylib 0x00007fff203618fc _pthread_start + 224
8 libsystem_pthread.dylib 0x00007fff2035d443 thread_start + 15

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

Thread 34:: ThreadPoolForegroundWorker
0 libsystem_kernel.dylib 0x00007fff2032c2ba mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff2032c62c mach_msg + 60
2 com.github.Electron.framework 0x0000000112591c67 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 6255127
3 com.github.E

@takameyer
Copy link
Contributor

@abhishekmatta999 Thanks for reporting, we will have to investigate. What version of Node are you using?

@abhishekmatta999
Copy link
Author

@takameyer please find the below versions.
Node: 14.17.1
Electron: 12.0.0
realm: 10.4.0

@takameyer
Copy link
Contributor

@abhishekmatta999 Thank you! Can you verify if this happens with the latest version (10.10.1) of Realm?

@abhishekmatta999
Copy link
Author

@takameyer No It's throwing the same error with realm(10.10.1)

@abhishekmatta999
Copy link
Author

@takameyer Any update/workaround for this?

@takameyer
Copy link
Contributor

@abhishekmatta999 I just made an electron app that is using Realm, on MacOS. Unfortunately, I was unable to reproduce the issue. Are there any details you can provide to help us pinpoint the issue? An example app would be most helpful.

@sync-by-unito sync-by-unito bot added Reproduction-Required Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Dec 17, 2021
@abhishekmatta999
Copy link
Author

@abhishekmatta999 I just made an electron app that is using Realm, on MacOS. Unfortunately, I was unable to reproduce the issue. Are there any details you can provide to help us pinpoint the issue? An example app would be most helpful.

If I share my package.json will it work?

@github-actions github-actions bot added Needs-Attention Reporter has responded. Review comment. and removed Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Dec 17, 2021
@takameyer
Copy link
Contributor

Anything helps. Whatever you think might be conflicting with Realm

@sync-by-unito sync-by-unito bot removed the Needs-Attention Reporter has responded. Review comment. label Dec 20, 2021
@realm realm deleted a comment from sync-by-unito bot Dec 20, 2021
@sync-by-unito sync-by-unito bot added the Waiting-For-Reporter Waiting for more information from the reporter before we can proceed label Dec 20, 2021
@abhishekmatta999
Copy link
Author

package.json file.
{ "name”: ””, "version": "2.4.1", "description": "", "author": ", "scripts": { "test:unit": "jest", "lint": "eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter src", "build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js", "build:dev": "DOTENV_CONFIG_PATH=./.env.development node -r dotenv/config .electron-vue/build.js && electron-builder", "build:dir": "node .electron-vue/build.js && electron-builder --dir", "build:prod": "DOTENV_CONFIG_PATH=./.env.production node -r dotenv/config .electron-vue/build.js && electron-builder", "build:stage": "DOTENV_CONFIG_PATH=./.env.staging node -r dotenv/config .electron-vue/build.js && electron-builder", "build:web": "cross-env BUILD_TARGET=web node .electron-vue/build.js", "deploy:app": "gulp deploy:app", "deploy:app:web": "gulp deploy:app && gulp deploy:web", "deploy:web": "gulp deploy:web", "dev": "DOTENV_CONFIG_PATH=./.env.development node -r dotenv/config .electron-vue/dev-runner.js", "dev:prod": "DOTENV_CONFIG_PATH=./.env.production node -r dotenv/config .electron-vue/dev-runner.js", "dev:stage": "DOTENV_CONFIG_PATH=./.env.staging node -r dotenv/config .electron-vue/dev-runner.js", "e2e": "npm run pack && mocha --compilers js:babel-core/register test/e2e", "i18n:report": "vue-cli-service i18n:report --src './src/**/*.?(js|vue)' --locales './src/locales/**/*.json'", "lint:fix": "eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter --fix src", "pack": "npm run pack:main && npm run pack:renderer", "pack:main": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.main.config.js", "pack:renderer": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.renderer.config.js", "postinstall": "npm run lint:fix", "test": "npm run unit && npm run e2e", "unit": "karma start test/unit/karma.conf.js", "preshrinkwrap": "git checkout -- npm-shrinkwrap.json", "postshrinkwrap": "git checkout -- npm-shrinkwrap.json" }, "main": "./dist/electron/main.js", "dependencies": { "@apollo/client": "^3.4.11", "@panter/vue-i18next": "^0.13.0", "apollo-boost": "^0.4.9", "axios": "^0.21.1", "countrydata": "^2.0.1", "dotenv": "^6.2.0", "dotenv-webpack": "^1.5.7", "electron-push-receiver": "^2.1.3", "electron-storage": "^1.0.7", "electron-updater": "^4.3.8", "electron-window-state": "^5.0.3", "element-ui": "^2.14.0", "fs": "0.0.1-security", "graphql": "^15.5.0", "i18next": "^11.9.1", "i18next-locize-backend": "^1.6.0", "is-reachable": "^5.0.0", "lodash": "^4.17.10", "mongoose": "^5.13.7", "node-sass": "^4.13.0", "npm-outdated": "^0.1.3", "realm": "^10.10.1", "sass-loader": "^7.0.3", "systeminformation": "^5.7.7", "tv4": "^1.3.0", "vue": "^2.3.3", "vue-apollo": "^3.0.7", "vue-electron": "^1.0.6", "vue-i18n": "^8.17.3", "vue-infinite-loading": "^2.3.1", "vue-infinite-scroll": "^2.0.2", "vue-resize-directive": "^1.1.4", "vue-router": "^2.5.3", "vue-tables-2": "^1.4.63", "vuedraggable": "^2.16.0", "vuex": "^2.3.1", "workerpool": "^6.1.5" }, "devDependencies": { "@vue/cli-plugin-unit-jest": "^4.4.5", "@vue/test-utils": "^1.0.3", "babel-core": "^6.25.0", "babel-eslint": "^7.2.3", "babel-loader": "^7.1.1", "babel-plugin-istanbul": "^4.1.1", "babel-plugin-transform-runtime": "^6.23.0", "babel-preset-env": "^1.6.0", "babel-preset-es2015": "^6.24.1", "babel-preset-stage-0": "^6.24.1", "babel-register": "^6.24.1", "babili-webpack-plugin": "^0.1.2", "cfonts": "^1.1.3", "chai": "^4.0.0", "chalk": "^2.1.0", "copy-webpack-plugin": "^4.0.1", "cross-env": "^5.0.5", "css-loader": "^0.28.4", "del": "^3.0.0", "devtron": "^1.4.0", "electron": "^12.0.0", "electron-builder": "^22.10.5", "electron-debug": "^1.4.0", "electron-devtools-installer": "^2.2.0", "electron-log": "^4.3.1", "electron-notarize": "^1.0.0", "electron-publisher-s3": "^20.17.2", "envalid": "^4.1.4", "eslint": "^4.19.1", "eslint-config-standard": "^10.2.1", "eslint-friendly-formatter": "^3.0.0", "eslint-loader": "^1.9.0", "eslint-plugin-html": "^3.1.1", "eslint-plugin-import": "^2.7.0", "eslint-plugin-node": "^5.1.1", "eslint-plugin-promise": "^3.5.0", "eslint-plugin-standard": "^3.0.1", "extract-text-webpack-plugin": "^3.0.0", "file-loader": "^0.11.2", "gulp": "^3.9.1", "gulp-s3-upload": "^1.7.0", "gulp-shell": "^0.6.5", "html-webpack-plugin": "^2.30.1", "inject-loader": "^3.0.0", "karma": "^1.3.0", "karma-chai": "^0.1.0", "karma-coverage": "^1.1.1", "karma-electron": "^5.1.1", "karma-mocha": "^1.2.0", "karma-sourcemap-loader": "^0.3.7", "karma-spec-reporter": "^0.0.31", "karma-webpack": "^2.0.1", "mocha": "^3.0.2", "multispinner": "^0.2.1", "node-loader": "^0.6.0", "require-dir": "^0.3.0", "spectron": "^3.7.1", "style-loader": "^0.18.2", "url-loader": "^0.5.9", "vue-cli-plugin-i18n": "~1.0.1", "vue-html-loader": "^1.2.4", "vue-loader": "^13.0.5", "vue-style-loader": "^3.0.1", "vue-template-compiler": "^2.4.2", "webpack": "^3.5.2", "webpack-dev-server": "^2.7.1", "webpack-hot-middleware": "^2.18.2", "webpack-merge": "^4.1.0" }, "build": { "productName": “****”, "appId": “****”, "artifactName": “***”, "afterSign": "notarise.js", "directories": { "output": "build" }, "extraResources": [ { "from": "./src/renderer/assets/", "to": "assets", "filter": [ "**/*" ] } ], "files": [ "dist/electron/**/*", "!node_modules/realm/android${/*}", "!node_modules/realm/react-native${/*}", "!node_modules/realm/scripts${/*}", "!node_modules/realm/src${/*}", "!node_modules/realm/vendor${/*}" ], "dmg": { "contents": [ { "x": 410, "y": 150, "type": "link", "path": "/Applications" }, { "x": 130, "y": 150, "type": "file" } ] }, "mac": { "target": [ "dmg", "zip" ], } }, "license": “****” }

@github-actions github-actions bot added Needs-Attention Reporter has responded. Review comment. and removed Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Dec 20, 2021
@abhishekmatta999
Copy link
Author

@abhishekmatta999 I just made an electron app that is using Realm, on MacOS. Unfortunately, I was unable to reproduce the issue. Are there any details you can provide to help us pinpoint the issue? An example app would be most helpful.

I'm opening two realms one with realm sync and other local realm.
And I'm open realm sync on both threads i.e (main and renderer)

@tomduncalf
Copy link
Contributor

Hi @abhishekmatta999, I'm trying to reproduce this with a similar realm configuration to you, but I am unable to – the app exits without any errors.

Would you be able to share the relevant snippets of code for where you configure your Realms on both the main and renderer thread? Alternatively, if you'd be happy to share it, you could email your source code to me and I can take a look at your specific setup.

@sync-by-unito sync-by-unito bot added Waiting-For-Reporter Waiting for more information from the reporter before we can proceed and removed Needs-Attention Reporter has responded. Review comment. labels Dec 22, 2021
@abhishekmatta999
Copy link
Author

Hi @tomduncalf PFB the attached snippets.

This is my renderer configuration:
const realmPath = 'xyz.path' const config = { schema: syncSchema, path: getDBPath(realmPath), sync: true, }

Main thread's configuration:
config = { schema: syncSchema, path: getDBPath(realmPath), sync: { user: appRealm.currentUser, partitionValue: '--string--', // The behavior to use when this is the first time opening a realm. newRealmFileBehavior: {type: 'downloadBeforeOpen'}, // The behavior to use when a realm file already exists locally, // i.e. you have previously opened the realm. existingRealmFileBehavior: {type: 'openImmediately'}, error: (error) => { console.error('new realm error: ', error) } } }

@github-actions github-actions bot added Needs-Attention Reporter has responded. Review comment. and removed Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Dec 22, 2021
@tomduncalf
Copy link
Contributor

Thanks, I've set up a test app with this config and the same version of Electron as you, and am unable to reproduce the issue in debug mode. I am struggling to get my test app to build in release mode, do you also see the issue in debug mode?

I tried creating new items in a setInterval loop every 100ms to see if it could be related to write transactions being running when the app exits, but nothing changed.

What are the exact steps to reproduce? Do you just start the app, and then exit it? either via the X button or Cmd-Q/Alt-F4?

Can you think of any other information about what your app is doing which might be useful? Have you tried to narrow down the cause of the crash e.g. by removing functionality from the app until it stops crashing? If you're able to share your app code via email it would help us to debug the issue, but I understand this might not be possible for you.

Thanks,
Tom

@sync-by-unito sync-by-unito bot added Waiting-For-Reporter Waiting for more information from the reporter before we can proceed and removed Needs-Attention Reporter has responded. Review comment. labels Dec 23, 2021
@tomduncalf
Copy link
Contributor

Sorry, please ignore the above, I was able to reproduce your issue – it seems to be related to the error callback you are adding in the main thread configuration, without that it does not error and I had missed it in my initial tests.

I'll do some further investigation and get back to you.

@abhishekmatta999
Copy link
Author

@tomduncalf Thanks. I'll be waiting for your reply.

@github-actions github-actions bot added Needs-Attention Reporter has responded. Review comment. and removed Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Dec 23, 2021
@tomduncalf
Copy link
Contributor

Can you try removing the error parameter from your main Realm config and see if that helps for now? We will investigate this issue and follow up, but this may be a workaround for now.

@tomduncalf
Copy link
Contributor

tomduncalf commented Dec 23, 2021

Investigation notes

Issue is reproducible, see https://github.com/takameyer/electron-react-boilerplate/tree/td/issue4150

Steps to repro:

  1. npm start
  2. exit app
  3. Crash report appears

See stack trace in original issue – the issue seems to be related to having a custom sync error logger function, if this is removed the app does not crash.

I was not able to reproduce the issue with a Node app with an equivalent config, so may be Electron-specific https://github.com/tomduncalf/node4150


Can attach lldb to process:

  1. Start Electron app
  2. ps aux | grep "electron-reac"
  3. Get the PID of the process running Contents/MacOS/Electron -r ts-node/register/transpile-only ./src/main/main.ts
  4. lldb -p {pid}
  5. continue
  6. Quit app - lldb will pause at the point where the crash occurs: https://github.com/realm/realm-js/blob/master/src/node/node_protected.hpp#L101

The crash seems to be occurring internally in v8 as a result of calling napi_reference_unref - perhaps m_env or m_ref are invalid, maybe due to Electron apps closing down in a different way to Node apps?

Commenting out the destructor for Protected prevents the crash.

@tomduncalf
Copy link
Contributor

@abhishekmatta999

Only from main config or from both?

If you have it in both, try removing it from both. I could only see it in your main config – I've commented it out here to indicate exactly what I mean you should remove:

config = {
  schema: syncSchema,
  path: getDBPath(realmPath),
  sync: {
    user: appRealm.currentUser,
    partitionValue: "--string--", 
    newRealmFileBehavior: { type: "downloadBeforeOpen" },
    existingRealmFileBehavior: { type: "openImmediately" },
    /*error: (error) => {
      console.error("new realm error: ", error);
    },*/
  },
};

@sync-by-unito sync-by-unito bot removed the Needs-Attention Reporter has responded. Review comment. label Dec 23, 2021
@abhishekmatta999
Copy link
Author

@tomduncalf Thanks I have checked it's not throwing an error now after removing the custom error function.
But how can I add an error handler to handle error cases like client reset.

@tomduncalf
Copy link
Contributor

OK thanks, we will continue investigating as I believe the error handler is the only way to handle client reset etc. I will keep you updated.

@abhishekmatta999
Copy link
Author

@tomduncalf Sure, Thanks

@tomduncalf
Copy link
Contributor

We're going to schedule some time in our team to investigate this issue – this won't be until January due to the holiday period. I will keep you updated and will let you know if I think of anything in the mean time! Thanks

@abhishekmatta999
Copy link
Author

We're going to schedule some time in our team to investigate this issue – this won't be until January due to the holiday period. I will keep you updated and will let you know if I think of anything in the mean time! Thanks

@tomduncalf Any update on this?

@tomduncalf
Copy link
Contributor

Nothing yet I'm afraid, I hope we will be able to get to this next week

@abhishekmatta999
Copy link
Author

@tomduncalf Any update on this?

@tomduncalf
Copy link
Contributor

@abhishekmatta999 sorry for the delay, we're hoping to get to this soon so I will update you as soon as we've had a chance to investigate

tomduncalf pushed a commit that referenced this issue Jan 20, 2022
… handler

This follows the pattern from d4d6eab to prevent destruction of the functor
tomduncalf pushed a commit that referenced this issue Jan 20, 2022
… handler

This follows the pattern from d4d6eab to prevent destruction of the functor
tomduncalf pushed a commit that referenced this issue Jan 20, 2022
… handler

This follows the pattern from d4d6eab to prevent destruction of the functor
tomduncalf added a commit that referenced this issue Jan 20, 2022
… handler (#4237)

This follows the pattern from d4d6eab to prevent destruction of the functor
@tomduncalf
Copy link
Contributor

@abhishekmatta999 We've found a fix for this and it will be in the next Realm JS release, thanks for reporting this and for your patience while we investigated the issue!

@abhishekmatta999
Copy link
Author

@tomduncalf Sure, Thanks.

@tomduncalf
Copy link
Contributor

@abhishekmatta999 FYI https://github.com/realm/realm-js/releases/tag/v10.12.0 contains the fix for this, it would be great to know if it solved the issue for you

@aarati1908
Copy link

I am facing same issue that using with Electron js APP: 18.2.1 (Also tried with all latest version)
"realm": "^10.21.1",

Still app crash so it is limitation now as we can not use realm with Electron app with latest all versions?

@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

Successfully merging a pull request may close this issue.

4 participants