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 #3382

Closed
harshithdwivedi opened this issue Nov 4, 2020 · 2 comments
Closed

Electron app crashes after closing the app #3196 #3382

harshithdwivedi opened this issue Nov 4, 2020 · 2 comments

Comments

@harshithdwivedi
Copy link

harshithdwivedi commented Nov 4, 2020

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

Stack trace:

Process:               AfterShoot [39034]
Path:                  /Users/USER/Desktop/*/AfterShoot.app/Contents/MacOS/AfterShoot
Identifier:            com.electron.aftershoot
Version:               1.5.0 (1.5.0)
Code Type:             X86-64 (Native)
Parent Process:        zsh [37987]
Responsible:           Terminal [9232]
User ID:               501

Date/Time:             2020-11-04 22:18:53.353 +0530
OS Version:            Mac OS X 10.15.7 (19H2)
Report Version:        12
Bridge OS Version:     4.6 (17P6610)
Anonymous UUID:        FED9DED7-AF03-42A6-2FCA-BC4865E26DD3

Sleep/Wake UUID:       6A2AAADC-3735-4A11-B2BF-B32DC3BCB342

Time Awake Since Boot: 36000 seconds
Time Since Wake:       20000 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 [39034]

VM Regions Near 0:
--> 
    __TEXT                 0000000101388000-00000001013b0000 [  160K] r-x/r-x SM=COW  /Users/USER/Desktop/*/AfterShoot.app/Contents/MacOS/AfterShoot

Thread 0 Crashed:: CrBrowserMain  Dispatch queue: com.apple.main-thread
0   com.github.Electron.framework 	0x000000010799dcab ElectronInitializeICUandStartNode + 1393259
1   com.github.Electron.framework 	0x000000010864d15e v8::internal::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*) + 862
2   com.github.Electron.framework 	0x00000001087bc0ef v8::internal::HandleScope::Extend(v8::internal::Isolate*) + 399
3   com.github.Electron.framework 	0x000000010864f538 v8::HandleScope::CreateHandle(v8::internal::Isolate*, unsigned long) + 56
4   com.github.Electron.framework 	0x000000010dbdfc31 napi_get_reference_value + 65
5   realm.node                    	0x000000010f6132ce Napi::ObjectWrap<realm::node::WrappedObject<realm::js::RealmClass<realm::node::Types> > >::~ObjectWrap() + 48
6   realm.node                    	0x000000010f6133c2 realm::node::WrappedObject<realm::js::RealmClass<realm::node::Types> >::~WrappedObject() + 38
....

Steps to Reproduce

Build an electron app with realm. Create a realm instance on launch and then close the app.

Code Sample

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);
});

This is the same issue as outlined in #3196, @kneth is there any update on how React Studio handles this?

@aniketbiprojit
Copy link

aniketbiprojit commented Nov 5, 2020

Is there a way to catch v8::internal::FatalProcessOutOfMemory this exception and not throw it to the OS? Can this be done after compilation of realm.node?

Has there been any progress on #2521? These seem related.

@sync-by-unito sync-by-unito bot changed the title Electron app crashes after closing the app #3196 Electron app crashes after closing the app #3196 Nov 5, 2020
@fronck fronck closed this as completed Jan 28, 2021
@fronck fronck reopened this Jan 28, 2021
@sync-by-unito sync-by-unito bot closed this as completed Jan 28, 2021
@sync-by-unito
Copy link

sync-by-unito bot commented Jan 28, 2021

➤ Franck Franck commented:

Duplicate of #3196

@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

3 participants