realm / realm-js

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

[realm-core-11.14.0] Assertion failed: ObjectWrap<ParentClassType>::s_ctor #4838

Closed SyedSaifAli closed 2 years ago

SyedSaifAli commented 2 years ago

SDK and version

SDK : Cocoa Version: [realm-core-11.14.0]

Observations

modules in RN app:

    "react": "17.0.2",
    "react-native": "0.66.4",
    "react-native-action-button": "2.8.5",
    "react-native-camera": "3.1.1",
    "react-native-contacts": "5.0.2",
    "react-native-device-info": "v2.3.2",
    "react-native-image-crop-picker": "0.25.3",
    "react-native-linear-gradient": "2.5.6",
    "react-native-simple-toast": "0.1.1",
    "react-native-video": "5.2.0",
    "react-native-webview": "6.9.0",
    "react-native-youtube-iframe": "2.2.2",
    "react-navigation": "2.18.0",
    "realm": "10.20.0-beta.5",

This is happening on reloading the app by running command on production mode only, and not on dev mode.

dispatch_sync(dispatch_get_main_queue(), ^{
        RCTTriggerReloadCommandListeners(@"Restart");
});

Crash log / stacktrace


0   Ajjas                               0x0000000102b5cbbc _ZN5realm4utilL18terminate_internalERNSt3__118basic_stringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 28
1   Ajjas                               0x0000000102b5ce60 _ZN5realm4util9terminateEPKcS2_lOSt16initializer_listINS0_9PrintableEE + 328
2   Ajjas                               0x000000010278e7f8 _ZN5realm2js8realmjsi10ObjectWrapINS0_8SetClassINS1_5TypesEEEE18create_constructorENS0_6JsiEnvE + 5124
3   Ajjas                               0x00000001027843c0 _ZN5realm2js10RealmClassINS0_8realmjsi5TypesEE18create_constructorENS0_6JsiEnvE + 112
4   Ajjas                               0x00000001027841d4 realm_jsi_init + 32
5   Ajjas                               0x000000010272a510 __24-[RealmReact setBridge:]_block_invoke + 296
6   Ajjas                               0x0000000102516488 _ZN8facebook5react17tryAndReturnErrorERKNSt3__18functionIFvvEEE + 32
7   Ajjas                               0x000000010250b428 -[RCTCxxBridge _tryAndHandleError:] + 100
8   Foundation                          0x000000019794df00 EE1ABAF2-3D71-37FB-9067-15AA79528619 + 253696
9   CoreFoundation                      0x00000001961d3414 6B22DD81-3585-3BE6-BC77-BA19810EC0F2 + 766996
10  CoreFoundation                      0x00000001961e41a0 6B22DD81-3585-3BE6-BC77-BA19810EC0F2 + 836000
11  CoreFoundation                      0x000000019611d694 6B22DD81-3585-3BE6-BC77-BA19810EC0F2 + 22164
12  CoreFoundation                      0x000000019612305c 6B22DD81-3585-3BE6-BC77-BA19810EC0F2 + 45148
13  CoreFoundation                      0x0000000196136bc8 CFRunLoopRunSpecific + 600
14  Ajjas                               0x000000010250b35c ﹍[RCTCxxBridge runRunLoop]﹍  264
15  Foundation                          0x000000019797941c EE1ABAF2-3D71-37FB-9067-15AA79528619 + 431132
16  libsystem_pthread.dylib             0x0000000207b199ac _pthread_start + 148
17  libsystem_pthread.dylib             0x0000000207b18e68 thread_start + 8!!! IMPORTANT: Please report this at https://github.com/realm/realm-core/issues/new/choose2022-08-28 14:57:31.039648+0530 Ajjas[84515:4453266] /Users/kraen.hansen/Projects/realm-js/src/jsi/jsi_class.hpp:357: [realm-core-11.14.0] Assertion failed: ObjectWrap<ParentClassType>::s_ctor
0   Ajjas                               0x0000000102b5cbbc _ZN5realm4utilL18terminate_internalERNSt3__118basic_stringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 28
1   Ajjas                               0x0000000102b5ce60 _ZN5realm4util9terminateEPKcS2_lOSt16initializer_listINS0_9PrintableEE + 328
2   Ajjas                               0x000000010278e7f8 _ZN5realm2js8realmjsi10ObjectWrapINS0_8SetClassINS1_5TypesEEEE18create_constructorENS0_6JsiEnvE + 5124
3   Ajjas                               0x00000001027843c0 _ZN5realm2js10RealmClassINS0_8realmjsi5TypesEE18create_constructorENS0_6JsiEnvE + 112
4   Ajjas                               0x00000001027841d4 realm_jsi_init + 32
5   Ajjas                               0x000000010272a510 __24-[RealmReact setBridge:]_block_invoke + 296
6   Ajjas                               0x0000000102516488 _ZN8facebook5react17tryAndReturnErrorERKNSt3__18functionIFvvEEE + 32
7   Ajjas                               0x000000010250b428 -[RCTCxxBridge _tryAndHandleError:] + 100
8   Foundation                          0x000000019794df00 EE1ABAF2-3D71-37FB-9067-15AA79528619 + 253696
9   CoreFoundation                      0x00000001961d3414 6B22DD81-3585-3BE6-BC77-BA19810EC0F2 + 766996
10  CoreFoundation                      0x00000001961e41a0 6B22DD81-3585-3BE6-BC77-BA19810EC0F2 + 836000
11  CoreFoundation                      0x000000019611d694 6B22DD81-3585-3BE6-BC77-BA19810EC0F2 + 22164
12  CoreFoundation                      0x000000019612305c 6B22DD81-3585-3BE6-BC77-BA19810EC0F2 + 45148
13  CoreFoundation                      0x0000000196136bc8 CFRunLoopRunSpecific + 600
14  Ajjas                               0x000000010250b35c ﹍[RCTCxxBridge runRunLoop]﹍  264
15  Foundation                          0x000000019797941c EE1ABAF2-3D71-37FB-9067-15AA79528619 + 431132
16  libsystem_pthread.dylib             0x0000000207b199ac _pthread_start + 148
17  libsystem_pthread.dylib             0x0000000207b18e68 thread_start + 8!!! IMPORTANT: Please report this at https://github.com/realm/realm-core/issues/new/choose
dyld4 config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/GPUTools.framework/libglInterpose.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib```
kneth commented 2 years ago

@SyedSaifAli

Is it possible for you to upgrade to v11.0.0-rc.1? It will require that you are upgrading React Native to v0.69.0.

Moreover, it would be great if you can provide a small app which can reproduce it.

SyedSaifAli commented 2 years ago

This is working fine when I moved to realm version 10.19.0. I can't switch to version v11.0.0-rc.1 because the REALM_CORE_VERSION in this is 12.1.0 and I can't see this core version in any of the realm-swift releases. 😕

kneth commented 2 years ago

Realm Swift v10.28.6 and Realm JavaScript v10.20.0 are using Realm Core v12.5.1.

I close the issue as it sounds like you have it working (and know how to get it working in the future).

SyedSaifAli commented 2 years ago

Yes, I think you can close this issue. The reason for not updating to JS version 10.20.0 was it doesn't have the support of Hermes for now, and my android app has been upgraded to Hermes, but the IOS app is still without Hermes. I was looking for a stable version in which Hermes is supported, having the same core version of the realm in both Java, objective-c, and javascript. 😅

For now, I guess I have to maintain separate branches for android and ios because the JS version of the realm is different.

N3TC4T commented 1 year ago

Hi @kneth

It seems this issue is still exist in the latest realm-js version 11.4.0 with hermes enabled.

for reproducing this issue you can simply use this package react-native-restart and trigger restart method while running the iOS app in release build.

react-native:  0.71.1 
realm:  11.4.0
abaddonGIT commented 1 year ago

Yes the same problem with use react-native-code-push package for the restart the application (restartApp). react-native: 0.71.8, realm: 11.9.0

kneth commented 1 year ago

@abaddonGIT Please create a new issue as it seems to be related to the interaction with react-native-code-push