kawamuray / wasmtime-java

Java or JVM-language binding for Wasmtime
Apache License 2.0
127 stars 29 forks source link

Not working inside alpine container #25

Open arun-at-work opened 2 years ago

arun-at-work commented 2 years ago

nested exception is java.lang.UnsatisfiedLinkError: /tmp/libwasmtime_jni_0.4.0_linux8143220619514777066.so: Error relocating /tmp/libwasmtime_jni_0.4.0_linux8143220619514777066.so: __longjmp_chk: symbol not found

kawamuray commented 2 years ago

Hi, thanks for reporting the issue :)

I think the problem here is that alpine linux by default provides only musl libc apparently, while shared object of wasmtime-java JNI component is built with GNU libc (glibc).

Would it possibly run by following this guide? https://wiki.alpinelinux.org/wiki/Running_glibc_programs

arun-at-work commented 2 years ago

Not sure i am doing it right on alpine:3.14.2 even After apk add gcompat

Output of

ldd libwasmtime_jni_0.4.0_linux.so is /lib/ld-musl-x86_64.so.1 (0x7fd5ceb17000) Error loading shared library libgcc_s.so.1: No such file or directory (needed by libwasmtime_jni_0.4.0_linux.so) librt.so.1 => /lib/ld-musl-x86_64.so.1 (0x7fd5ceb17000) libpthread.so.0 => /lib/ld-musl-x86_64.so.1 (0x7fd5ceb17000) libm.so.6 => /lib/ld-musl-x86_64.so.1 (0x7fd5ceb17000) libdl.so.2 => /lib/ld-musl-x86_64.so.1 (0x7fd5ceb17000) libc.so.6 => /lib/ld-musl-x86_64.so.1 (0x7fd5ceb17000) ld-linux-x86-64.so.2 => /lib/ld-linux-x86-64.so.2 (0x7fd5ce0bc000) Error relocating libwasmtime_jni_0.4.0_linux.so: longjmp_chk: symbol not found Error relocating libwasmtime_jni_0.4.0_linux.so: memcpy_chk: symbol not found Error relocating libwasmtime_jni_0.4.0_linux.so: _Unwind_Resume: symbol not found Error relocating libwasmtime_jni_0.4.0_linux.so: __register_frame: symbol not found Error relocating libwasmtime_jni_0.4.0_linux.so: _Unwind_GetIPInfo: symbol not found Error relocating libwasmtime_jni_0.4.0_linux.so: _Unwind_GetDataRelBase: symbol not found Error relocating libwasmtime_jni_0.4.0_linux.so: _Unwind_GetRegionStart: symbol not found Error relocating libwasmtime_jni_0.4.0_linux.so: _Unwind_SetGR: symbol not found Error relocating libwasmtime_jni_0.4.0_linux.so: _Unwind_FindEnclosingFunction: symbol not found Error relocating libwasmtime_jni_0.4.0_linux.so: _Unwind_GetTextRelBase: symbol not found Error relocating libwasmtime_jni_0.4.0_linux.so: _Unwind_DeleteException: symbol not found Error relocating libwasmtime_jni_0.4.0_linux.so: __deregister_frame: symbol not found Error relocating libwasmtime_jni_0.4.0_linux.so: _Unwind_RaiseException: symbol not found Error relocating libwasmtime_jni_0.4.0_linux.so: _Unwind_GetIP: symbol not found Error relocating libwasmtime_jni_0.4.0_linux.so: _Unwind_Backtrace: symbol not found Error relocating libwasmtime_jni_0.4.0_linux.so: _Unwind_GetCFA: symbol not found Error relocating libwasmtime_jni_0.4.0_linux.so: _Unwind_GetLanguageSpecificData: symbol not found Error relocating libwasmtime_jni_0.4.0_linux.so: _Unwind_SetIP: symbol not found

kawamuray commented 2 years ago

Have you run ldconfig between apk add and ldd? I think ldd relies on cache so you have to refresh it first.

Not sure if related but some ggling told me that there's another package libc6-compat https://stackoverflow.com/questions/50288034/unsatisfiedlinkerror-tmp-snappy-1-1-4-libsnappyjava-so-error-loading-shared-li which may worth trying