realm / realm-js

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

React Native App crashes after updating RN to 0.70.6 and realm to 11.2 #5186

Open mk04366 opened 1 year ago

mk04366 commented 1 year ago

How frequently does the bug occur?

Seen once

Description

@takameyer Please look into this crash I am facing as it only occurs in production and that too 30% of the times. I am facing this on android and after updating realm to 11.2 and react-native to 0.70.6. My app is not on expo so the other crashes reported and resolved recently are unrelated.

Stacktrace & log output

OS Version: Android 11 (RMX1851_11_F.06)
Report Version: 104

Exception Type: Unknown (SIGSEGV)

Application Specific Information:
Segfault

Thread 0 Crashed:
0   librealm.so                     0x7175936a28        <unknown> + 487303899688
1   librealm.so                     0x71758abf80        <unknown> + 487303331712
2   librealm.so                     0x71758e3fb4        <unknown> + 487303561140
3   librealm.so                     0x71758e34f8        <unknown> + 487303558392
4   librealm.so                     0x71758e4b74        <unknown> + 487303564148
5   librealm.so                     0x71758e297c        <unknown> + 487303555452
6   librealm.so                     0x71758e2818        <unknown> + 487303555096
7   librealm.so                     0x71759a9258        <unknown> + 487304368728
8   librealm.so                     0x71759a782c        <unknown> + 487304362028
9   librealm.so                     0x71759a7370        <unknown> + 487304360816
10  librealm.so                     0x71759a7a74        <unknown> + 487304362612
11  librealm.so                     0x71758dd550        <unknown> + 487303533904
12  librealm.so                     0x71758d9964        <unknown> + 487303518564
13  libhermes-executor-release.so   0x72661a4964        std::__ndk1::__function::__func<T>::operator()
14  libhermes.so                    0x726ae1a848        <unknown> + 491419445320
15  libhermes.so                    0x726ae1a1d0        <unknown> + 491419443664
16  libhermes.so                    0x726ae1ff68        <unknown> + 491419467624
17  libhermes.so                    0x726ae31d90        <unknown> + 491419540880
18  libhermes.so                    0x726ae339ac        <unknown> + 491419548076
19  libhermes.so                    0x726ae33074        <unknown> + 491419545716
20  libhermes.so                    0x726ae20078        <unknown> + 491419467896
21  libhermes.so                    0x726ae1f054        <unknown> + 491419463764
22  libhermes.so                    0x726aeb5004        <unknown> + 491420078084
23  libhermes.so                    0x726ae1ff68        <unknown> + 491419467624
24  libhermes.so                    0x726ae31d90        <unknown> + 491419540880
25  libhermes.so                    0x726ae339ac        <unknown> + 491419548076
26  libhermes.so                    0x726ae33074        <unknown> + 491419545716
27  libhermes.so                    0x726ae20078        <unknown> + 491419467896
28  libhermes.so                    0x726ae1fc30        <unknown> + 491419466800
29  libhermes.so                    0x726ae31db4        <unknown> + 491419540916
30  libhermes.so                    0x726ae339ac        <unknown> + 491419548076
31  libhermes.so                    0x726ae33074        <unknown> + 491419545716
32  libhermes.so                    0x726ae20078        <unknown> + 491419467896
33  libhermes.so                    0x726ae1fc30        <unknown> + 491419466800
34  libhermes.so                    0x726ae12938        <unknown> + 491419412792
35  libhermes-executor-release.so   0x72661a787c        facebook::jsi::Function::call<T>
36  libhermes-executor-release.so   0x72661a766c        facebook::react::JSIExecutor::invokeCallback
37  libreactnativejni.so            0x72663a7090        <unknown> + 491341377680
38  libreactnativejni.so            0x72663a7d70        <unknown> + 491341380976
39  libreactnativejni.so            0x726637aee8        <unknown> + 491341197032
40  libfbjni.so                     0x728f1db80c        facebook::jni::detail::MethodWrapper<T>::dispatch
41  libfbjni.so                     0x728f1db778        facebook::jni::detail::FunctionWrapper<T>::call
42  base.odex                       0x72968c053c        <unknown> + 492152030524

Can you reproduce the bug?

Yes, always

Reproduction Steps

STRs:

Version

33

What SDK flavour are you using?

Atlas App Services (auth, functions, etc.)

Are you using encryption?

Yes, using encryption

Platform OS and version(s)

Android all versions probably (appeared on 11 and 12)

Build environment

Which debugger for React Native: ..

Cocoapods version

No response

kneth commented 1 year ago

@mk04366 Thank you for reporting. From your stack trace, it looks like you are using Hermes?

Please share your dependencies.

Login to Realm User (open a partition)

Does the crash occur when you call Realm.open()?

mk04366 commented 1 year ago

@kneth Thank you for responding back. Yes hermes is enabled and the crash happens right after realm.open(). Following are my dependencies for the project:

"dependencies": {
    "@notifee/react-native": "5.7.0",
    "@react-native-async-storage/async-storage": "^1.17.11",
    "@react-native-community/blur": "^4.2.0",
    "@react-native-community/checkbox": "^0.5.0",
    "@react-native-community/datetimepicker": "^6.7.0",
    "@react-native-community/netinfo": "^9.3.3",
    "@react-native-community/toolbar-android": "^0.1.0-rc.2",
    "@react-native-firebase/analytics": "^10.3.1",
    "@react-native-firebase/app": "^10.3.0",
    "@react-native-firebase/auth": "^10.3.1",
    "@react-native-firebase/crashlytics": "^10.3.1",
    "@react-native-firebase/dynamic-links": "^10.3.1",
    "@react-native-firebase/firestore": "^10.3.1",
    "@react-native-firebase/iid": "^10.3.1",
    "@react-native-firebase/in-app-messaging": "^10.3.1",
    "@react-native-firebase/messaging": "^10.3.1",
    "@react-native-firebase/perf": "^10.3.1",
    "@react-native-firebase/remote-config": "^10.3.1",
    "@react-native-firebase/storage": "^10.3.1",
    "@react-native-picker/picker": "^2.1.0",
    "@react-navigation/bottom-tabs": "^6.0.9",
    "@react-navigation/native": "^6.0.6",
    "@react-navigation/stack": "^6.0.11",
    "@segment/analytics-react-native": "^2.9.1",
    "@segment/sovran-react-native": "^0.4.5",
    "@sentry/react-native": "5.0.0-alpha.1",
    "@types/react-native": "^0.70.7",
    "axios": "^0.27.2",
    "babel-plugin-module-resolver": "^4.1.0",
    "base64-arraybuffer": "^1.0.2",
    "bson": "^4.6.1",
    "deprecated-react-native-prop-types": "^2.3.0",
    "fast-equals": "^3.0.0",
    "i18n-js": "^3.5.1",
    "jsencrypt": "^3.3.0",
    "jwt-decode": "^3.1.2",
    "lottie-react-native": "^5.0.1",
    "md5": "^2.3.0",
    "moment": "^2.29.3",
    "react": "18.1.0",
    "react-content-loader": "^4.3.4",
    "react-native": "0.70.6",
    "react-native-actions-sheet": "^0.5.6",
    "react-native-adjust": "^4.28.0",
    "react-native-adjust-oaid": "^4.29.6",
    "react-native-amplitude-analytics": "^0.2.7",
    "react-native-animatable": "^1.3.3",
    "react-native-background-actions": "^2.6.7",
    "react-native-biometrics": "^3.0.1",
    "react-native-circular-progress-indicator": "^4.3.0",
    "react-native-code-push": "^7.0.4",
    "react-native-config": "^1.4.11",
    "react-native-contacts": "^5.0.7",
    "react-native-device-info": "^10.2.0",
    "react-native-dots-pagination": "^0.2.0",
    "react-native-dropdown-picker": "^5.4.2",
    "react-native-fbsdk-next": "^11.0.0",
    "react-native-floating-action": "^1.22.0",
    "react-native-geocoding": "^0.5.0",
    "react-native-geolocation-service": "^5.2.0",
    "react-native-gesture-handler": "^2.8.0",
    "react-native-get-random-values": "^1.4.0",
    "react-native-html-to-pdf-lite": "^0.11.0",
    "react-native-image-pan-zoom": "^2.1.11",
    "react-native-image-picker": "^4.10.0",
    "react-native-image-resizer": "^1.2.0",
    "react-native-in-app-review": "^2.1.7",
    "react-native-inappbrowser-reborn": "^3.6.3",
    "react-native-keychain": "^8.1.1",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-loading-spinner-overlay": "^1.1.0",
    "react-native-looped-carousel": "^0.1.13",
    "react-native-maps": "^0.30.1",
    "react-native-material-menu": "^2.0.0",
    "react-native-material-textfield": "^0.16.1",
    "react-native-modal": "^13.0.0",
    "react-native-modal-datetime-picker": "^14.0.0",
    "react-native-pager-view": "^6.0.2",
    "react-native-phone-call": "^1.0.9",
    "react-native-progress": "^5.0.0",
    "react-native-ratings": "^7.3.0",
    "react-native-reanimated": "^2.12.0",
    "react-native-safe-area-context": "^4.4.1",
    "react-native-screens": "^3.18.2",
    "react-native-share": "^7.4.1",
    "react-native-size-matters": "^0.4.0",
    "react-native-smooth-pincode-input": "^1.0.9",
    "react-native-sms-retriever": "https://github.com/sarmad1995/react-native-sms-retriever.git",
    "react-native-snap-carousel": "^3.9.1",
    "react-native-splash-screen": "^3.2.0",
    "react-native-svg": "^12.1.1",
    "react-native-tab-view": "^3.3.0",
    "react-native-version-check": "^3.4.3",
    "react-native-version-number": "^0.3.6",
    "react-native-video": "^5.2.1",
    "react-native-view-pdf": "^0.14.0",
    "react-native-view-shot": "^3.1.2",
    "react-native-vision-camera": "^2.15.2",
    "react-native-walkthrough-tooltip": "^1.3.0",
    "react-native-webview": "^11.23.1",
    "react-redux": "^7.1.3",
    "realm": "^11.2.0",
    "redux": "^4.0.4",
    "redux-logger": "^3.0.6",
    "redux-persist": "^6.0.0",
    "redux-thunk": "^2.3.0",
    "rn-fetch-blob": "0.13.0-beta.2",
    "urbanairship-react-native": "^13.2.1",
    "uuid": "^8.3.0",
    "xlsx": "^0.18.5"
  },
takameyer commented 1 year ago

@mk04366 Is it possible for you to upload a .dSYM to Sentry? Unfortunately, we can't go on much without seeing the actual function calls in the stack trace. Maybe this documentation can help.

mk04366 commented 1 year ago

@takameyer Sorry for the late reply. I am using this app on android only and debugging it on android simulator therefore, I am not using Xcode. I am unable to find documentation for uploading .dSYM for android environment. Please let me know if there is any other alternative for it

takameyer commented 1 year ago

@mk04366 Ah, sorry I misread it as an iOS crash report. We are looking into better ways to distribute Realm so that the debug symbols come with it. Generally they should be included in the .aab. Seems react-native also needs to do this. We will look into finding a way to make these retrievable. Adding the debug symbols to the realm package would make it too large, so there must be away around this.
In the meantime, if there is anymore information you can provide into this crash, we could investigate further. Would be great if you could reproduce it locally.

mk04366 commented 1 year ago

@takameyer No worries! Sure I am trying to get as much debug material on this and surely will provide with more information if received. Thank you for looking into this.

zoobibackups commented 1 year ago

any solution for this. app crash only on release

takameyer commented 1 year ago

@zoobibackups If you can show us some code that reproduces the issue, or provide a crash log with symbols attached, then we can start working on this. At the moment, there isn't enough information for us to investigate further.

zoobibackups commented 1 year ago

@zoobibackups If you can show us some code that reproduces the issue, or provide a crash log with symbols attached, then we can start working on this. At the moment, there isn't enough information for us to investigate further.

in debug mode all are working fine. but in release mode app crash. i am trying to get the crash report

zoobibackups commented 1 year ago

@takameyer ``` Exception java.lang.RuntimeException: Unable to load script. Make sure you're either running Metro (run 'npx react-native start') or that your bundle 'index.android.bundle' is packaged correctly for release. at com.facebook.react.bridge.CatalystInstanceImpl.jniLoadScriptFromAssets at com.facebook.react.bridge.CatalystInstanceImpl.loadScriptFromAssets (CatalystInstanceImpl.java:248) at com.facebook.react.bridge.JSBundleLoader$1.loadScript (JSBundleLoader.java:29) at com.facebook.react.bridge.CatalystInstanceImpl.runJSBundle (CatalystInstanceImpl.java:277) at com.facebook.react.ReactInstanceManager.createReactContext (ReactInstanceManager.java:1402) at com.facebook.react.ReactInstanceManager.access$1200 (ReactInstanceManager.java:136) at com.facebook.react.ReactInstanceManager$5.run (ReactInstanceManager.java:1108) at java.lang.Thread.run (Thread.java:1012)



here is the log for playstore
takameyer commented 1 year ago

@zoobibackups This looks like a configuration issue with React Native and Android. I don't see anything Realm specific in this crash report. I'd recommend doing some searching for similar issues (https://github.com/facebook/react-native/issues/22076)

zoobibackups commented 1 year ago

@zoobibackups This looks like a configuration issue with React Native and Android. I don't see anything Realm specific in this crash report. I'd recommend doing some searching for similar issues (facebook/react-native#22076)

this issue come after updating to latest versioin of realm. after searching i have solved this with this command

npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

agunbuhori commented 1 year ago

any solution for this. app crash only on release

I have same issue here, please help :(

mk04366 commented 1 year ago

@agunbuhori Sadly there isn't a solution for this yet :( I have coped by downgrading to RN 0.69 and realm 11.0.0-rc1 according to this chart. Can you make sure that you are getting the same error which I have listed above and also share your stack trace for the crash?

ParagonVirtuoso commented 11 months ago

Here my stackTrace, com.appprospec_issue_f76768e3d79d4f2f8a8dff5e0dd7f22f_crash_session_64DDF0BE037100010A31DDF7A0C4DF18_DNE_1_v2_stacktrace.txt My app crash realm in release mode only too.

kneth commented 10 months ago

@ParagonVirtuoso Your stack trace is very different from the original one in this issue. Please create a new issue with all details.