deathbeam / yae

Windows/Linux/Mac/Android/iOS/Ouya game engine for MoonScript, in MoonScript.
https://yae.io
MIT License
96 stars 5 forks source link

Standard noexec attribute on "/tmp" mount gives "UnsatisfiedLinkError: failed to map segment" on start. It still starts. #20

Closed PaulKlumpp closed 9 years ago

PaulKlumpp commented 9 years ago

Hi, I don't know if it is a real issue. The following shows the output at my systems. NÖN still starts the splash screen and the project is running fine.

paul@babidi ~/dev/lala $ non start desktop
Starting your application
:updateAssets UP-TO-DATE
:update UP-TO-DATE
:updateDesktop
:core:compileJava UP-TO-DATE
:core:processResources UP-TO-DATE
:core:classes UP-TO-DATE
:core:jar UP-TO-DATE
:desktop:compileJava UP-TO-DATE
:desktop:processResources UP-TO-DATE
:desktop:classes UP-TO-DATE
:desktop:runjava.lang.UnsatisfiedLinkError: /tmp/libgdxklumpp/21af1f22/libgdx64.so: /tmp/libgdxklumpp/21af1f22/libgdx64.so: failed to map segment from shared object: Operation not permitted
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1890)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1851)
at java.lang.Runtime.load0(Runtime.java:795)
at java.lang.System.load(System.java:1062)
at com.badlogic.gdx.utils.SharedLibraryLoader.loadFile(SharedLibraryLoader.java:299)
at com.badlogic.gdx.utils.SharedLibraryLoader.loadFile(SharedLibraryLoader.java:268)
at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:115)
at com.badlogic.gdx.utils.GdxNativesLoader.load(GdxNativesLoader.java:34)
at com.badlogic.gdx.backends.lwjgl.LwjglNativesLoader.load(LwjglNativesLoader.java:47)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.<init>(LwjglApplication.java:76)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.<init>(LwjglApplication.java:64)
at non.hello.desktop.DesktopLauncher.main(DesktopLauncher.java:41)
java.lang.UnsatisfiedLinkError: /tmp/21af1f22569454732848639951.tmp: /tmp/21af1f22569454732848639951.tmp: failed to map segment from shared object: Operation not permitted
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1890)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1851)
at java.lang.Runtime.load0(Runtime.java:795)
at java.lang.System.load(System.java:1062)
at com.badlogic.gdx.utils.SharedLibraryLoader.loadFile(SharedLibraryLoader.java:299)
at com.badlogic.gdx.utils.SharedLibraryLoader.loadFile(SharedLibraryLoader.java:274)
at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:115)
at com.badlogic.gdx.utils.GdxNativesLoader.load(GdxNativesLoader.java:34)
at com.badlogic.gdx.backends.lwjgl.LwjglNativesLoader.load(LwjglNativesLoader.java:47)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.<init>(LwjglApplication.java:76)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.<init>(LwjglApplication.java:64)
at non.hello.desktop.DesktopLauncher.main(DesktopLauncher.java:41)

BUILD SUCCESFULL
Total time: 33 seconds

As far as I know, this comes from the standard noexec attribute of modern Linux systems. "noexec" on /tmp mount is normal for security reasons. You can't rely on tmp being "exec".

What java projects usually do to counter this problem is using the property "java.io.tmpdir":

Examples: Using shared memory device, if available for the user:

java -jar blahblah.jar -Djava.io.tmpdir=/dev/shm   

or, using the actual program location for a tmp sub-directory:

java -jar blahblah.jar -Djava.io.tmpdir=${CWD}/tmp

More informational resources:

deathbeam commented 9 years ago

Hmm interesting. If it is working anyways, it should not be a problem. I have tested NÖN with Travis CI (which is running on Ubuntu) and on my home PC with Windows 8 and I am not having any of issues you have. That is really weird.

PaulKlumpp commented 9 years ago

Try to see if your /tmp is mounted with the "noexec" option.

paul@dabura $ mount
...lots of other mounts were here...
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noexec,relatime,size=8388608k)
...lots of other mounts were here...

It's normal and okay to mount /tmp with "noexec". My /tmp is with "noexec", that's why this error appears. Yes, it still runs fine so far, but who knows what might happen sometime later?

I think, you may close this issue. My guess is: At some point in the future, this issue will be re-opened.

deathbeam commented 9 years ago

Okay then, if it will cause any serious problems, I will reopen it. Closing for now.