realm-kotlin: Native crash when run on iOS

As iOS is still not using the shared code test part wasn’t maintained and now as we are moving forward everything got updated Realm from 1.0.0 to 1.6.0 and Kotlin from 1.7.10 to 1.8.0. On old versions everything runs fine with no issues, but not when running on Realm 1.1.0+ (went through try and fail to find when it stopped working) which means it’s probably connected to new memory management and totally makes sense looking on assembly crash. Unfortunately I couldn’t reproduce the issue on sample project so I have to roughly describe where it’s crashing. It basically happens on app launch as it’s data from very first request for app settings stored into Realm. Part is launched in Repo init part injected through Koin and coroutine is launched with this internal scope CoroutineScope(SupervisorJob() + Dispatchers.Default). When I do copyToRealm it’s crashes with stacktrace shown on screenshots shared in comments. I’ve tried using some fake object thinking maybe it’s Ktor doing something to coroutine state but still no.

Could you share what is happening in crashed part so I could find what is causing it?

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 25 (9 by maintainers)

Most upvoted comments

@clementetb I finally had a chance to ask coworkers to try it on their machine (one on M1 one on Intel) and it works. Which means it’s an issue on my machine and not with Realm. Thanks

We can reproduce the issue with your repo @tarasmorskyi-mediamonks. It fails as in the examples above:

EXC_BAD_ACCESS (code=1, address=0x18)

reguarding the question above. Yes, new MM was in place before and only change of Realm version caused an issue.