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

JVM method invocations fail with JNA error (GLIBC_2.33 required while OS uses GLIBC_2.31) on Ubuntu 20.04 #347

Closed
DavidPSterling opened this issue Apr 21, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@DavidPSterling
Copy link
Contributor

Describe the bug
When running a java app with BDK-JVM and invoking a BDK method on JDK 17 Ubuntu 20.04 you get the following error:

Caused by: java.lang.UnsatisfiedLinkError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /home/jvm/app/.cache/JNA/temp/jna11330805848757947290.tmp)
        at com.sun.jna.Native.open(Native Method) ~[jna-5.6.0.jar!/:5.6.0 (b0)]
        at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:277) ~[jna-5.6.0.jar!/:5.6.0 (b0)]
        at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:461) ~[jna-5.6.0.jar!/:5.6.0 (b0)]
        at com.sun.jna.Library$Handler.<init>(Library.java:192) ~[jna-5.6.0.jar!/:5.6.0 (b0)]
        at com.sun.jna.Native.load(Native.java:596) ~[jna-5.6.0.jar!/:5.6.0 (b0)]
        at com.sun.jna.Native.load(Native.java:570) ~[jna-5.6.0.jar!/:5.6.0 (b0)]
        at org.bitcoindevkit._UniFFILib$Companion$INSTANCE$2.invoke(bdk.kt:4112) ~[bdk-jvm-0.27.1.jar!/:na]
        at org.bitcoindevkit._UniFFILib$Companion$INSTANCE$2.invoke(bdk.kt:258) ~[bdk-jvm-0.27.1.jar!/:na]
        at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74) ~[kotlin-stdlib-1.7.22.jar!/:1.7.22-release-288(1.7.22)]
        at org.bitcoindevkit._UniFFILib$Companion.getINSTANCE$lib(bdk.kt:258) ~[bdk-jvm-0.27.1.jar!/:na]
        at org.bitcoindevkit.DescriptorPublicKey$Companion.fromString(bdk.kt:1461) ~[bdk-jvm-0.27.1.jar!/:na]

The latest GLIBC on Ubuntu 20.04 is 2.31. The JNA dependency version (5.6.0) was released in July 2020 when the latest GLIBC was 2.31. The system libs are upgraded and up-to-date as per the package manager (no custom libc).

To Reproduce
Invoke a BDK method from a Java app with JDK 17 on Ubuntu 20.04

Expected behavior
No error.

Run environment

  • BDK tag/commit: 0.27.1
  • OS+version: Ubuntu 20.04.6 LTS
@DavidPSterling DavidPSterling added the bug Something isn't working label Apr 21, 2023
@DavidPSterling DavidPSterling changed the title JVM method invocations fail on Ubuntu 20.04 JVM method invocations fail with JNA error (GLIBC_2.33 required while OS uses GLIBC_2.31) on Ubuntu 20.04 Apr 21, 2023
@DavidPSterling
Copy link
Contributor Author

Fixed by compiling bdk-jvm on Ubuntu 20.04.

@thunderbiscuit
Copy link
Member

I'll revert the test and publish workflows to run on the ubuntu-20.04 image so that will fix the issue for the 0.28.0 release.

But this is pointing out a deeper issue; we should make sure we build with an old enough version of glibc that bdk-jvm works on all sorts of Linux distros, including much older ones than Ubuntu 20.04.

For example it'd be quite fair to expect users to run their servers on Debian oldstable (Debian 10, Buster), whose glibc is 2.28.

@thunderbiscuit
Copy link
Member

Closing this as it's been resolved. See #353 for continued discussion around older Linux distribution support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants