realm / realm-java

Realm is a mobile database: a replacement for SQLite & ORMs
http://realm.io
Apache License 2.0
11.45k stars 1.75k forks source link

Crash when changing dictionary nullability during migration #7781

Open RakeshPatil111 opened 1 year ago

RakeshPatil111 commented 1 year ago

How frequently does the bug occur?

Always

Description

I am unable to use app as it is crashing always. I have a migration function, in which I have a line which making realDictionary field required. After executing that line app is crashing schema.setRequired("fieldName", true) Initially this RealmDictionary field was nullable. var data: RealmDictionary<String> = RealmDictionary()

Stacktrace & log output

13:22:34.628 6804-6935/compackage.name A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 6935 (androidx.work-1), pid 6804

Can you reproduce the bug?

Always

Reproduction Steps

  1. Have a class with variable type of RealmDictionary [nullable]
  2. Store some data into DB
  3. Write migration, and try to make this field REQUIRED

Version

10.6.0

What Atlas App Services are you using?

Local Database only

Are you using encryption?

Yes

Platform OS and version(s)

Android 10+ [API 30+]

Build environment

Android Studio Bumblebee | 2021.1.1 Patch 3 Build #AI-211.7628.21.2111.8309675, built on March 16, 2022 Runtime version: 11.0.11+9-b60-7590822 amd64 VM: OpenJDK 64-Bit Server VM by Oracle Corporation

rorbech commented 1 year ago

Hi @RakeshPatil111. Thanks for the report. I am able to reproduce it and will investigate.

RakeshPatil111 commented 1 year ago

Hi @RakeshPatil111. Thanks for the report. I am able to reproduce it and will investigate.

Thanks, hope we can find something.

clementetb commented 1 year ago

It points out to be a core issue. I have created an issue in core to track this: https://github.com/realm/realm-core/issues/6408