Bug 587

Summary: The temporary directory used by jogl to unpack native libraries may not be executable
Product: [JogAmp] Jogl Reporter: Mark Raynsford <org.jogamp>
Component: coreAssignee: Sven Gothel <sgothel>
Status: RESOLVED FIXED    
Severity: normal CC: sgothel
Priority: ---    
Version: 2   
Hardware: All   
OS: all   
Type: --- SCM Refs:
gluegen 1468286bf569a493e4fdb887d5f3732f88c8cec3 jogl 29e70f215069643c740e1b251490aa9edd61d2cb
Workaround: ---

Description Mark Raynsford 2012-06-13 14:54:44 CEST
This will usually result in an error such as:

Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/jogamp.tmp.cache_000000/jln8068820674097688578/jln3098016816860882408/libgluegen-rt.so: /tmp/jogamp.tmp.cache_000000/jln8068820674097688578/jln3098016816860882408/libgluegen-rt.so: failed to map segment from shared object: Operation not permitted

Unfortunately, it's not possible to reliably check whether a directory is on a filesystem that's mounted noexec.

Suggested workaround is to use $XDG_CACHE_HOME, falling back to $HOME/.cache on Linux.
Comment 1 Mark Raynsford 2012-06-13 14:56:24 CEST
Should probably be $XDG_CACHE_HOME/jogamp, or $HOME/.cache/jogamp.
Comment 3 Sven Gothel 2012-06-16 05:35:51 CEST
Fixed:
gluegen 1468286bf569a493e4fdb887d5f3732f88c8cec3
jogl 29e70f215069643c740e1b251490aa9edd61d2cb

Use alternative storage location if platform's temp directory is mounted w/ noexec ; IOUtil API change!
    
    Test whether executable files can be launched in temporary folder
    by trying to run an empty executable file - if !( WINDOWS | OPENKODE )
    
    TempDir:
    1) ${java.io.tmpdir}/jogamp
    2) $XDG_CACHE_HOME/jogamp - if !( ANDROID | MACOS | WINDOWS | OPENKODE )
    3) $HOME/.jogamp
    
    $XDG_CACHE_HOME defaults to $HOME/.cache
    
    - TempFileCache: ${TempDir}/file_cache -> ${java.io.tmpdir}/jogamp/file_cache
    - LauncherTempFileCache: ${TempDir}/file_cache -> ${java.io.tmpdir}/jogamp/file_cache