Menu

#24 UnsatisfiedLinkError upon sevenzipbinding initialization

open
None
5
2017-05-29
2017-05-29
No

Hi,

I am using sevenzipjbinding-AllPlatforms-4.65-1.06-rc.jar on Ubuntu 12.04 from java application.
It was stable for long time but suddenly i received the following error:

java.lang.UnsatisfiedLinkError: /data/manager/tmp/SevenZipJBinding-bqNzq/lib7-Zip-JBinding.so: /data/manager/tmp/SevenZipJBinding-bqNzq/lib7-Zip-JBinding.so: failed to map segment from shared object: Operation not permitted
        at java.lang.ClassLoader$NativeLibrary.load(Native Method) ~[na:1.8.0_91]
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941) ~[na:1.8.0_91]
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824) ~[na:1.8.0_91]
        at java.lang.Runtime.load0(Runtime.java:809) ~[na:1.8.0_91]
        at java.lang.System.load(System.java:1086) ~[na:1.8.0_91]
        at net.sf.sevenzipjbinding.SevenZip.loadNativeLibraries(SevenZip.java:509) ~[sevenzipjbinding-4.65-1.06-rc.jar:na]
        ... 49 common frames omitted
Wrapped by: net.sf.sevenzipjbinding.SevenZipNativeInitializationException: 7-Zip-JBinding initialization failed: Error loading native library: '/data/manager/tmp/SevenZipJBinding-bqNzq/lib7-Zip-JBinding.so'

After that 7zip just refused to be initialized no matter what i tried. The only solution that worked for me was to reinstall the application which redeployed the 7zip files.
I looked at the permissins of /data/manager/tmp and it have rwx permissions as it supposed to be.
I dont have any clue in our logs why this happened.

  1. Can you maybe help us to understand what may cause such error to appear? This might help us to prepare and protect our app from such cases
  2. How this can be fixed "Gracefully"? (no server reboot\app reinstalling)

Thanks a lot in advance,
Dani Gelmanovich

Discussion

  • Dani Gelmanovich

    Hi,

    I think i got it:
    /data/manager/tmp was my temp folder for sevenzip and it had indeed rwx permissions.
    The issue is that the partition of /data is set with "noexec" flag. I thing that this might be the root cause.
    Maybe its a good chance to add guidelines in the documentation indicating that the partition of the tmp folder must not have "noexec" flag

     

Log in to post a comment.