oracle / fastr

A high-performance implementation of the R programming language, built on GraalVM.
Other
624 stars 64 forks source link

OS X 10.15 (Catalina) security issues - bin/R and library(ggplot2) #170

Closed mik3hall closed 3 years ago

mik3hall commented 3 years ago

Thank you for reporting a bug in FastR. We will do our best to eventually address all open issues, however, you can also help us and increase the chances of your issue being fixed sooner by following these guidelines:

Can you reproduce with the latest development build?

Haven't tried but reasonably current

Include the following info

openjdk version "11.0.6" 2020-01-14 OpenJDK Runtime Environment GraalVM CE 20.1.0-dev (build 11.0.6+9-jvmci-20.1-b01) OpenJDK 64-Bit Server VM GraalVM CE 20.1.0-dev (build 11.0.6+9-jvmci-20.1-b01, mixed mode, sharing)

sessionInfo() FastR version 3.6.1 (2019-07-05) Platform: x86_64-apple-darwin19.6.0 (64-bit) Running under: macOS Catalina 10.15.7

Matrix products: default BLAS: /Users/mjh/HalfPipe/HalfPipe_jpkg/outFastR/FastRGraalHPS.app/Contents/runtime/Contents/Home/languages/R/lib/libRblas.dylib LAPACK: /Users/mjh/HalfPipe/HalfPipe_jpkg/outFastR/FastRGraalHPS.app/Contents/runtime/Contents/Home/languages/R/lib/libRlapack.dylib

locale: [1] UTF-8/UTF-8/UTF-8/C/UTF-8/UTF-8

attached base packages: [1] stats graphics grDevices utils datasets methods base

To run FastR command line bin/R I had to... sudo xattr -r -d com.apple.quarantine /Library/Java/JavaVirtualMachines/graalvm-ce-java... I believe I saw that documentation is being worked on to indicate that this is needed.

Then I successfully get...

library(ggplot2) Registered S3 methods overwritten by 'ggplot2': method from [.quosures rlang c.quosures rlang print.quosures rlang

If I try this on Catalina with my own application I get...

library(ggplot2) Error in gzfile(file, "rb") : cannot open the connection In addition: Warning message: In gzfile(file, "rb") : cannot open file '/Users/mjh/Documents/R/fastr/ggplot2/Meta/package.rds': /Users/mjh/Documents/R/fastr/ggplot2/Meta/package.rds: Operation not permitted at gzfile(internal:1:0) at readRDS(unknown.r:1:0-17) at (unknown.r:1:0-13) at lapply(:1:0-15) at find.package(unknown.r:1-11:0-447) at library(unknown.r:1:0-62) at (:1:0-15) at null(:1:0-15) at org.graalvm.sdk/org.graalvm.polyglot.Context.eval(Context.java:345) at us.hall.fastr.SimpleTest.main(SimpleTest.java:48)

As shown packages are installed to my user Documents directory. The application doing gzfile from doesn't appear to have access rights. Giving the application "Full Disk Access" didn't correct this. I couldn't figure out how to specifically give it the Documents directory. At some point when I went into System Preferences "Security & Privacy" it was showing the application had an error where the application was shown as /Library/Java/JavaVirtualMachines/graalvm-ce-java11-20.1.0-dev. It gave me an option to open that from the preference panel but this of course only opened the jdk directory. I am unable to recreate that at the moment. This might be why giving my own application "Full Disk Access" doesn't work? But there appear to be some application use of FastR at the OS X Catalina version security problems.

steve-s commented 3 years ago

Hello mik3hall,

thank you for the report. So it seems that the installation of ggplot2 is creating the file(s) with wrong permissions? I.e., the file /Users/mjh/Documents/R/fastr/ggplot2/Meta/package.rds does not have the read bit set if you check ls -l /Users/mjh/Documents/R/fastr/ggplot2/Meta/package.rds? The installation process maybe gets this wrong for some reason. Does adding the permission via chmod +r /Users/mjh/Documents/R/fastr/ggplot2/Meta/package.rds fix this?

mik3hall commented 3 years ago

Hello, I'm not quite sure what this was about. I can't recreate now. You should be able to close this.

I re-installed ggplot2 and it didn't go entirely smoothly but did work... R> library(ggplot2) Error in get(paste0(generic, ".", class), envir = parent.frame()) : object 'vec_ptype2.glue.glue' not found R> library(glue) R> library(ggplot2) R> glue was one of the dependencies I had to reinstall due to errors like... Error: package ‘glue’ was installed before R 4.0.0: please re-install it

steve-s commented 3 years ago

Thanks for reporting back!