realm / realm-js

Realm is a mobile database: an alternative to SQLite & key-value stores
https://realm.io
Apache License 2.0
5.78k stars 573 forks source link

Realm crashes Electron app when Page Reaload Everytime #5122

Open aarati1908 opened 1 year ago

aarati1908 commented 1 year ago

How frequently does the bug occur?

All the time

Description

Electron app crashes with realm whenever the page reload.

Here's the crash report:

19:03:17.116 › deatiling { reason: 'crashed', exitCode: 139 } Error sending from webFrameMain: Error: Render frame was disposed before WebFrameMain could be accessed at s.send (node:electron/js2c/browser_init:169:631) at g.send (node:electron/js2c/browser_init:165:2144) at /usr/share/nginx/html/test/ecoproddlr01-desk-app/node_modules/electron-log/src/electronApi.js:205:23 at Array.forEach ()

at sendIpcToRenderer (/usr/share/nginx/html/test/ecoproddlr01-desk-app/node_modules/electron-log/src/electronApi.js:203:42)
at Object.sendIpc (/usr/share/nginx/html/test/ecoproddlr01-desk-app/node_modules/electron-log/src/electronApi.js:185:5)
at transport (/usr/share/nginx/html/test/ecoproddlr01-desk-app/node_modules/electron-log/src/transports/ipc.js:40:17)
at runTransport (/usr/share/nginx/html/test/ecoproddlr01-desk-app/node_modules/electron-log/src/log.js:44:5)
at runTransports (/usr/share/nginx/html/test/ecoproddlr01-desk-app/node_modules/electron-log/src/log.js:27:7)
at log (/usr/share/nginx/html/test/ecoproddlr01-desk-app/node_modules/electron-log/src/log.js:21:3)

I called realm db js at end of the page as it is required in whole over site. At first time when js included it will not crash application works perfectly but if any page reload done in electron app instanstly crashes app and relaunch application.

So is this limitatation of realm with electron app?

Version Used: "realm": "^10.21.1", Realm version: 10.21.1(Also Try with lower version of realm 10.4.0 still crash) Electron JS Version: 18.2.1 (Also Try with 21.0.0 still crash) NPM version: 8.19.2 Node Version: 14.18.1

Stuck with this point as i already used realm in electron app.

Stacktrace & log output

19:03:17.116 › deatiling { reason: 'crashed', exitCode: 139 }
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s.send (node:electron/js2c/browser_init:169:631)
    at g.send (node:electron/js2c/browser_init:165:2144)
    at /usr/share/nginx/html/test/ecoproddlr01-desk-app/node_modules/electron-log/src/electronApi.js:205:23
    at Array.forEach (<anonymous>)
    at sendIpcToRenderer (/usr/share/nginx/html/test/ecoproddlr01-desk-app/node_modules/electron-log/src/electronApi.js:203:42)
    at Object.sendIpc (/usr/share/nginx/html/test/ecoproddlr01-desk-app/node_modules/electron-log/src/electronApi.js:185:5)
    at transport (/usr/share/nginx/html/test/ecoproddlr01-desk-app/node_modules/electron-log/src/transports/ipc.js:40:17)
    at runTransport (/usr/share/nginx/html/test/ecoproddlr01-desk-app/node_modules/electron-log/src/log.js:44:5)
    at runTransports (/usr/share/nginx/html/test/ecoproddlr01-desk-app/node_modules/electron-log/src/log.js:27:7)
    at log (/usr/share/nginx/html/test/ecoproddlr01-desk-app/node_modules/electron-log/src/log.js:21:3)

Can you reproduce the bug?

Yes, always

Reproduction Steps

STEPS:

  1. Launch Electron APP at first time when Realm js is not called on first page , It works fine with as realm db CRUD perform very well.

  2. Without page refresh all things are working fine but If page reload in Electron app anywhere then crash occour and relaunch application then again things are workings normal and it is reproduced everytime.

  3. when i remove library of realm in my electron app. Application never crash.

Version

mainly i tried all version of realm this bug occurs in all version.

What SDK flavour are you using?

Local Database only

Are you using encryption?

No, not using encryption

Platform OS and version(s)

Electron Js: 18.2.1

Build environment

Which debugger for React Native: ..

Cocoapods version

No response

kneth commented 1 year ago

@aarati1908 It is difficult to see that can cause this crash. Error 139 is a segmentation fault, and it might help us if you can obtain a stack trace. In this stackoverflow question it is explained how to do so.

Furthermore, the error message could also indicate an issue with signing on M1. You don't mention if you are using a M1.

Finally, Realm and Electron can be tricky to get to work due to Electron's many processes. If you haven't already consulted our documentation, please do.

cristiano-linvix commented 1 year ago

I have same issue here.

cristiano-linvix commented 1 year ago

Perhaps with the issue link in sentry, it will help to identify the problem.

https://sentry.io/share/issue/e579f95b8a0b44139fde6f703c5eccca/

cristiano-linvix commented 1 year ago
SymInit: Symbol-SearchPath: '.;C:\Projetos\Desktop\JavaScript\Self Checkout V2;C:\Projetos\Desktop\JavaScript\Self Checkout V2\node_modules\electron\dist;C:\Windows;C:\Windows\system32;SRV*C:\websymbols*http://msdl.microsoft.com/download/symbols;', symOptions: 530, UserName: 'Cristiano'
OS-Version: 10.0.22000 () 0x100-0x1
C:\Projetos\Desktop\JavaScript\Self Checkout V2\node_modules\segfault-handler\src\StackWalker.cpp (923): StackWalker::ShowCallstack
C:\Projetos\Desktop\JavaScript\Self Checkout V2\node_modules\segfault-handler\src\segfault-handler.cpp (242): segfault_handler
00007FFC2455C49A (ntdll): (filename not available): RtlAreLongPathsEnabled
00007FFC245159A2 (ntdll): (filename not available): RtlRestoreContext
00007FFC24512E63 (ntdll): (filename not available): RtlRaiseException
00007FFC21C8428C (KERNELBASE): (filename not available): RaiseException
00007FFC240F3B40 (RPCRT4): (filename not available): RpcRaiseException
00007FFC240F3B04 (RPCRT4): (filename not available): RpcRaiseException
00007FFC240F3ADC (RPCRT4): (filename not available): I_RpcSendReceive
00007FFC240E6170 (RPCRT4): (filename not available): RpcAsyncGetCallStatus
00007FFC240A1DF7 (RPCRT4): (filename not available): NdrClientCall2
00007FFC2417D661 (RPCRT4): (filename not available): NdrClientCall3
00007FFC240A13D8 (RPCRT4): (filename not available): RpcAsyncCompleteCall
00007FFC205E3E94 (WINSTA): (filename not available): WinStationRegisterConsoleNotificationEx
00007FFC205E3C5D (WINSTA): (filename not available): WinStationRegisterConsoleNotificationEx
00007FFC205E3597 (WINSTA): (filename not available): WinStationUnRegisterSessionNotification
00007FFC240FC9AD (RPCRT4): (filename not available): NdrFixedArrayMarshall
00007FFC240FC83A (RPCRT4): (filename not available): NdrFixedArrayMarshall
00007FFC24106746 (RPCRT4): (filename not available): NdrGetSimpleTypeMemorySize
00007FFC241076BE (RPCRT4): (filename not available): RpcServerUnregisterIfEx
00007FFC24106AE3 (RPCRT4): (filename not available): NdrGetSimpleTypeMemorySize
00007FFC24106928 (RPCRT4): (filename not available): NdrGetSimpleTypeMemorySize
00007FFC24108020 (RPCRT4): (filename not available): RpcAsyncCancelCall
00007FFC205E2408 (WINSTA): (filename not available): WinStationUnRegisterSessionNotification
00007FFC205E2143 (WINSTA): (filename not available): WinStationGetCurrentSessionCapabilities
00007FFC205E20E2 (WINSTA): (filename not available): WinStationGetCurrentSessionCapabilities
00007FFC205E22EE (WINSTA): (filename not available): WinStationUnRegisterSessionNotification
00007FFC205E2211 (WINSTA): (filename not available): WinStationUnRegisterSessionNotification
00007FFC1D9A24C3 (WTSAPI32): (filename not available): WTSUnRegisterSessionNotification
00007FF7D805DCB9 (electron): (filename not available): uv_fs_poll_getpath
00007FF7D805DC1A (electron): (filename not available): uv_fs_poll_getpath
00007FF7D6F13625 (electron): (filename not available): uv_fs_get_result
00007FF7D6F13428 (electron): (filename not available): uv_fs_get_result
00007FF7D5CB17B6 (electron): (filename not available): v8::metrics::LongTaskStats::LongTaskStats
00007FF7D5CAD65F (electron): (filename not available): v8::metrics::LongTaskStats::LongTaskStats
00007FF7D5CAD72B (electron): (filename not available): v8::metrics::LongTaskStats::LongTaskStats
00007FF7D5A4AA5D (electron): (filename not available): cppgc::SourceLocation::SourceLocation
00007FF7D9632CD2 (electron): (filename not available): Cr_z_crc32_z
00007FFC23C45550 (KERNEL32): (filename not available): BaseThreadInitThunk
00007FFC244E485B (ntdll): (filename not available): RtlUserThreadStart
cristiano-linvix commented 1 year ago

https://sentry.io/share/issue/7c819948d9a745248effc7a023b6fedc/