rocksdb icon indicating copy to clipboard operation
rocksdb copied to clipboard

rocksdbjni 7.5.3 + Alpine arm64 errors with "libstdc++.so.6: cannot open shared object file"

Open davidmelia opened this issue 3 years ago • 0 comments

Hi,

When initialising rocksdbjni 7.5.3 on Alpine arm 64 (Linux dbf2dddea346 5.10.124-linuxkit #1 SMP PREEMPT Thu Jun 30 08:18:26 UTC 2022 aarch64 Linux)

this errors with

libstdc++.so.6: cannot open shared object file: No such file or directory

Expected behavior

Rocks DB on alpine arm64 should load the rocksdb native libraries.

Actual behavior

java.lang.UnsatisfiedLinkError: /tmp/librocksdbjni5890853752640758745.so: libstdc++.so.6: cannot open shared object file: No such file or directory
	at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
	at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(Unknown Source)
	at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source)
	at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source)
	at java.base/java.lang.ClassLoader.loadLibrary(Unknown Source)
	at java.base/java.lang.Runtime.load0(Unknown Source)
	at java.base/java.lang.System.load(Unknown Source)
	at org.rocksdb.NativeLibraryLoader.loadLibraryFromJar(NativeLibraryLoader.java:102)
	at org.rocksdb.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:82)
	at org.rocksdb.RocksDB.loadLibrary(RocksDB.java:70)
	at org.rocksdb.RocksDB.<clinit>(RocksDB.java:39)

Steps to reproduce the behavior

I have a very simple Java 17 rocksdbjni 7.5.3 GitHub docker project https://github.com/davidmelia/rocksdb-aarch64alpine-issue to illustrate this issue where I have an amd64 container (which works) versus arm64 container which errors.

Invoking the amd64 via ./buildAndRunAmd64.sh works fine giving

Attempting to load RocksDB
Loaded RocksDB JNI

Invoking arm64 via ./buildAndRunArm64.sh errors with

Attempting to load RocksDB
java.lang.UnsatisfiedLinkError: /tmp/librocksdbjni2970121315890144650.so: libstdc++.so.6: cannot open shared object file: No such file or directory
	at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
	at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(Unknown Source)
	at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source)
	at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source)
	at java.base/java.lang.ClassLoader.loadLibrary(Unknown Source)
	at java.base/java.lang.Runtime.load0(Unknown Source)
	at java.base/java.lang.System.load(Unknown Source)
	at org.rocksdb.NativeLibraryLoader.loadLibraryFromJar(NativeLibraryLoader.java:102)
	at org.rocksdb.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:82)
	at org.rocksdb.RocksDB.loadLibrary(RocksDB.java:70)
	at org.rocksdb.RocksDB.<clinit>(RocksDB.java:39)
	at Run.main(Run.java:8)

Thanks

davidmelia avatar Sep 08 '22 08:09 davidmelia