Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Improve error handling re: FFI loading when system temp dir is mounted 'noexec' #2186
When trying to load the FFI subsystem (via .so files embedded in jar), it appears that JRuby copies the .so files out of the jar into a temp dir and then loads them from there.
We had a user who was getting a cryptic error message today:
After some sleuthing we determined that the user's
Our user was able to use -Djava.io.tmpdir.
This has come up for us a few more times since I opened it. We're currently giving users info about the -Djava.io.tmpdir workaround, but that makes me a little leery because I believe it means that any other temp files that the process writes during its lifetime will also be written to that directory, which is bad.
I think it might be worth adding a jruby-ffi-specific config setting that could be used to define the temp location that would be used only for these files that need to be executable, and that way we wouldn't have to override the global temp dir.
This is probably a requirement of Java. That error message us related to the POSIX features which use a Java based FFI package (related to JRubys) not the ruby FFI package. it would appear you have to turn off the native features or provide Java with a place to put temporary files.