Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RealmError: Incompatible lock file / After 2.0 RealmFileException All processes sharing a single file must be the same architecture. #2459

Closed
hohnamkung opened this issue Mar 15, 2016 · 141 comments

Comments

@hohnamkung
Copy link

hohnamkung commented Mar 15, 2016

Goal

To report specific error after upgrading v0.88.0

Expected Results

Crash is not occurred.

Actual Results

Fatal Exception: io.realm.exceptions.RealmError: Unrecoverable error. Incompatible lock file in io_realm_internal_SharedGroup.cpp line 113
   at io.realm.internal.SharedGroup.createNativeWithImplicitTransactions(SharedGroup.java)
   at io.realm.internal.SharedGroup.(SharedGroup.java:63)
   at io.realm.internal.SharedGroupManager.(SharedGroupManager.java:48)
   at io.realm.BaseRealm.(BaseRealm.java:76)
   at io.realm.Realm.(Realm.java:138)
   at io.realm.Realm.createAndValidate(Realm.java:268)
   at io.realm.Realm.createInstance(Realm.java:248)
   at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:114)
   at io.realm.Realm.getInstance(Realm.java:213)
   at kr.co.vcnc.android.couple.feature.MainTabIndicator.updateHomeBadge(MainTabIndicator.java:138)
   at kr.co.vcnc.android.couple.feature.MainTabIndicator.onAttachedToWindow(MainTabIndicator.java:83)
   at android.view.View.dispatchAttachedToWindow(View.java:12626)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2473)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
   at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1264)
   at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1047)
   at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5896)
   at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
   at android.view.Choreographer.doCallbacks(Choreographer.java:574)
   at android.view.Choreographer.doFrame(Choreographer.java:544)
   at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
   at android.os.Handler.handleCallback(Handler.java:733)
   at android.os.Handler.dispatchMessage(Handler.java:95)
   at android.os.Looper.loop(Looper.java:136)
   at android.app.ActivityThread.main(ActivityThread.java:5120)
   at java.lang.reflect.Method.invokeNative(Method.java)
   at java.lang.reflect.Method.invoke(Method.java:515)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608)
   at dalvik.system.NativeStart.main(NativeStart.java)

Steps & Code to Reproduce

I got this stack trace from Fabric. I've tested several devices that we have, i can't reproduce it.
Instead, i attached some code that error is happening.

FYI, at this update (to v0.88.0), we upgraded Realm's schema version.
(We're using deleteRealmIfMigrationNeeded option)

Code Sample

@Override
protected void onAttachedToWindow() {
    homeBadgeSubscription = Realm.getInstance(CoupleApplication.getRealmHome())
                .where(RHomeCardViewView.class)
                .equalTo("closed", false)
                .equalTo("newIndicator", true)
                .findAllAsync()
                .asObservable()
                .filter(RealmResults::isLoaded)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(BasicSubscriber.    <RealmResults<RHomeCardViewView>>create().next(homeCardViewViews -> {
                    int size = homeCardViewViews.size();
                    updateTextView(size);
                }));

@Override
protected void onDetachedFromWindow() {
    if (homeBadgeSubscription != null) {
        homeBadgeSubscription.unsubscribe();
    }
}

Version of Realm and tooling

Realm version(s): v0.88.0

Which Android version and device:
When i first saw this crash, i think this is occurred because users are using BlackBerry.
But now Android users have a crash.

screen shot 2016-03-15 at 10 55 28 am
screen shot 2016-03-15 at 10 55 40 am
screen shot 2016-03-15 at 10 55 47 am

The peak point is yesterday. (Realm v0.88.0)
screen shot 2016-03-15 at 10 59 39 am

@beeender
Copy link
Contributor

@hohnamkung

  1. Can you share the latest apk with us? to help@realm.io
  2. Are you using Realm in different processes? eg. Some services are running in a different process and accessing the same Realm which is used in the main activity as well.

@beeender
Copy link
Contributor

Is it the first time when the getInstance() gets called in the app?

@hohnamkung
Copy link
Author

Yes. I've just tested.
Realm.getInstance(CoupleApplication.getRealmHome()) is first invoked at that point.

We're using single process (don't declare any process in AndroidManifest.xml)
In AppWidgetProvider we query realm (same configuration, CoupleApplication.getRealmHome), but i think that that code run on same process. (http://stackoverflow.com/a/11017453/4444109)

@beeender
Copy link
Contributor

@hohnamkung Two more questions:

  1. Do you have any more information about how many crashed devices are 64bit?
  2. Do you ship the Realm's arm64 so with the apk?

@beeender
Copy link
Contributor

@hohnamkung
Copy link
Author

  1. I'm not sure how many it is, but top 3 devices in Samsung and LG are 32bit OS
    screen shot 2016-03-16 at 10 28 31 am

  2. No. I excluded it on purpose to prevent some device from can't load so file exception.

    packagingOptions {
        // Workaround for failing to fall back to choose a non-64bit version of so
        exclude "lib/arm64-v8a/librealm-jni.so"
        exclude "lib/x86_64/librealm-jni.so"
    }
    

@beeender
Copy link
Contributor

@hohnamkung We just released 0.88.2, it has a potential fix of this problem (which i am not sure could solve this, but worth a try), and some more information about the exception is added to help us debug if it still happens. And it also has a fix for the bad version problem you have.

Would you please give it a try? And let us know if this problem is still there. thanks a lot, and sorry for those troubles.

@hohnamkung
Copy link
Author

@beeender
I'll release new version using 0.88.2 sooner than later!
Thanks!

@hohnamkung
Copy link
Author

Hi @beeender
After update, i still have a problem (Exception log is a little changed)

Fatal Exception: io.realm.exceptions.RealmError: Unrecoverable error. Incompatible lock file. Shared info version doesn't match, 4 5. in io_realm_internal_SharedGroup.cpp line 113
   at io.realm.internal.SharedGroup.createNativeWithImplicitTransactions(SharedGroup.java)
   at io.realm.internal.SharedGroup.(SharedGroup.java:64)
   at io.realm.internal.SharedGroupManager.(SharedGroupManager.java:49)
   at io.realm.BaseRealm.(BaseRealm.java:76)
   at io.realm.Realm.(Realm.java:138)
   at io.realm.Realm.createAndValidate(Realm.java:268)
   at io.realm.Realm.createInstance(Realm.java:248)
   at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:114)
   at io.realm.Realm.getInstance(Realm.java:213)
   at kr.co.vcnc.android.couple.feature.MainTabIndicator.updateHomeBadge(MainTabIndicator.java:138)
   at kr.co.vcnc.android.couple.feature.MainTabIndicator.onAttachedToWindow(MainTabIndicator.java:83)
   at android.view.View.dispatchAttachedToWindow(View.java:12658)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2473)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
   at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1255)
   at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1038)
   at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5889)
   at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
   at android.view.Choreographer.doCallbacks(Choreographer.java:574)
   at android.view.Choreographer.doFrame(Choreographer.java:544)
   at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
   at android.os.Handler.handleCallback(Handler.java:733)
   at android.os.Handler.dispatchMessage(Handler.java:95)
   at android.os.Looper.loop(Looper.java:136)
   at android.app.ActivityThread.main(ActivityThread.java:5118)
   at java.lang.reflect.Method.invokeNative(Method.java)
   at java.lang.reflect.Method.invoke(Method.java:515)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:610)
   at dalvik.system.NativeStart.main(NativeStart.java)

@beeender
Copy link
Contributor

Thanks a lot for the information, i will check and get back to you ASAP.

@hohnamkung
Copy link
Author

And another crash log is collected.
If you think that it's is a another problem, i'll make a other issue.

Fatal Exception: java.lang.IllegalArgumentException: Illegal Argument: Invalid format of Realm file.
   at io.realm.internal.SharedGroup.createNativeWithImplicitTransactions(SharedGroup.java)
   at io.realm.internal.SharedGroup.(SharedGroup.java)
   at io.realm.internal.SharedGroupManager.(SharedGroupManager.java)
   at io.realm.BaseRealm.(BaseRealm.java)
   at io.realm.Realm.(Realm.java)
   at io.realm.Realm.createAndValidate(Realm.java:268)
   at io.realm.Realm.createInstance(Realm.java:248)
   at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:114)
   at io.realm.Realm.getInstance(Realm.java:213)
   at kr.co.vcnc.android.couple.feature.MainTabIndicator.updateHomeBadge(MainTabIndicator.java:138)
   at kr.co.vcnc.android.couple.feature.MainTabIndicator.onAttachedToWindow(MainTabIndicator.java:83)
   at android.view.View.dispatchAttachedToWindow(View.java:11888)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2521)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2528)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2528)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2528)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2528)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2528)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2528)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2528)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2528)
   at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2528)
   at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1207)
   at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1006)
   at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4225)
   at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
   at android.view.Choreographer.doCallbacks(Choreographer.java:555)
   at android.view.Choreographer.doFrame(Choreographer.java:525)
   at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
   at android.os.Handler.handleCallback(Handler.java:615)
   at android.os.Handler.dispatchMessage(Handler.java:92)
   at android.os.Looper.loop(Looper.java:213)
   at android.app.ActivityThread.main(ActivityThread.java:4786)
   at java.lang.reflect.Method.invokeNative(Method.java)
   at java.lang.reflect.Method.invoke(Method.java:511)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
   at dalvik.system.NativeStart.main(NativeStart.java)

@beeender
Copy link
Contributor

Please create another issue for that, it seems to be another problem. Thanks!

@beeender beeender added S:P1 Backlog Blocked This issue is blocked by another issue T-Bug-Crash and removed S:Waiting For User T-Help labels Mar 17, 2016
@dalinaum
Copy link
Contributor

@dalinaum
Copy link
Contributor

@hohnamkung has confirmed that @beeender's workaround works well.

@appsailor
Copy link

@dalinaum I have an app in play store [https://play.google.com/store/apps/details?id=com.isletsystems.android.cricitch.lite] that is growing steadily, and is experiencing the same error @hohnamkung detailed, in my most recent build that I published.

I had built the app with the following:

  • classpath 'io.realm:realm-gradle-plugin:0.88.2'
  • buildToolsVersion '24.0.0-rc2'
  • com.android.support:23.2.1

error from crashlytics:
Fatal Exception: io.realm.exceptions.RealmError: Unrecoverable error. Incompatible lock file. Shared info version doesn't match, 4 5. in io_realm_internal_SharedGroup.cpp line 113
at io.realm.internal.SharedGroup.createNativeWithImplicitTransactions(SharedGroup.java)
at io.realm.internal.SharedGroup.(SharedGroup.java:64)
at io.realm.internal.SharedGroupManager.(SharedGroupManager.java:49)
at io.realm.BaseRealm.(BaseRealm.java:76)
at io.realm.Realm.(Realm.java:138)
at io.realm.Realm.createAndValidate(Realm.java:268)
at io.realm.Realm.createInstance(Realm.java:248)
at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:114)
at io.realm.Realm.getInstance(Realm.java:213)
at com.isletsystems.android.cricitch.app.CricitchApplication.onCreate(CricitchApplication.java:69)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1013)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4609)
at android.app.ActivityThread.access$1600(ActivityThread.java:169)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1337)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5476)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
at dalvik.system.NativeStart.main(NativeStart.java)

screen shot 2016-03-31 at 8 40 40 pm

Looking forward to a new release of realm java with a fix for the same.

@beeender
Copy link
Contributor

@appsailor Can you list those devices which have this problem? Maybe we are lucky enough to have one of them to reproduce the issue.

@tristangrichard
Copy link

I am also seeing this issue in 3.7.2 within an AsyncTask
BuildTools 26

Caused by io.realm.exceptions.RealmFileException: Realm file is currently open in another process which cannot share access with this process. All processes sharing a single file must be the same architecture. (Incompatible lock file. Shared info version doesn't match, 259 10.) (/data/data/com.soudfa/files/default.realm) in /home/cc/repo/realm/release/realm/realm-library/src/main/cpp/io_realm_internal_SharedRealm.cpp line 91
       at io.realm.internal.SharedRealm.nativeGetSharedRealm(SharedRealm.java)
       at io.realm.internal.SharedRealm.(SharedRealm.java)
       at io.realm.internal.SharedRealm.getInstance(SharedRealm.java:227)
       at io.realm.BaseRealm.(BaseRealm.java)
       at io.realm.BaseRealm.(BaseRealm.java)
       at io.realm.Realm.(Realm.java)
       at io.realm.Realm.createInstance(Realm.java:417)
       at io.realm.RealmCache.doCreateRealmOrGetFromCache(RealmCache.java:348)
       at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:281)
       at io.realm.Realm.getDefaultInstance(Realm.java:325)
       at com.soudfa.Models.Account.CollectionAccount$1.doInBackground(CollectionAccount.java:112)
       at com.soudfa.Models.Account.CollectionAccount$1.doInBackground(CollectionAccount.java:108)
       at android.os.AsyncTask$2.call(AsyncTask.java:288)
       at java.util.concurrent.FutureTask.run(FutureTask.java:237)
       at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
       at java.lang.Thread.run(Thread.java:841)

@kleisauke
Copy link

kleisauke commented Nov 5, 2017

I upgraded Realm from 2.3.0 to 4.1.1. When the app was available on the Play Store, I received fairly quickly this stack trace on Fabric:

Stack trace
Fatal Exception: java.lang.RuntimeException: Unable to create application nl.kleisauke.rocrooster.TimeTableApplication: io.realm.exceptions.RealmFileException: Realm file is currently open in another process which cannot share access with this process. All processes sharing a single file must be the same architecture. (Incompatible lock file. Info size doesn't match, 1160 1184.) (/data/data/nl.kleisauke.rocrooster/files/default.realm) in /Users/Nabil/Dev/realm/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_SharedRealm.cpp line 101 Kind: INCOMPATIBLE_LOCK_FILE.
       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4612)
       at android.app.ActivityThread.access$1600(ActivityThread.java:169)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1337)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:136)
       at android.app.ActivityThread.main(ActivityThread.java:5476)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
       at dalvik.system.NativeStart.main(NativeStart.java)
Caused by io.realm.exceptions.RealmFileException: Realm file is currently open in another process which cannot share access with this process. All processes sharing a single file must be the same architecture. (Incompatible lock file. Info size doesn't match, 1160 1184.) (/data/data/nl.kleisauke.rocrooster/files/default.realm) in /Users/Nabil/Dev/realm/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_SharedRealm.cpp line 101
       at io.realm.internal.SharedRealm.nativeGetSharedRealm(SharedRealm.java)
       at io.realm.internal.SharedRealm.(SharedRealm.java)
       at io.realm.internal.SharedRealm.getInstance(SharedRealm.java:219)
       at io.realm.internal.SharedRealm.getInstance(SharedRealm.java:209)
       at io.realm.RealmCache.doCreateRealmOrGetFromCache(RealmCache.java:319)
       at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:282)
       at io.realm.DynamicRealm.getInstance(DynamicRealm.java:100)
       at nl.kleisauke.rocrooster.TimeTableApplication.onCreate(TimeTableApplication.java:79)
       at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1013)
       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4609)
       at android.app.ActivityThread.access$1600(ActivityThread.java:169)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1337)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:136)
       at android.app.ActivityThread.main(ActivityThread.java:5476)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
       at dalvik.system.NativeStart.main(NativeStart.java)
 

Additional info:
Device: Galaxy S3 Neo (not mine)
Android version: 4.4.2
Realm version: 4.1.1

Fabric link

So I can confirm that this crash (which may not be visible to users), only happens when users update their APK. When Realm 4.2.0 is released (which supports Realms in multiple processes), I can update my app and see if this issue persists.

@yshrsmz
Copy link

yshrsmz commented Nov 16, 2017

I've checked ActivityManager#getRunningAppProcesses() when the crash happens, but it seems like there is only one process(though I'm not sure if this method can recognize processes correctly)

@Zhuinden
Copy link
Contributor

Zhuinden commented Nov 16, 2017

I'll be curious to see if realm/realm-core#2902 has any impact on this (Core 4.0.3)

beeender added a commit that referenced this issue Nov 16, 2017
@beeender
Copy link
Contributor

we have a potential fix for this issue which will be released in 4.2.0.
See realm/realm-core#2902 about the explanation about the fix.

@alessandrojp
Copy link

@beeender thanks for this!
I can't wait to release it here.
I have a question, in the changelog it is saying that will be released in 4.1.2 and in your comment says 4.2.0 . Could you confirm what version it will be released and approximately when?

https://github.com/realm/realm-java/blob/master/CHANGELOG.md

@beeender
Copy link
Contributor

normally bug fixes go to the patch release so it would be released earlier before the next minor release. But it's likely that our next release will be a minor release. so the 4.1.2 will be skipped and fold everything into 4.2.0 :)
@alessandrojp

@alessandrojp
Copy link

@beeender understood, I hope it can be released very soon :)
many thanks!!

@aiurlano
Copy link

aiurlano commented Dec 3, 2017

Hi, I'm investigating this issue right now.
Now that 4.2.0 is out, did anyone have the chance to upgrade to this version? Did this fix the issue?
Thanks

@EE-GSlomin
Copy link

EE-GSlomin commented Jan 8, 2018

I ran into this issue with 4.2.0. I'm sure there are deeper underlying problems with the realm lifecycle management. Though I solved this issue by wrapping all "getDefaultInstance" calls with a synchronized block in a helper method.

This also alleviated a few other outstanding issues with the application code. It would appear that getDefaultInstance is not as thread safe as I once believed.

@Zhuinden
Copy link
Contributor

@EE-GSlomin do you by chance know which kind of "outstanding issues" it fixed?

@mirceasotan
Copy link

mirceasotan commented Aug 27, 2020

Hello, I am still getting this error
io.realm.exceptions.RealmFileException: Realm file is currently open in another process which cannot share access with this process. All processes sharing a single file must be the same architecture. (Incompatible lock file. Shared info version doesn't match, 771 10.) (/data/data/org.vom8x8.sipua/files/VOM_DB) in /Users/cm/Realm/realm-java-release/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp line 101 Kind: INCOMPATIBLE_LOCK_FILE. at io.realm.internal.OsSharedRealm.nativeGetSharedRealm(Native Method) at io.realm.internal.OsSharedRealm.<init>(OsSharedRealm.java:171) at io.realm.internal.OsSharedRealm.getInstance(OsSharedRealm.java:241) at io.realm.BaseRealm.<init>(BaseRealm.java:136) at io.realm.BaseRealm.<init>(BaseRealm.java:103) at io.realm.Realm.<init>(Realm.java:163) at io.realm.Realm.createInstance(Realm.java:499) at io.realm.RealmCache.doCreateRealmOrGetFromCache(RealmCache.java:360) at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:290) at io.realm.Realm.getInstance(Realm.java:428)

I am using io.realm:realm-gradle-plugin:6.1.0. getInstance is called from multiple looper threads and there are no repro steps. Any idea on how to address this or what might be the cause?

@OleksiiVoice
Copy link

Hi @beeender! Same as couple of guys mentioned above, I'm experiencing what seems to be the same issue on version 5.14.0 when calling Realm.getDefaultInstance(). Unfortunately weren't able reproduce the issue locally and only get it in Crashlytics reports from time to time. Do you have any thoughts on why can this be still happening and/or any workarounds/checks I can perform on the application code side to avoid it?

Fatal Exception: io.realm.exceptions.RealmFileException: Realm file is currently open in another process which cannot share access with this process. All processes sharing a single file must be the same architecture. (Incompatible lock file. Shared info version doesn't match, 771 10.) (/data/data/<package_name>/files/default.realm) in /Users/jasonflax/Development/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp line 101
       at io.realm.internal.OsSharedRealm.nativeGetSharedRealm(OsSharedRealm.java)
       at io.realm.internal.OsSharedRealm.<init>(OsSharedRealm.java:171)
       at io.realm.internal.OsSharedRealm.getInstance(OsSharedRealm.java:241)
       at io.realm.BaseRealm.<init>(BaseRealm.java:136)
       at io.realm.BaseRealm.<init>(BaseRealm.java:103)
       at io.realm.Realm.<init>(Realm.java:163)
       at io.realm.Realm.createInstance(Realm.java:499)
       at io.realm.RealmCache.doCreateRealmOrGetFromCache(RealmCache.java:355)
       at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:285)
       at io.realm.Realm.getDefaultInstance(Realm.java:407)

@cmelchior
Copy link
Contributor

@AlexeiVoice This should only happen if you try to open a Realm file that was copied to a different architecture with all our lock files in place

In general, this should not be possible on Android devices. It happens when you try to open a Realm file that was already opened on a different ABI architecture, e.g. 32 bit vs. 64 bit. This should never happen with normal use.

My best guess is:

  1. Someone copied an entire app from the phone to a different architecture and tried to run it there, e.g. copied it from a phone and ran it on an emulator.

  2. You are mistakenly shipping our lock files with your app (highly unlikely).

@mirceasotan
Copy link

@cmelchior This issue should be reopened. Our crash rate is constant with this stack trace over last few versions of Realm. Our app is managed by Google Play, so I don't understand how we could mistakenly ship lock files with our app.

@cmelchior
Copy link
Contributor

@mirceasotan Instead of reopening this issue, it would probably be better to create a new issue. Since this one has a lot of discussions probably not relevant to your issue (and the original error pertains a really old version of Realm).

We are specifically interested in getting any details of:

  1. What Android devices / versions does this happen on
  2. Does it happen after upgrading or "in general"
  3. Do you have encryption enabled

@OleksiiVoice
Copy link

@cmelchior Thanks for the response. As you suggested I've created a new issue: #7144. @mirceasotan please add any additional information to the new ticket if you can.

@edualonso
Copy link
Contributor

@AlexeiVoice please have a look at #7102 (comment) as it could explain why you experience this.

@OleksiiVoice
Copy link

@edualonso Thanks, that sounds like one of the most logical explanation! I've checked our manifest and it looks like we have android:allowBackup = false in our app, so unfortunately this one can be excluded from the possible reasons in our case.

@edualonso
Copy link
Contributor

@AlexeiVoice that's unfortunate :( Is it possible that perhaps the setting was enabled at some point and then it got turned off?

@OleksiiVoice
Copy link

@edualonso Yeah :( no, unfortunately it's been this way for quite some time

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests