Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Not A Bug
    • Affects Version/s: JRuby 1.6.7
    • Fix Version/s: None
    • Component/s: Ruby 1.8.7
    • Labels:
      None
    • Environment:
      Red Hat Enterprise Linux Server release 5.6 (Tikanga)
      Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
      Java HotSpot(TM) Server VM (build 14.3-b01, mixed mode)
    • Number of attachments :
      0

      Description

      java -jar jruby-complete-1.6.7.jar -e "File.read('nohup.out')"

      Got error:

      java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: /tmp/jffi3528612306651138541.tmp: /tmp/jffi3528612306651138541.tmp: failed to map segment from shared object: Operation not permitted
      	at com.kenai.jffi.Foreign$InValidInstanceHolder.getForeign(Foreign.java:90)
      	at com.kenai.jffi.Foreign.getInstance(Foreign.java:95)
      	at com.kenai.jffi.Library.openLibrary(Library.java:151)
      	at com.kenai.jffi.Library.getCachedInstance(Library.java:125)
      	at com.kenai.jaffl.provider.jffi.Library.loadNativeLibraries(Library.java:66)
      	at com.kenai.jaffl.provider.jffi.Library.getNativeLibraries(Library.java:56)
      	at com.kenai.jaffl.provider.jffi.Library.getSymbolAddress(Library.java:35)
      	at com.kenai.jaffl.provider.jffi.Library.findSymbolAddress(Library.java:45)
      	at com.kenai.jaffl.provider.jffi.AsmLibraryLoader.generateInterfaceImpl(AsmLibraryLoader.java:188)
      	at com.kenai.jaffl.provider.jffi.AsmLibraryLoader.loadLibrary(AsmLibraryLoader.java:110)
      	at com.kenai.jaffl.provider.jffi.Provider.loadLibrary(Provider.java:31)
      	at com.kenai.jaffl.provider.jffi.Provider.loadLibrary(Provider.java:25)
      	at com.kenai.jaffl.Library.loadLibrary(Library.java:76)
      	at org.jruby.ext.posix.POSIXFactory$LinuxLibCProvider$SingletonHolder.<clinit>(POSIXFactory.java:108)
      	at org.jruby.ext.posix.POSIXFactory$LinuxLibCProvider.getLibC(POSIXFactory.java:112)
      	at org.jruby.ext.posix.BaseNativePOSIX.<init>(BaseNativePOSIX.java:30)
      	at org.jruby.ext.posix.LinuxPOSIX.<init>(LinuxPOSIX.java:17)
      	at org.jruby.ext.posix.POSIXFactory.loadLinuxPOSIX(POSIXFactory.java:70)
      	at org.jruby.ext.posix.POSIXFactory.loadPOSIX(POSIXFactory.java:31)
      	at org.jruby.ext.posix.LazyPOSIX.loadPOSIX(LazyPOSIX.java:29)
      	at org.jruby.ext.posix.LazyPOSIX.posix(LazyPOSIX.java:25)
      	at org.jruby.ext.posix.LazyPOSIX.stat(LazyPOSIX.java:235)
      	at org.jruby.RubyFileTest.directory_p(RubyFileTest.java:102)
      	at org.jruby.RubyFileTest.directory_p(RubyFileTest.java:82)
      	at org.jruby.RubyIO.failIfDirectory(RubyIO.java:3384)
      	at org.jruby.RubyIO.readStatic(RubyIO.java:3411)
      	at org.jruby.RubyIO$s$readStatic.call(RubyIO$s$readStatic.gen:65535)
      	at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:312)
      	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:169)
      	at ruby.__dash_e__.__file__(-e:1)
      	at ruby.__dash_e__.load(-e)
      	at org.jruby.Ruby.runScript(Ruby.java:697)
      	at org.jruby.Ruby.runScript(Ruby.java:690)
      	at org.jruby.Ruby.runNormally(Ruby.java:597)
      	at org.jruby.Ruby.runFromMain(Ruby.java:446)
      	at org.jruby.Main.doRunFromMain(Main.java:369)
      	at org.jruby.Main.internalRun(Main.java:258)
      	at org.jruby.Main.run(Main.java:224)
      	at org.jruby.Main.run(Main.java:208)
      	at org.jruby.Main.main(Main.java:188)
      Caused by: java.lang.UnsatisfiedLinkError: /tmp/jffi3528612306651138541.tmp: /tmp/jffi3528612306651138541.tmp: failed to map segment from shared object: Operation not permitted
      	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
      	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1758)
      	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1654)
      	at java.lang.Runtime.load0(Runtime.java:770)
      	at java.lang.System.load(System.java:1003)
      	at com.kenai.jffi.Init.loadFromJar(Init.java:164)
      	at com.kenai.jffi.Init.load(Init.java:78)
      	at com.kenai.jffi.Foreign$InstanceHolder.getInstanceHolder(Foreign.java:49)
      	at com.kenai.jffi.Foreign$InstanceHolder.<clinit>(Foreign.java:45)
      	at com.kenai.jffi.Foreign.getInstance(Foreign.java:95)
      	at com.kenai.jffi.Internals.getErrnoSaveFunction(Internals.java:44)
      	at com.kenai.jaffl.provider.jffi.StubCompiler.getErrnoSaveFunction(StubCompiler.java:68)
      	at com.kenai.jaffl.provider.jffi.StubCompiler.<clinit>(StubCompiler.java:18)
      	at com.kenai.jaffl.provider.jffi.AsmLibraryLoader.generateInterfaceImpl(AsmLibraryLoader.java:146)
      	... 31 more
      Type.java:212:in `size': java.lang.ExceptionInInitializerError
      	from Provider.java:62:in `size'
      	from Constants.java:9:in `<clinit>'
      	from Struct.java:1062:in `<init>'
      	from HeapStruct.java:43:in `<init>'
      	from LinuxHeapFileStat.java:35:in `<init>'
      	from LinuxPOSIX.java:26:in `allocateStat'
      	from LinuxPOSIX.java:107:in `stat'
      	from LazyPOSIX.java:235:in `stat'
      	from RubyFileTest.java:102:in `directory_p'
      	from RubyFileTest.java:82:in `directory_p'
      	from RubyIO.java:3384:in `failIfDirectory'
      	from RubyIO.java:3411:in `readStatic'
      	from RubyIO$s$readStatic.gen:65535:in `call'
      	from CachingCallSite.java:312:in `cacheAndCall'
      	from CachingCallSite.java:169:in `call'
      	from -e:1:in `__file__'
      	from -e:-1:in `load'
      	from Ruby.java:697:in `runScript'
      	from Ruby.java:690:in `runScript'
      	from Ruby.java:597:in `runNormally'
      	from Ruby.java:446:in `runFromMain'
      	from Main.java:369:in `doRunFromMain'
      	from Main.java:258:in `internalRun'
      	from Main.java:224:in `run'
      	from Main.java:208:in `run'
      	from Main.java:188:in `main'
      Caused by:
      Foreign.java:90:in `getForeign': java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: /tmp/jffi3528612306651138541.tmp: /tmp/jffi3528612306651138541.tmp: failed to map segment from shared object: Operation not permitted
      	from Foreign.java:95:in `getInstance'
      	from Type.java:241:in `<clinit>'
      	from Type.java:212:in `size'
      	from Provider.java:62:in `size'
      	from Constants.java:9:in `<clinit>'
      	from Struct.java:1062:in `<init>'
      	from HeapStruct.java:43:in `<init>'
      	from LinuxHeapFileStat.java:35:in `<init>'
      	from LinuxPOSIX.java:26:in `allocateStat'
      	from LinuxPOSIX.java:107:in `stat'
      	from LazyPOSIX.java:235:in `stat'
      	from RubyFileTest.java:102:in `directory_p'
      	from RubyFileTest.java:82:in `directory_p'
      	from RubyIO.java:3384:in `failIfDirectory'
      	from RubyIO.java:3411:in `readStatic'
      	from RubyIO$s$readStatic.gen:65535:in `call'
      	from CachingCallSite.java:312:in `cacheAndCall'
      	from CachingCallSite.java:169:in `call'
      	from -e:1:in `__file__'
      	from -e:-1:in `load'
      	from Ruby.java:697:in `runScript'
      	from Ruby.java:690:in `runScript'
      	from Ruby.java:597:in `runNormally'
      	from Ruby.java:446:in `runFromMain'
      	from Main.java:369:in `doRunFromMain'
      	from Main.java:258:in `internalRun'
      	from Main.java:224:in `run'
      	from Main.java:208:in `run'
      	from Main.java:188:in `main'
      Caused by:
      ClassLoader.java:-2:in `load': java.lang.UnsatisfiedLinkError: /tmp/jffi3528612306651138541.tmp: /tmp/jffi3528612306651138541.tmp: failed to map segment from shared object: Operation not permitted
      	from ClassLoader.java:1758:in `loadLibrary0'
      	from ClassLoader.java:1654:in `loadLibrary'
      	from Runtime.java:770:in `load0'
      	from System.java:1003:in `load'
      	from Init.java:164:in `loadFromJar'
      	from Init.java:78:in `load'
      	from Foreign.java:49:in `getInstanceHolder'
      	from Foreign.java:45:in `<clinit>'
      	from Foreign.java:95:in `getInstance'
      	from Internals.java:44:in `getErrnoSaveFunction'
      	from StubCompiler.java:68:in `getErrnoSaveFunction'
      	from StubCompiler.java:18:in `<clinit>'
      	from AsmLibraryLoader.java:146:in `generateInterfaceImpl'
      	from AsmLibraryLoader.java:110:in `loadLibrary'
      	from Provider.java:31:in `loadLibrary'
      	from Provider.java:25:in `loadLibrary'
      	from Library.java:76:in `loadLibrary'
      	from POSIXFactory.java:108:in `<clinit>'
      	from POSIXFactory.java:112:in `getLibC'
      	from BaseNativePOSIX.java:30:in `<init>'
      	from LinuxPOSIX.java:17:in `<init>'
      	from POSIXFactory.java:70:in `loadLinuxPOSIX'
      	from POSIXFactory.java:31:in `loadPOSIX'
      	from LazyPOSIX.java:29:in `loadPOSIX'
      	from LazyPOSIX.java:25:in `posix'
      	from LazyPOSIX.java:235:in `stat'
      	from RubyFileTest.java:102:in `directory_p'
      	from RubyFileTest.java:82:in `directory_p'
      	from RubyIO.java:3384:in `failIfDirectory'
      	from RubyIO.java:3411:in `readStatic'
      	from RubyIO$s$readStatic.gen:65535:in `call'
      	from CachingCallSite.java:312:in `cacheAndCall'
      	from CachingCallSite.java:169:in `call'
      	from -e:1:in `__file__'
      	from -e:-1:in `load'
      	from Ruby.java:697:in `runScript'
      	from Ruby.java:690:in `runScript'
      	from Ruby.java:597:in `runNormally'
      	from Ruby.java:446:in `runFromMain'
      	from Main.java:369:in `doRunFromMain'
      	from Main.java:258:in `internalRun'
      	from Main.java:224:in `run'
      	from Main.java:208:in `run'
      	from Main.java:188:in `main'
      

        Activity

        Hide
        Li Xiao added a comment -

        Tested on most of jruby 1.6.+ complete jar, only 1.6.0.rc1 works fine, all of others have this issue

        Show
        Li Xiao added a comment - Tested on most of jruby 1.6.+ complete jar, only 1.6.0.rc1 works fine, all of others have this issue
        Hide
        Li Xiao added a comment -

        8c33bb3dc5df2e6a5bc9d027dc9daf055b0af755 is the first bad commit
        commit 8c33bb3dc5df2e6a5bc9d027dc9daf055b0af755
        Author: Wayne Meissner <wmeissner@gmail.com>
        Date: Tue Feb 1 22:16:08 2011 +1000

        Upgrade to jaffl-0.5.9 and jffi-1.0.6

        Show
        Li Xiao added a comment - 8c33bb3dc5df2e6a5bc9d027dc9daf055b0af755 is the first bad commit commit 8c33bb3dc5df2e6a5bc9d027dc9daf055b0af755 Author: Wayne Meissner <wmeissner@gmail.com> Date: Tue Feb 1 22:16:08 2011 +1000 Upgrade to jaffl-0.5.9 and jffi-1.0.6
        Hide
        Hiro Asari added a comment -

        Could you test the master? http://ci.jruby.org/snapshots/master/

        Show
        Hiro Asari added a comment - Could you test the master? http://ci.jruby.org/snapshots/master/
        Hide
        Li Xiao added a comment -
        Show
        Li Xiao added a comment - http://ci.jruby.org/snapshots/master/ has same issue.
        Hide
        Li Xiao added a comment -

        find out a workaround, change jvm default tmp dir (-Djava.io.tmpdir ) to somewhere else (same disk with jruby complete jar).

        The system tmp dir "/tmp" is on another disk, I don't know whether this is causing the issue:

        > df
        Filesystem 1K-blocks Used Available Use% Mounted on
        /dev/sda5 62619868 29173256 30214336 50% /
        /dev/sda1 101086 22795 73072 24% /boot
        tmpfs 16470432 0 16470432 0% /dev/shm
        /dev/sda3 2030768 56788 1869156 3% /tmp
        192.168.8.17:/home/xxx
        134655488 121336864 13318624 91% /home/xxx
        192.168.8.17:/home/xxx
        134655488 121336864 13318624 91% /home/xxx

        Show
        Li Xiao added a comment - find out a workaround, change jvm default tmp dir (-Djava.io.tmpdir ) to somewhere else (same disk with jruby complete jar). The system tmp dir "/tmp" is on another disk, I don't know whether this is causing the issue: > df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda5 62619868 29173256 30214336 50% / /dev/sda1 101086 22795 73072 24% /boot tmpfs 16470432 0 16470432 0% /dev/shm /dev/sda3 2030768 56788 1869156 3% /tmp 192.168.8.17:/home/xxx 134655488 121336864 13318624 91% /home/xxx 192.168.8.17:/home/xxx 134655488 121336864 13318624 91% /home/xxx
        Hide
        Hiro Asari added a comment -

        Can you try a more recent version of JVM than 1.6 u17?

        Show
        Hiro Asari added a comment - Can you try a more recent version of JVM than 1.6 u17?
        Hiro Asari made changes -
        Field Original Value New Value
        Description java -jar jruby-complete-1.6.7.jar -e "File.read('nohup.out')"

        Got error:

        java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: /tmp/jffi3528612306651138541.tmp: /tmp/jffi3528612306651138541.tmp: failed to map segment from shared object: Operation not permitted
        at com.kenai.jffi.Foreign$InValidInstanceHolder.getForeign(Foreign.java:90)
        at com.kenai.jffi.Foreign.getInstance(Foreign.java:95)
        at com.kenai.jffi.Library.openLibrary(Library.java:151)
        at com.kenai.jffi.Library.getCachedInstance(Library.java:125)
        at com.kenai.jaffl.provider.jffi.Library.loadNativeLibraries(Library.java:66)
        at com.kenai.jaffl.provider.jffi.Library.getNativeLibraries(Library.java:56)
        at com.kenai.jaffl.provider.jffi.Library.getSymbolAddress(Library.java:35)
        at com.kenai.jaffl.provider.jffi.Library.findSymbolAddress(Library.java:45)
        at com.kenai.jaffl.provider.jffi.AsmLibraryLoader.generateInterfaceImpl(AsmLibraryLoader.java:188)
        at com.kenai.jaffl.provider.jffi.AsmLibraryLoader.loadLibrary(AsmLibraryLoader.java:110)
        at com.kenai.jaffl.provider.jffi.Provider.loadLibrary(Provider.java:31)
        at com.kenai.jaffl.provider.jffi.Provider.loadLibrary(Provider.java:25)
        at com.kenai.jaffl.Library.loadLibrary(Library.java:76)
        at org.jruby.ext.posix.POSIXFactory$LinuxLibCProvider$SingletonHolder.<clinit>(POSIXFactory.java:108)
        at org.jruby.ext.posix.POSIXFactory$LinuxLibCProvider.getLibC(POSIXFactory.java:112)
        at org.jruby.ext.posix.BaseNativePOSIX.<init>(BaseNativePOSIX.java:30)
        at org.jruby.ext.posix.LinuxPOSIX.<init>(LinuxPOSIX.java:17)
        at org.jruby.ext.posix.POSIXFactory.loadLinuxPOSIX(POSIXFactory.java:70)
        at org.jruby.ext.posix.POSIXFactory.loadPOSIX(POSIXFactory.java:31)
        at org.jruby.ext.posix.LazyPOSIX.loadPOSIX(LazyPOSIX.java:29)
        at org.jruby.ext.posix.LazyPOSIX.posix(LazyPOSIX.java:25)
        at org.jruby.ext.posix.LazyPOSIX.stat(LazyPOSIX.java:235)
        at org.jruby.RubyFileTest.directory_p(RubyFileTest.java:102)
        at org.jruby.RubyFileTest.directory_p(RubyFileTest.java:82)
        at org.jruby.RubyIO.failIfDirectory(RubyIO.java:3384)
        at org.jruby.RubyIO.readStatic(RubyIO.java:3411)
        at org.jruby.RubyIO$s$readStatic.call(RubyIO$s$readStatic.gen:65535)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:312)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:169)
        at ruby.__dash_e__.__file__(-e:1)
        at ruby.__dash_e__.load(-e)
        at org.jruby.Ruby.runScript(Ruby.java:697)
        at org.jruby.Ruby.runScript(Ruby.java:690)
        at org.jruby.Ruby.runNormally(Ruby.java:597)
        at org.jruby.Ruby.runFromMain(Ruby.java:446)
        at org.jruby.Main.doRunFromMain(Main.java:369)
        at org.jruby.Main.internalRun(Main.java:258)
        at org.jruby.Main.run(Main.java:224)
        at org.jruby.Main.run(Main.java:208)
        at org.jruby.Main.main(Main.java:188)
        Caused by: java.lang.UnsatisfiedLinkError: /tmp/jffi3528612306651138541.tmp: /tmp/jffi3528612306651138541.tmp: failed to map segment from shared object: Operation not permitted
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1758)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1654)
        at java.lang.Runtime.load0(Runtime.java:770)
        at java.lang.System.load(System.java:1003)
        at com.kenai.jffi.Init.loadFromJar(Init.java:164)
        at com.kenai.jffi.Init.load(Init.java:78)
        at com.kenai.jffi.Foreign$InstanceHolder.getInstanceHolder(Foreign.java:49)
        at com.kenai.jffi.Foreign$InstanceHolder.<clinit>(Foreign.java:45)
        at com.kenai.jffi.Foreign.getInstance(Foreign.java:95)
        at com.kenai.jffi.Internals.getErrnoSaveFunction(Internals.java:44)
        at com.kenai.jaffl.provider.jffi.StubCompiler.getErrnoSaveFunction(StubCompiler.java:68)
        at com.kenai.jaffl.provider.jffi.StubCompiler.<clinit>(StubCompiler.java:18)
        at com.kenai.jaffl.provider.jffi.AsmLibraryLoader.generateInterfaceImpl(AsmLibraryLoader.java:146)
        ... 31 more
        Type.java:212:in `size': java.lang.ExceptionInInitializerError
        from Provider.java:62:in `size'
        from Constants.java:9:in `<clinit>'
        from Struct.java:1062:in `<init>'
        from HeapStruct.java:43:in `<init>'
        from LinuxHeapFileStat.java:35:in `<init>'
        from LinuxPOSIX.java:26:in `allocateStat'
        from LinuxPOSIX.java:107:in `stat'
        from LazyPOSIX.java:235:in `stat'
        from RubyFileTest.java:102:in `directory_p'
        from RubyFileTest.java:82:in `directory_p'
        from RubyIO.java:3384:in `failIfDirectory'
        from RubyIO.java:3411:in `readStatic'
        from RubyIO$s$readStatic.gen:65535:in `call'
        from CachingCallSite.java:312:in `cacheAndCall'
        from CachingCallSite.java:169:in `call'
        from -e:1:in `__file__'
        from -e:-1:in `load'
        from Ruby.java:697:in `runScript'
        from Ruby.java:690:in `runScript'
        from Ruby.java:597:in `runNormally'
        from Ruby.java:446:in `runFromMain'
        from Main.java:369:in `doRunFromMain'
        from Main.java:258:in `internalRun'
        from Main.java:224:in `run'
        from Main.java:208:in `run'
        from Main.java:188:in `main'
        Caused by:
        Foreign.java:90:in `getForeign': java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: /tmp/jffi3528612306651138541.tmp: /tmp/jffi3528612306651138541.tmp: failed to map segment from shared object: Operation not permitted
        from Foreign.java:95:in `getInstance'
        from Type.java:241:in `<clinit>'
        from Type.java:212:in `size'
        from Provider.java:62:in `size'
        from Constants.java:9:in `<clinit>'
        from Struct.java:1062:in `<init>'
        from HeapStruct.java:43:in `<init>'
        from LinuxHeapFileStat.java:35:in `<init>'
        from LinuxPOSIX.java:26:in `allocateStat'
        from LinuxPOSIX.java:107:in `stat'
        from LazyPOSIX.java:235:in `stat'
        from RubyFileTest.java:102:in `directory_p'
        from RubyFileTest.java:82:in `directory_p'
        from RubyIO.java:3384:in `failIfDirectory'
        from RubyIO.java:3411:in `readStatic'
        from RubyIO$s$readStatic.gen:65535:in `call'
        from CachingCallSite.java:312:in `cacheAndCall'
        from CachingCallSite.java:169:in `call'
        from -e:1:in `__file__'
        from -e:-1:in `load'
        from Ruby.java:697:in `runScript'
        from Ruby.java:690:in `runScript'
        from Ruby.java:597:in `runNormally'
        from Ruby.java:446:in `runFromMain'
        from Main.java:369:in `doRunFromMain'
        from Main.java:258:in `internalRun'
        from Main.java:224:in `run'
        from Main.java:208:in `run'
        from Main.java:188:in `main'
        Caused by:
        ClassLoader.java:-2:in `load': java.lang.UnsatisfiedLinkError: /tmp/jffi3528612306651138541.tmp: /tmp/jffi3528612306651138541.tmp: failed to map segment from shared object: Operation not permitted
        from ClassLoader.java:1758:in `loadLibrary0'
        from ClassLoader.java:1654:in `loadLibrary'
        from Runtime.java:770:in `load0'
        from System.java:1003:in `load'
        from Init.java:164:in `loadFromJar'
        from Init.java:78:in `load'
        from Foreign.java:49:in `getInstanceHolder'
        from Foreign.java:45:in `<clinit>'
        from Foreign.java:95:in `getInstance'
        from Internals.java:44:in `getErrnoSaveFunction'
        from StubCompiler.java:68:in `getErrnoSaveFunction'
        from StubCompiler.java:18:in `<clinit>'
        from AsmLibraryLoader.java:146:in `generateInterfaceImpl'
        from AsmLibraryLoader.java:110:in `loadLibrary'
        from Provider.java:31:in `loadLibrary'
        from Provider.java:25:in `loadLibrary'
        from Library.java:76:in `loadLibrary'
        from POSIXFactory.java:108:in `<clinit>'
        from POSIXFactory.java:112:in `getLibC'
        from BaseNativePOSIX.java:30:in `<init>'
        from LinuxPOSIX.java:17:in `<init>'
        from POSIXFactory.java:70:in `loadLinuxPOSIX'
        from POSIXFactory.java:31:in `loadPOSIX'
        from LazyPOSIX.java:29:in `loadPOSIX'
        from LazyPOSIX.java:25:in `posix'
        from LazyPOSIX.java:235:in `stat'
        from RubyFileTest.java:102:in `directory_p'
        from RubyFileTest.java:82:in `directory_p'
        from RubyIO.java:3384:in `failIfDirectory'
        from RubyIO.java:3411:in `readStatic'
        from RubyIO$s$readStatic.gen:65535:in `call'
        from CachingCallSite.java:312:in `cacheAndCall'
        from CachingCallSite.java:169:in `call'
        from -e:1:in `__file__'
        from -e:-1:in `load'
        from Ruby.java:697:in `runScript'
        from Ruby.java:690:in `runScript'
        from Ruby.java:597:in `runNormally'
        from Ruby.java:446:in `runFromMain'
        from Main.java:369:in `doRunFromMain'
        from Main.java:258:in `internalRun'
        from Main.java:224:in `run'
        from Main.java:208:in `run'
        from Main.java:188:in `main'
        java -jar jruby-complete-1.6.7.jar -e "File.read('nohup.out')"

        Got error:
        {noformat}
        java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: /tmp/jffi3528612306651138541.tmp: /tmp/jffi3528612306651138541.tmp: failed to map segment from shared object: Operation not permitted
        at com.kenai.jffi.Foreign$InValidInstanceHolder.getForeign(Foreign.java:90)
        at com.kenai.jffi.Foreign.getInstance(Foreign.java:95)
        at com.kenai.jffi.Library.openLibrary(Library.java:151)
        at com.kenai.jffi.Library.getCachedInstance(Library.java:125)
        at com.kenai.jaffl.provider.jffi.Library.loadNativeLibraries(Library.java:66)
        at com.kenai.jaffl.provider.jffi.Library.getNativeLibraries(Library.java:56)
        at com.kenai.jaffl.provider.jffi.Library.getSymbolAddress(Library.java:35)
        at com.kenai.jaffl.provider.jffi.Library.findSymbolAddress(Library.java:45)
        at com.kenai.jaffl.provider.jffi.AsmLibraryLoader.generateInterfaceImpl(AsmLibraryLoader.java:188)
        at com.kenai.jaffl.provider.jffi.AsmLibraryLoader.loadLibrary(AsmLibraryLoader.java:110)
        at com.kenai.jaffl.provider.jffi.Provider.loadLibrary(Provider.java:31)
        at com.kenai.jaffl.provider.jffi.Provider.loadLibrary(Provider.java:25)
        at com.kenai.jaffl.Library.loadLibrary(Library.java:76)
        at org.jruby.ext.posix.POSIXFactory$LinuxLibCProvider$SingletonHolder.<clinit>(POSIXFactory.java:108)
        at org.jruby.ext.posix.POSIXFactory$LinuxLibCProvider.getLibC(POSIXFactory.java:112)
        at org.jruby.ext.posix.BaseNativePOSIX.<init>(BaseNativePOSIX.java:30)
        at org.jruby.ext.posix.LinuxPOSIX.<init>(LinuxPOSIX.java:17)
        at org.jruby.ext.posix.POSIXFactory.loadLinuxPOSIX(POSIXFactory.java:70)
        at org.jruby.ext.posix.POSIXFactory.loadPOSIX(POSIXFactory.java:31)
        at org.jruby.ext.posix.LazyPOSIX.loadPOSIX(LazyPOSIX.java:29)
        at org.jruby.ext.posix.LazyPOSIX.posix(LazyPOSIX.java:25)
        at org.jruby.ext.posix.LazyPOSIX.stat(LazyPOSIX.java:235)
        at org.jruby.RubyFileTest.directory_p(RubyFileTest.java:102)
        at org.jruby.RubyFileTest.directory_p(RubyFileTest.java:82)
        at org.jruby.RubyIO.failIfDirectory(RubyIO.java:3384)
        at org.jruby.RubyIO.readStatic(RubyIO.java:3411)
        at org.jruby.RubyIO$s$readStatic.call(RubyIO$s$readStatic.gen:65535)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:312)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:169)
        at ruby.__dash_e__.__file__(-e:1)
        at ruby.__dash_e__.load(-e)
        at org.jruby.Ruby.runScript(Ruby.java:697)
        at org.jruby.Ruby.runScript(Ruby.java:690)
        at org.jruby.Ruby.runNormally(Ruby.java:597)
        at org.jruby.Ruby.runFromMain(Ruby.java:446)
        at org.jruby.Main.doRunFromMain(Main.java:369)
        at org.jruby.Main.internalRun(Main.java:258)
        at org.jruby.Main.run(Main.java:224)
        at org.jruby.Main.run(Main.java:208)
        at org.jruby.Main.main(Main.java:188)
        Caused by: java.lang.UnsatisfiedLinkError: /tmp/jffi3528612306651138541.tmp: /tmp/jffi3528612306651138541.tmp: failed to map segment from shared object: Operation not permitted
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1758)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1654)
        at java.lang.Runtime.load0(Runtime.java:770)
        at java.lang.System.load(System.java:1003)
        at com.kenai.jffi.Init.loadFromJar(Init.java:164)
        at com.kenai.jffi.Init.load(Init.java:78)
        at com.kenai.jffi.Foreign$InstanceHolder.getInstanceHolder(Foreign.java:49)
        at com.kenai.jffi.Foreign$InstanceHolder.<clinit>(Foreign.java:45)
        at com.kenai.jffi.Foreign.getInstance(Foreign.java:95)
        at com.kenai.jffi.Internals.getErrnoSaveFunction(Internals.java:44)
        at com.kenai.jaffl.provider.jffi.StubCompiler.getErrnoSaveFunction(StubCompiler.java:68)
        at com.kenai.jaffl.provider.jffi.StubCompiler.<clinit>(StubCompiler.java:18)
        at com.kenai.jaffl.provider.jffi.AsmLibraryLoader.generateInterfaceImpl(AsmLibraryLoader.java:146)
        ... 31 more
        Type.java:212:in `size': java.lang.ExceptionInInitializerError
        from Provider.java:62:in `size'
        from Constants.java:9:in `<clinit>'
        from Struct.java:1062:in `<init>'
        from HeapStruct.java:43:in `<init>'
        from LinuxHeapFileStat.java:35:in `<init>'
        from LinuxPOSIX.java:26:in `allocateStat'
        from LinuxPOSIX.java:107:in `stat'
        from LazyPOSIX.java:235:in `stat'
        from RubyFileTest.java:102:in `directory_p'
        from RubyFileTest.java:82:in `directory_p'
        from RubyIO.java:3384:in `failIfDirectory'
        from RubyIO.java:3411:in `readStatic'
        from RubyIO$s$readStatic.gen:65535:in `call'
        from CachingCallSite.java:312:in `cacheAndCall'
        from CachingCallSite.java:169:in `call'
        from -e:1:in `__file__'
        from -e:-1:in `load'
        from Ruby.java:697:in `runScript'
        from Ruby.java:690:in `runScript'
        from Ruby.java:597:in `runNormally'
        from Ruby.java:446:in `runFromMain'
        from Main.java:369:in `doRunFromMain'
        from Main.java:258:in `internalRun'
        from Main.java:224:in `run'
        from Main.java:208:in `run'
        from Main.java:188:in `main'
        Caused by:
        Foreign.java:90:in `getForeign': java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: /tmp/jffi3528612306651138541.tmp: /tmp/jffi3528612306651138541.tmp: failed to map segment from shared object: Operation not permitted
        from Foreign.java:95:in `getInstance'
        from Type.java:241:in `<clinit>'
        from Type.java:212:in `size'
        from Provider.java:62:in `size'
        from Constants.java:9:in `<clinit>'
        from Struct.java:1062:in `<init>'
        from HeapStruct.java:43:in `<init>'
        from LinuxHeapFileStat.java:35:in `<init>'
        from LinuxPOSIX.java:26:in `allocateStat'
        from LinuxPOSIX.java:107:in `stat'
        from LazyPOSIX.java:235:in `stat'
        from RubyFileTest.java:102:in `directory_p'
        from RubyFileTest.java:82:in `directory_p'
        from RubyIO.java:3384:in `failIfDirectory'
        from RubyIO.java:3411:in `readStatic'
        from RubyIO$s$readStatic.gen:65535:in `call'
        from CachingCallSite.java:312:in `cacheAndCall'
        from CachingCallSite.java:169:in `call'
        from -e:1:in `__file__'
        from -e:-1:in `load'
        from Ruby.java:697:in `runScript'
        from Ruby.java:690:in `runScript'
        from Ruby.java:597:in `runNormally'
        from Ruby.java:446:in `runFromMain'
        from Main.java:369:in `doRunFromMain'
        from Main.java:258:in `internalRun'
        from Main.java:224:in `run'
        from Main.java:208:in `run'
        from Main.java:188:in `main'
        Caused by:
        ClassLoader.java:-2:in `load': java.lang.UnsatisfiedLinkError: /tmp/jffi3528612306651138541.tmp: /tmp/jffi3528612306651138541.tmp: failed to map segment from shared object: Operation not permitted
        from ClassLoader.java:1758:in `loadLibrary0'
        from ClassLoader.java:1654:in `loadLibrary'
        from Runtime.java:770:in `load0'
        from System.java:1003:in `load'
        from Init.java:164:in `loadFromJar'
        from Init.java:78:in `load'
        from Foreign.java:49:in `getInstanceHolder'
        from Foreign.java:45:in `<clinit>'
        from Foreign.java:95:in `getInstance'
        from Internals.java:44:in `getErrnoSaveFunction'
        from StubCompiler.java:68:in `getErrnoSaveFunction'
        from StubCompiler.java:18:in `<clinit>'
        from AsmLibraryLoader.java:146:in `generateInterfaceImpl'
        from AsmLibraryLoader.java:110:in `loadLibrary'
        from Provider.java:31:in `loadLibrary'
        from Provider.java:25:in `loadLibrary'
        from Library.java:76:in `loadLibrary'
        from POSIXFactory.java:108:in `<clinit>'
        from POSIXFactory.java:112:in `getLibC'
        from BaseNativePOSIX.java:30:in `<init>'
        from LinuxPOSIX.java:17:in `<init>'
        from POSIXFactory.java:70:in `loadLinuxPOSIX'
        from POSIXFactory.java:31:in `loadPOSIX'
        from LazyPOSIX.java:29:in `loadPOSIX'
        from LazyPOSIX.java:25:in `posix'
        from LazyPOSIX.java:235:in `stat'
        from RubyFileTest.java:102:in `directory_p'
        from RubyFileTest.java:82:in `directory_p'
        from RubyIO.java:3384:in `failIfDirectory'
        from RubyIO.java:3411:in `readStatic'
        from RubyIO$s$readStatic.gen:65535:in `call'
        from CachingCallSite.java:312:in `cacheAndCall'
        from CachingCallSite.java:169:in `call'
        from -e:1:in `__file__'
        from -e:-1:in `load'
        from Ruby.java:697:in `runScript'
        from Ruby.java:690:in `runScript'
        from Ruby.java:597:in `runNormally'
        from Ruby.java:446:in `runFromMain'
        from Main.java:369:in `doRunFromMain'
        from Main.java:258:in `internalRun'
        from Main.java:224:in `run'
        from Main.java:208:in `run'
        from Main.java:188:in `main'
        {noformat}
        Hiro Asari made changes -
        Priority Blocker [ 1 ] Major [ 3 ]
        Hide
        Charles Oliver Nutter added a comment -

        This may be a security problem. Some distributions of Linux, notably SELinux, prevent executable code (including libraries) from loading from the system tmp dir. You can fix it by redirecting tmp to one of your own dirs.

        RHEL may be the same?

        Show
        Charles Oliver Nutter added a comment - This may be a security problem. Some distributions of Linux, notably SELinux, prevent executable code (including libraries) from loading from the system tmp dir. You can fix it by redirecting tmp to one of your own dirs. RHEL may be the same?
        Hide
        Charles Oliver Nutter added a comment -

        Marking as Not a Bug. jffi needs to be able to unpack its native binary to an executable location on disk. We use /tmp for simplicity, but many secure Linux environments do not allow executing code from /tmp. The workaround is to specify a different temp location, as described in comments.

        Show
        Charles Oliver Nutter added a comment - Marking as Not a Bug. jffi needs to be able to unpack its native binary to an executable location on disk. We use /tmp for simplicity, but many secure Linux environments do not allow executing code from /tmp. The workaround is to specify a different temp location, as described in comments.
        Charles Oliver Nutter made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Charles Oliver Nutter [ headius ]
        Resolution Not A Bug [ 6 ]
        Charles Oliver Nutter made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Li Xiao
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: