realm-java icon indicating copy to clipboard operation
realm-java copied to clipboard

UnsatisfiedLinkError while loading native library librealm-jni.so.2.2.1

Open rubensousa opened this issue 9 years ago • 14 comments

Goal

What do you want to achieve?

Realm initialization with success

Actual Results

Exception java.lang.UnsatisfiedLinkError: Cannot load library: soinfo_relocate(linker.cpp:992): cannot locate symbol "pipe2" referenced by "librealm-jni.so.2.2.1"...
java.lang.Runtime.load (Runtime.java:341)
java.lang.System.load (System.java:500)
com.getkeepsafe.a.e.b (SystemLibraryLoader.java:29)
com.getkeepsafe.a.d.c (ReLinkerInstance.java:198)
com.getkeepsafe.a.d.a (ReLinkerInstance.java:136)
com.getkeepsafe.a.c.a (ReLinker.java:70)
com.getkeepsafe.a.c.a (ReLinker.java:57)
io.realm.internal.j.a (RealmCore.java:61)
io.realm.v.a (Realm.java:187)
io.github.rubensousa.euromillions.App.onCreate (App.java:45)
android.app.Instrumentation.callApplicationOnCreate (Instrumentation.java:1065)
android.app.ActivityThread.handleBindApplication (ActivityThread.java:4640)
android.app.ActivityThread.access$1300 (ActivityThread.java:165)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1433)
android.os.Handler.dispatchMessage (Handler.java:107)
android.os.Looper.loop (Looper.java:194)
android.app.ActivityThread.main (ActivityThread.java:5370)
java.lang.reflect.Method.invokeNative (Method.java)
java.lang.reflect.Method.invoke (Method.java:525)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:833)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:600)
dalvik.system.NativeStart.main (NativeStart.java)

Steps & Code to Reproduce

Couldn't debug this since it happens in a rare chinese tablet: https://secretspecs.com/model/teclast/teclast-g17(b5dv/

The exception is thrown while attempting to call:

Realm.init(this);

I think this is probably a Relinker issue and not a realm one, but I figured I should post this here.

Version of Realm and tooling

Realm version(s): 2.2.1

Realm sync feature enabled: no

Android Studio version: 2.2.3

Which Android version and device: Teclast G17(B5DV) API 17 (4.2.2) https://secretspecs.com/model/teclast/teclast-g17(b5dv/

rubensousa avatar Dec 23 '16 23:12 rubensousa

It seems to be a problem with that device's native lib.

Do you have any other native so files for your apk?

beeender avatar Dec 26 '16 03:12 beeender

No, just Realm's. It's probably something that's not fixable, right?

rubensousa avatar Dec 26 '16 11:12 rubensousa

Well, if we can get a device to reproduce the issue, maybe we can find a workaround ... It is difficult to tell what is going wrong right now ... I can keep this issue open for a while to see if there are any other devices meet the same issue.

beeender avatar Dec 26 '16 12:12 beeender

Happens on following devices : ARMOR T40 , RX400 OS: 4.4.2 , 4.2.2 , 4.3

slezadav avatar Dec 28 '16 07:12 slezadav

@beeender well according to the error message, the pipe2 method call in Object Store doesn't exist on that device

Zhuinden avatar Dec 28 '16 11:12 Zhuinden

@Zhuinden Thanks! I grepped core source code yesterday but missed the object-store. I will check this.

beeender avatar Dec 28 '16 11:12 beeender

pipe2() should be introduced in API 9 https://github.com/android/platform_bionic/blob/master/libc/include/unistd.h#L137 ... Let's see if we can avoid calling that, hate those kind of problems ...

beeender avatar Dec 28 '16 11:12 beeender

@slezadav Can you see the kernel versions with those problematic devices?

beeender avatar Dec 28 '16 11:12 beeender

I am not quite sure if this should be fixed from realm side. VLC android has a similar issue with pipe2 but that is to fix the pipe2 declaration missing before API 9. https://mailman.videolan.org/pipermail/vlc-devel/2011-September/081216.html

realm-java support Android API >= 10 right now, in theory, pipe2 should be in place.

I don't know if it is just caused by missing the call in the bionic or it just doesn't have the system call on the device :(

bionic added pipe2 by https://android.googlesource.com/platform/bionic/+/275cd48511daabe4591caa49c3ad0df34a6889ff%5E!/

@slezadav @rubensousa May I know how many devices are impacted by this issue?

beeender avatar Dec 29 '16 04:12 beeender

@beeender Sadly I cannot see the kernel versions. We have 5 devices reporting this crash : iGET_Star_P400,Rim Passport,Rim Q10,alps RX400,alps ARMOR T40.

slezadav avatar Dec 29 '16 06:12 slezadav

Skype seems to have the same problem https://community.skype.com/t5/Android-%D0%90%D1%80%D1%85%D0%B8%D0%B2/%D0%9F%D0%B5%D1%80%D0%B5%D1%81%D1%82%D0%B0%D0%BB-%D0%B7%D0%B0%D0%BF%D1%83%D1%81%D0%BA%D0%B0%D1%82%D1%8C%D1%81%D1%8F-Skype-%D0%BD%D0%B0-Android-4-2-2/td-p/3189852

beeender avatar Dec 29 '16 07:12 beeender

@beeender I only saw the crash on the: Teclast G17(B5DV)

rubensousa avatar Jan 01 '17 22:01 rubensousa

Rim Passport,Rim Q10

Oh boy, the Blackberry devices are at it again.

Are they the same crash?

Zhuinden avatar Jan 02 '17 07:01 Zhuinden

@Zhuinden I hope so ... if the crash messages are the same, the issue with BB Q10 should be fixed by https://github.com/realm/realm-object-store/pull/307

beeender avatar Jan 04 '17 02:01 beeender