Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FastR assumes its installation directory is writable #14

Closed
lucaswerkmeister opened this issue Apr 28, 2018 · 3 comments
Closed

FastR assumes its installation directory is writable #14

lucaswerkmeister opened this issue Apr 28, 2018 · 3 comments

Comments

@lucaswerkmeister
Copy link

I published an Arch User Repository package for FastR, which installs it into /usr/lib/jvm/java-8-graal/. Apparently, FastR assumes that its installation directory is writable for logging certain errors:

$ Rscript --polyglot -e "eval.polyglot('python', 'no_such_value')"
java.nio.file.AccessDeniedException: /usr/lib/jvm/java-8-graal/jre/languages/R/fastr_errors.log
        at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
        at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
        at java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:434)
        at java.nio.file.Files.newOutputStream(Files.java:216)
        at java.nio.file.Files.newBufferedWriter(Files.java:2860)
        at com.oracle.truffle.r.runtime.RInternalError.reportError(RInternalError.java:191)
        at com.oracle.truffle.r.runtime.RInternalError.reportError(RInternalError.java:162)
        at com.oracle.truffle.r.engine.EngineRootNode.execute(EngineRootNode.java:97)
        at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:260)
        at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:249)
        at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:239)
        at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:224)
        at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.call(OptimizedCallTarget.java:200)
        at com.oracle.truffle.api.vm.PolyglotContextImpl.eval(PolyglotContextImpl.java:722)
        at org.graalvm.polyglot.Context.eval(Context.java:311)
        at com.oracle.truffle.r.launcher.RCommand.readEvalPrint(RCommand.java:256)
        at com.oracle.truffle.r.launcher.RscriptCommand.execute(RscriptCommand.java:76)
        at com.oracle.truffle.r.launcher.RscriptCommand.doMain(RscriptCommand.java:164)
        at com.oracle.truffle.r.launcher.RscriptCommand.main(RscriptCommand.java:158)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.oracle.truffle.r.legacylauncher.LegacyLauncher.main(LegacyLauncher.java:38)
internal error: PException (see fastr_errors.log)

I think fastr_errors.log needs to go somewhere else… the current working directory, perhaps? (Not that that’s always writable, so an error to write the file should still be handled better, I guess…)

Note that this is not a completely fatal error: an interactive R shell returns to the prompt, and Rscript with multiple -e options will process the other expressions without error after the first one fails like this.

@steve-s
Copy link
Member

steve-s commented Apr 29, 2018

Hi Lucas,

thank you for reporting this and for creating the FastR package. We'll get it fixed. The plan so far is to try current directory, user directory and then eventually FastR installation directory, plus we'll probably append PID to the file name.

@steve-s
Copy link
Member

steve-s commented May 30, 2018

Fixed. The error file name is fastr_errors_pidXYZ.log and is saved to current working directory at the app startup, the user home directory, tmp directory, or FastR home directory whichever is writeable (in that order).

@steve-s steve-s closed this as completed May 30, 2018
@lucaswerkmeister
Copy link
Author

lucaswerkmeister commented May 30, 2018

Great, thank you! (For the record, AFAICT the fix commit is bd11c78.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants