realm / realm-kotlin

Kotlin Multiplatform and Android SDK for the Realm Mobile Database: Build Better Apps Faster.
Apache License 2.0
880 stars 52 forks source link

UnsatisfiedLinkError librealmc.so in CI #1704

Closed ashare80 closed 3 months ago

ashare80 commented 3 months ago

How frequently does the bug occur?

Always

Description

After upgrading from 1.12.0 to 1.14.0 unit tests cannot run in our CI environment (LINUX on x86_64) but they do pass running locally on a Mac M1.

Wondering what might have changed and possible direction for finding solutions.

Stacktrace & log output

Get this which may be related

OpenJDK 64-Bit Server VM warning: You have loaded library /home/executor/.cache/io.realm.kotlin/1.14.0/librealmc.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.

Stack trace 1:

  java.lang.ExceptionInInitializerError
        at io.realm.kotlin.internal.interop.RealmInterop.realm_set_log_callback(RealmInterop.kt:1279)
        at io.realm.kotlin.log.RealmLog.<clinit>(RealmLog.kt:49)
  Caused by: java.lang.RuntimeException: Couldn't load Realm native libraries
        at io.realm.kotlin.internal.interop.realmc.<clinit>(realmc.java:28)
        ... 124 more
  Caused by: java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at io.realm.kotlin.internal.interop.realmc.<clinit>(realmc.java:26)
        ... 124 more
  Caused by: java.lang.NullPointerException
        at io.realm.kotlin.jvm.SoLoader.unpackAndInstall(SoLoader.kt:89)
        at io.realm.kotlin.jvm.SoLoader.load(SoLoader.kt:65)
        at io.realm.kotlin.jvm.SoLoader.load(SoLoader.kt:50)
        ... 129 more
  Caused by: java.lang.NoClassDefFoundError: Could not initialize class io.realm.kotlin.log.RealmLog
  Caused by: java.lang.NoClassDefFoundError: Could not initialize class io.realm.kotlin.log.RealmLog
  Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.ExceptionInInitializerError [in thread "SDK 24 Main Thread @coroutine#15"]

Stack trace 2:

java.lang.ExceptionInInitializerError
  Caused by: java.lang.RuntimeException: Couldn't load Realm native libraries
  Caused by: java.lang.reflect.InvocationTargetException
  Caused by: java.lang.UnsatisfiedLinkError: /home/executor/.cache/io.realm.kotlin/1.14.0/librealmc.so: /home/executor/.cache/io.realm.kotlin/1.14.0/librealmc.so: file too short

Can you reproduce the bug?

Always

Reproduction Steps

No response

Version

1.14.0

What Atlas App Services are you using?

Local Database only

Are you using encryption?

No

Platform OS and version(s)

Android

Build environment

Android Studio version: Android Studio Iguana | 2023.2.1 Android Build Tools version: 8.2.2 Gradle version: 8.6

sync-by-unito[bot] commented 3 months ago

➤ PM Bot commented:

Jira ticket: RKOTLIN-1046

rorbech commented 3 months ago

Hi @ashare80. The binary shared libraries for linux and Windows slipped with our new release process for 1.14.0. It has been fix for 1.14.1.

Duplicate of #1690