Closed CodingFabian closed 8 years ago
That's a weird one. What happens if you pre-extract the library, add it to the java.library.path
at Java startup, and then use System.loadLibrary
as normal? Does that work? And what happens if you pre-extract it, then use System.load
without it being on java.library.path
? Differences here may shed some light on where/how things are going wrong.
If it still hangs with System.loadLibrary
, then perhaps this SO thread can help shed some light on it.
If it doesn't hang with System.loadLibrary
, perhaps it has to do with the dependencies of the native library? Because System.load
is very low level and much more "fragile" in that sense than loadLibrary
is. And my understanding is that in some cases at least, you need to load the native dependency tree in reverse order for things to work properly.
Thank you @ctrueden for your reply, I will experiment tomorrow and let you know if that sheds light onto this. Just a bit more info. I was able to get the very same application running using Alpine (which is an enhanced busybox) and of course centos and ubuntu. Right now it feels to me that some syscalls in busybox are misbehaving (never dug that deep in kernel code..)
@CodingFabian Since it sounds like this is/was likely a busybox issue, I'm closing the issue here. But please feel warmly welcome to reopen this, and/or file a new issue, if you believe native-lib-loader plays any part in the problematic behavior!
Hi, i tried running a java app which uses junixsocket in a busybox linux container. junixsocket uses your project to load its native file. the thread dump looks like this
I can see that the file was extracted successfully to
/tmp/libjunixsocket-native-2.0.45209276038407333080.so
everything in this container runs under root and I can read the library.Do you have any idea how to fix this? I can spend some time troubleshooting this. The base image I use is
progrium/busybox