realm-js: realm.create crashing the android app

How frequently does the bug occur?

All the time

Description

Hi everyone,

The example below is working fine while in debug is enabled using React Native Debugger but the app is crashing in normal mode for Android only. Can someone assist me resolve this issue, please?

  const Cat = {
    name: "Cat",
    properties: {
      _id: "string",
      name: "string",
      age: "int",
      type: "string",
    },
  };
const db = await Realm.open({
schema: [Cat],
schemaVersion: 1,
});
  const cats = db.objects("Cat");
  console.log(`There are ${cats.length} cats`);```

db.write(() => {


 db.create("Cat", {  // this step is causing the crash
  _id: '1',
  name: "Alice",
  age: 14,
  type: "Calico",
});

});


**Package.json**

"@codler/react-native-keyboard-aware-scroll-view": "^2.0.1",
    "@eva-design/eva": "^2.1.0",
    "@expo/react-native-action-sheet": "^3.9.0",
    "@fortawesome/fontawesome-pro": "^5.15.4",
    "@fortawesome/fontawesome-svg-core": "^1.2.35",
    "@fortawesome/free-brands-svg-icons": "^5.15.3",
    "@fortawesome/free-solid-svg-icons": "^5.15.3",
    "@fortawesome/pro-duotone-svg-icons": "^5.15.4",
    "@fortawesome/pro-light-svg-icons": "^5.15.3",
    "@fortawesome/pro-regular-svg-icons": "^5.15.3",
    "@fortawesome/pro-solid-svg-icons": "^5.15.4",
    "@fortawesome/react-native-fontawesome": "^0.2.6",
    "@freakycoder/react-native-progressive-fast-image": "^0.2.5",
    "@react-native-community/async-storage": "^1.12.1",
    "@react-native-community/geolocation": "^2.0.2",
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-community/netinfo": "^6.0.0",
    "@react-native-community/push-notification-ios": "^1.8.0",
    "@react-native-firebase/analytics": "^14.5.0",
    "@react-native-firebase/app": "^14.5.0",
    "@react-navigation/bottom-tabs": "^5.11.11",
    "@react-navigation/drawer": "^5.12.5",
    "@react-navigation/material-bottom-tabs": "^5.3.15",
    "@react-navigation/material-top-tabs": "^5.3.15",
    "@react-navigation/native": "^5.9.4",
    "@react-navigation/stack": "^5.14.5",
    "@redux-offline/redux-offline": "^2.6.0",
    "@ui-kitten/components": "^5.1.0",
    "@ui-kitten/eva-icons": "^5.1.0",
    "ajv": "7.1.0",
    "ajv-errors": "^3.0.0",
    "ajv-formats": "^2.1.1",
    "axios": "^0.21.1",
    "crypto-js": "^4.0.0",
    "d3-shape": "^2.1.0",
    "install": "^0.13.0",
    "jsc-android": "^250230.2.1",
    "lodash": "^4.17.21",
    "lpf": "^1.0.0",
    "moment": "^2.29.1",
    "moment-timezone": "^0.5.33",
    "npm": "^7.18.1",
    "prop-types": "^15.7.2",
    "ramda": "^0.27.1",
    "raygun4reactnative": "^1.1.5",
    "react": "17.0.2",
    "react-native": "0.66.4",
    "react-native-build-config": "^0.3.2",
    "react-native-bundle-splitter": "^2.1.0",
    "react-native-clean-project": "^3.6.4",
    "react-native-date-picker": "^3.3.1",
    "react-native-document-picker": "^5.0.4",
    "react-native-dropdownalert": "^4.3.0",
    "react-native-fast-image": "^8.5.11",
    "react-native-file-viewer": "^2.1.4",
    "react-native-fontawesome-pro": "^2.1.0",
    "react-native-fs": "^2.18.0",
    "react-native-gesture-handler": "^1.10.3",
    "react-native-google-places-autocomplete": "^2.2.0",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-maps": "^0.28.0",
    "react-native-notifications": "^4.1.3",
    "react-native-pager-view": "^5.4.9",
    "react-native-paper": "^4.9.1",
    "react-native-permissions": "^3.1.0",
    "react-native-reanimated": "^2.2.0",
    "react-native-redash": "^16.0.11",
    "react-native-safe-area-context": "^3.3.2",
    "react-native-screens": "^3.3.0",
    "react-native-sensitive-info": "git+https://github.com/mCodex/react-native-sensitive-info.git#keystore",
    "react-native-splash-screen": "^3.2.0",
    "react-native-svg": "^12.1.1",
    "react-native-tab-view": "^3.0.1",
    "react-native-unimodules": "^0.13.3",
    "react-native-vector-icons": "^8.1.0",
    "react-native-webview": "^11.14.0",
    "react-redux": "^7.2.4",
    "realm": "^10.13.0",
    "redux": "^4.1.0",
    "redux-logger": "^3.0.6",
    "redux-persist": "^6.0.0",
    "redux-persist-sensitive-storage": "^1.0.0",
    "redux-saga": "^1.1.3",
    "reduxsauce": "^1.2.0",
    "reselect": "^4.0.0",
    "rn-fetch-blob": "^0.12.0",
    "rxjs": "^7.1.0",
    "underscore": "^1.13.1",
    "use-debounce": "^7.0.1"

### Stacktrace & log output
```shell
Type	Time	PID	Tag	Message
	11:08:52.623	32560	libc	Fatal signal 7 (SIGBUS), code 1 (BUS_ADRALN), fault addr 0xfffffffb in tid 1370 (mqt_js), pid 32560 (com.myfarmapp)

	11:08:52.872	1434	DEBUG	pid: 32560, tid: 1370, name: mqt_js  >>> com.myfarmapp <<<

	11:08:52.878	1434	DEBUG	      #00 pc 002e3aa4  /data/app/com.myfarmapp-rtw-Mt49iUsbq8iCz8dIdw==/lib/arm/libjsc.so!libjsc.so (offset 0x75000) (BuildId: 184cbb2602409d8d87c82858f210bcb5255b9e8c)

	11:08:52.878	1434	DEBUG	      #01 pc 002e118f  /data/app/com.myfarmapp-rtw-Mt49iUsbq8iCz8dIdw==/lib/arm/libjsc.so!libjsc.so (offset 0x75000) (BuildId: 184cbb2602409d8d87c82858f210bcb5255b9e8c)

	11:08:52.878	1434	DEBUG	      #02 pc 002e0ec5  /data/app/com.myfarmapp-rtw-Mt49iUsbq8iCz8dIdw==/lib/arm/libjsc.so!libjsc.so (offset 0x75000) (BuildId: 184cbb2602409d8d87c82858f210bcb5255b9e8c)

	11:08:52.878	1434	DEBUG	      #03 pc 000718bd  /data/app/com.myfarmapp-rtw-Mt49iUsbq8iCz8dIdw==/lib/arm/libjsc.so (BuildId: 184cbb2602409d8d87c82858f210bcb5255b9e8c)

	11:08:52.879	1434	DEBUG	      #04 pc 000715e9  /data/app/com.myfarmapp-rtw-Mt49iUsbq8iCz8dIdw==/lib/arm/libjsc.so (BuildId: 184cbb2602409d8d87c82858f210bcb5255b9e8c)

	11:08:52.879	1434	DEBUG	      #05 pc 002891bf  /data/app/com.myfarmapp-rtw-Mt49iUsbq8iCz8dIdw==/lib/arm/libjsc.so!libjsc.so (offset 0x75000) (BuildId: 184cbb2602409d8d87c82858f210bcb5255b9e8c)

	11:08:52.879	1434	DEBUG	      #06 pc 00288d9d  /data/app/com.myfarmapp-rtw-Mt49iUsbq8iCz8dIdw==/lib/arm/libjsc.so!libjsc.so (offset 0x75000) (BuildId: 184cbb2602409d8d87c82858f210bcb5255b9e8c)

	11:08:52.879	1434	DEBUG	      #07 pc 002892f1  /data/app/com.myfarmapp-rtw-Mt49iUsbq8iCz8dIdw==/lib/arm/libjsc.so!libjsc.so (offset 0x75000) (BuildId: 184cbb2602409d8d87c82858f210bcb5255b9e8c)

	11:08:52.879	1434	DEBUG	      #08 pc 0027d381  /data/app/com.myfarmapp-rtw-Mt49iUsbq8iCz8dIdw==/lib/arm/libjsc.so!libjsc.so (offset 0x75000) (BuildId: 184cbb2602409d8d87c82858f210bcb5255b9e8c)

	11:08:52.879	1434	DEBUG	      #09 pc 002b2955  /data/app/com.myfarmapp-rtw-Mt49iUsbq8iCz8dIdw==/lib/arm/libjsc.so!libjsc.so (offset 0x75000) (BuildId: 184cbb2602409d8d87c82858f210bcb5255b9e8c)

	11:08:52.879	1434	DEBUG	      #10 pc 00169a39  /data/app/com.myfarmapp-rtw-Mt49iUsbq8iCz8dIdw==/lib/arm/libjsc.so!libjsc.so (offset 0x75000) (BuildId: 184cbb2602409d8d87c82858f210bcb5255b9e8c)

	11:08:54.151	4062	ActivityManager	crash : com.myfarmapp,0
	11:08:54.158	4062	ActivityTaskManager	  Force finishing activity com.myfarmapp/.MainActivity
	11:08:54.336	4062	InputDispatcher	channel '3f863f2 com.myfarmapp/com.myfarmapp.MainActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9, fd=520
	11:08:54.336	4062	InputDispatcher	channel '3f863f2 com.myfarmapp/com.myfarmapp.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
	11:08:54.342	4062	WindowManager	WIN DEATH: Window{3f863f2 u0 com.myfarmapp/com.myfarmapp.MainActivity}

Can you reproduce the bug?

Yes, always

Reproduction Steps

No response

Version

10.13.0

What SDK flavour are you using?

Local Database only

Are you using encryption?

No, not using encryption

Platform OS and version(s)

Android 10

Build environment

Which debugger for React Native: … React Native Debugger

Cocoapods version

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 20 (5 by maintainers)

Most upvoted comments

@myousufq It is your dependency on react-native-reanimated. We have solved it on v10.20.0-beta.2 so please try to upgrade.

We had a build issue with v10.21.0 leading to random crashes on Android. Please upgrade to v10.21.1.

Unfortunately #4399 was the only solution to this. Upgrading react native to 0.70.1 and realm to v11.0.0-rc.2 fixed it. I might have a long couple of days ahead of me now, upgrading rn isn’t exactly straightforward a lot of the times.

I am facing a crash with calling realm.create() only in android. Working fine in ios “realm”: “^10.21.1”, “react”: “^18.0.0”, “react-native”: “^0.69.1”, “react-native-reanimated”: “^2.10.0”,

I upgraded Dependencies

"realm": "^v11.0.0-rc.2",
"@realm/react": "^0.3.2",
"react": "18.1.0",
"react-native": "0.70.1",

It is resolved Thanks