luben / zstd-jni

JNI binding for Zstd
Other
809 stars 165 forks source link

s390x ubuntu 20.04: java.lang.UnsatisfiedLinkError: ... libc.so.6: version `GLIBC_2.34' not found #257

Closed jonathan-albrecht-ibm closed 1 year ago

jonathan-albrecht-ibm commented 1 year ago

I'm running into an error when testing Apache HBase which uses zstd-jni 1.5.4-2 as a dependency. On s390x ubuntu 20.04 I'm getting the error below. I think the native zstd library is being cross built on a distribution with a newer glibc.

I was able to cross build the s390x native lib in a x86_64 ubuntu 18.04 docker container using the make_so_cross.sh script. All of the required packages (gcc-s390x-linux-gnu, rsync) installed with apt out of the box. I copied the native lib over to my s390x ubuntu 20.04 box and both a quick smoke test and the HBase zstd compression tests were successful.

From testing locally, I found that the error started with version 1.5.2-5. Would it be possible to publish new versions of the 1.5.2, 1.5.4 and 1.5.5 jars with the s390x native lib compiled against an older glibc?

java.lang.UnsatisfiedLinkError: /tmp/libzstd-jni-1.5.2-56965050400990853082.so: /lib/s390x-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /tmp/libzstd-jni-1.5.2-56965050400990853082.so)
no zstd-jni-1.5.2-5 in java.library.path: [/usr/java/packages/lib, /usr/lib/s390x-linux-gnu/jni, /lib/s390x-linux-gnu, /usr/lib/s390x-linux-gnu, /usr/lib/jni, /lib, /usr/lib]
Unsupported OS/arch, cannot find /linux/s390x/libzstd-jni-1.5.2-5.so or load zstd-jni-1.5.2-5 from system libraries. Please try building from source the jar or providing libzstd-jni-1.5.2-5 in your system." type="java.lang.UnsatisfiedLinkError">java.lang.UnsatisfiedLinkError: /tmp/libzstd-jni-1.5.2-56965050400990853082.so: /lib/s390x-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /tmp/libzstd-jni-1.5.2-56965050400990853082.so)
no zstd-jni-1.5.2-5 in java.library.path: [/usr/java/packages/lib, /usr/lib/s390x-linux-gnu/jni, /lib/s390x-linux-gnu, /usr/lib/s390x-linux-gnu, /usr/lib/jni, /lib, /usr/lib]
Unsupported OS/arch, cannot find /linux/s390x/libzstd-jni-1.5.2-5.so or load zstd-jni-1.5.2-5 from system libraries. Please try building from source the jar or providing libzstd-jni-1.5.2-5 in your system.
        at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2673)
        at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)
        at java.base/java.lang.System.loadLibrary(System.java:1873)
        at com.github.luben.zstd.util.Native.load(Native.java:134)
        at com.github.luben.zstd.util.Native.load(Native.java:65)
        at com.github.luben.zstd.Zstd.<clinit>(Zstd.java:13)
luben commented 1 year ago

Hi, yes. I will try to publish new versions

jonathan-albrecht-ibm commented 1 year ago

Thanks @luben !

luben commented 1 year ago

I have pushed 1.5.5-2 with s390 build against older glibc.

On maven I cannot overwrite already published version. AFAIK there is rarely automatic updates of dependencies - I don't think mvn, gradle or sbt supports it. So the question is what would be the usefulness of new builds? If people want to update, they can jump to 1.5.5-2. Moreover for 1.5.4 that was quite short lived due to bug discovered in upstream, so 1.5.5 has minimal changes on top of 1.5.4.

jonathan-albrecht-ibm commented 1 year ago

Thanks @luben! I tried 1.5.5-2 and its working for me on ubuntu 20.04. A quick smoke test on rhel 7.8 also worked.

I think the new 1.5.5-2 version should be enough to resolve my issues. Thanks for getting the fix out so quickly.