Giter Site home page Giter Site logo

oracle / fastr Goto Github PK

View Code? Open in Web Editor NEW
611.0 63.0 63.0 573.05 MB

A high-performance implementation of the R programming language, built on GraalVM.

License: Other

Java 65.88% Makefile 0.45% C 17.88% R 10.98% Shell 0.17% Python 0.84% Fortran 2.55% C++ 0.52% Ruby 0.01% JavaScript 0.02% M4 0.37% Objective-C 0.01% Jsonnet 0.07% ANTLR 0.17% Starlark 0.08%
graalvm r r-language

fastr's People

Contributors

akirathan avatar ansalond avatar boris-spas avatar chumer avatar dougxc avatar entlicher avatar eregon avatar fangerer avatar fniephaus avatar gilles-duboscq avatar joshi-prahlad avatar lesiachaban avatar lukasstadler avatar mardukbp avatar martinbalin avatar msimacek avatar olyagpl avatar oraclelabsautomation avatar palez avatar patrick96 avatar petermz avatar rschatz avatar smithsps avatar steve-s avatar teshull avatar tstupka avatar tzezula avatar vjovanov avatar zapster avatar zslajchrt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fastr's Issues

Wrong result when working with integer number (RC11)

The following code does not work properly:

library('dplyr')
library('nycflights13')

fl = flights %>%
      transmute(dep_time,
                hour = dep_time %/% 100L,
                minute = dep_time %% 100L)

print(fl)

It returns

A tibble: 336,776 x 3

dep_time hour minute

1 5 5 5
2 5 5 5
3 5 5 5
4 5 5 5
5 5 5 5
6 5 5 5
7 5 5 5
8 5 5 5
9 5 5 5
10 5 5 5

'dep_time' was changed even though there is no command to change it.

If this code is executed the first time in the R session without the 'L', then we get:

A tibble: 336,776 x 3

dep_time hour minute

1 517 5 17
2 533 5 33
3 542 5 42
4 544 5 44
5 554 5 54
6 554 5 54
7 555 5 55
8 557 5 57
9 557 5 57
10 558 5 58

Which is the expected result.

Now, if running the code again with the 'L', after having executed it without the 'L', it works fine.

However, if we first execute the code with the 'L', then execute again without the 'L' both come out wrong.

Building GraalVM suite with fastr fails due to failing test

In the process of building building GraalVM suite inside a docker environment (Linux), I get the below:

Compiling com.oracle.svm.core with javac-daemon(JDK 1.8)... [/home/graal/graal/substratevm/mxbuild/src/com.oracle.svm.core/bin/com/oracle/svm/core/UnsafeAccess.class does not exist]
Compiling com.oracle.truffle.r.parser with javac-daemon(JDK 1.8)... [dependency TRUFFLE_R_PARSER_PROCESSOR updated]
Compiling com.oracle.graal.pointsto with javac-daemon(JDK 1.8)... [/home/graal/graal/substratevm/mxbuild/src/com.oracle.graal.pointsto/bin/com/oracle/graal/pointsto/AnalysisObjectScanner.class does not exist]
/home/graal/fastr/com.oracle.truffle.r.parser/src/com/oracle/truffle/r/parser/ParserGeneration.java:37: error: Parser failed to execute command [/home/graal/graal-jvmci-8/openjdk1.8.0-internal/linux-amd64/product/bin/java, -jar, /home/graal/fastr/libdownloads/antlr-complete-3.5.1.jar, -o, /tmp/antlr2606573355340595633.tmp, R.g]. Return code 1.
public class ParserGeneration {
       ^
  Output:error(170): R.g:808:43: the .. range operator isn't allowed in parser rules
  error(170): R.g:808:54: the .. range operator isn't allowed in parser rules
  error(170): R.g:808:98: the .. range operator isn't allowed in parser rules
  error(170): R.g:808:109: the .. range operator isn't allowed in parser rules
  error(170): R__.g:808:43: the .. range operator isn't allowed in parser rules
                                                                                                                                           
 error(170): R__.g:808:54: the .. range operator isn't allowed in parser rules
  error(170): R__.g:808:98: the .. range operator isn't allowed in parser rules
  error(170): R__.g:808:109: the .. range operator isn't allowed in parser rules
  warning(200): R.g:710:12:
  Decision can match input such as "{'0'..'9', 'A'..'F', 'a'..'f'}" using multiple alternatives: 1, 2

  As a result, alternative(s) 2 were disabled for that input
  warning(200): R.g:716:12:
  Decision can match input such as "{'0'..'9', 'A'..'F', 'a'..'f'}" using multiple alternatives: 1, 2

  As a result, alternative(s) 2 were disabled for that input
  warning(200): R.g:716:12:
  Decision can match input such as "{'0'..'9', 'A'..'F', 'a'..'f'}" using multiple alternatives: 1, 2

  As a result, alternative(s) 2 were disabled for that input
  warning(200): R.g:722:5:
  Decision can match input such as "'.''.''.''.''.''A'..'Z'" using multiple alternatives: 1, 2

  As a result, alternative(s) 2 were disabled for that input
  warning(200): R.g:722:5:
  Decision can match input such as "'.''.''.''.''.''_'" using multiple alternatives: 1, 2

  As a result, alternative(s) 2 were disabled for that input
  warning(200): R.g:722:5:
  Decision can match input such as "'.''.''.''.''.''\uFFFD''\uFFFD'" using multiple alternatives: 1, 2

  As a result, alternative(s) 2 were disabled for that input
  warning(200): R.g:722:5:
  Decision can match input such as "'.''.''.''.''.''a'..'z'" using multiple alternatives: 1, 2

  As a result, alternative(s) 2 were disabled for that input
  warning(200): R.g:790:29:
  Decision can match input such as "{'0'..'9', 'A'..'F', 'a'..'f'}" using multiple alternatives: 1, 2

  As a result, alternative(s) 2 were disabled for that input
  warning(200): R.g:790:44:
  Decision can match input such as "{'0'..'9', 'A'..'F', 'a'..'f'}" using multiple alternatives: 1, 2

[ ...snipped... ]

  As a result, alternative(s) 4 were disabled for that input
  error(201): R.g:808:20: The following alternatives can never be matched: 4

  warning(200): R.g:808:123:
  Decision can match input such as "'\uFFFD''\uFFFD'" using multiple alternatives: 4, 5

  As a result, alternative(s) 5 were disabled for that input
  error(201): R.g:808:123: The following alternatives can never be matched: 5

1 error

ICU4J dependency found in /home/graal/.mx/cache/ICU4J_6f06e820cf4c8968bbbaae66ae0b33f6a256b57f.jar
3282 files extracted to /home/graal/graaljs/graal-js/lib/icu4j
Use the following parameters when invoking svm version of js to make ICU4J localization data available for the runtime:
-Dpolyglot.js.intl-402=true -Dcom.ibm.icu.impl.ICUBinary.dataPath=/home/graal/graaljs/graal-js/lib/icu4j/icudt
Compiling com.oracle.truffle.r.parser with javac-daemon(JDK 1.8) failed
1 build tasks failed

One of the R tests are failing, does this test pass usually?

Language ID inconsistent?

To my knowledge, fastr is the only Truffle language that uses a capital letter as language ID. Example:

$ gu available
Downloading: Component catalog
ComponentId              Version             Component name
----------------------------------------------------------------
python                   1.0.0-rc10          Graal.Python
R                        1.0.0-rc10          FastR
ruby                     1.0.0-rc10          TruffleRuby

This inconsistency is especially noticeable when using the polyglot API.

I would suggest to use a lowercase r for consistency reasons instead. At the same time, I think it would be reasonable to make language IDs case-insensitive in Truffle, which would solve the backward compatibility issue and increases usability in general.

charIndex out of range when parsing an incomplete source

Parsing a$ causes the following exception:

Caused by: java.lang.IllegalArgumentException: charIndex out of range
	at com.oracle.truffle.api.source.Source.createSection(Source.java:606)
	at com.oracle.truffle.r.engine.REngine.createRScriptRoot(REngine.java:385)
	at com.oracle.truffle.r.engine.REngine.parseToCallTarget(REngine.java:303)
	at com.oracle.truffle.r.engine.TruffleRLanguageImpl.parse(TruffleRLanguageImpl.java:195)
	at com.oracle.truffle.api.TruffleLanguage$ParsingRequest.parse(TruffleLanguage.java:799)
	at com.oracle.truffle.api.TruffleLanguage.parse(TruffleLanguage.java:1246)
	at com.oracle.truffle.api.TruffleLanguage$LanguageImpl.parse(TruffleLanguage.java:2449)
	at com.oracle.truffle.api.instrumentation.TruffleInstrument$Env.parse(TruffleInstrument.java:409)

This is because a new-line character is appended in REngine.createRScriptRoot if a IncompleteSourceException occurs so that the StringBuilder contains more characters than the source.

FastR assumes its installation directory is writable

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.

Raw Vector is turned into `RDoubleVector` where an instance of RIntVector is expected using `pdftools` pdf_render_page

Hello again!

This issue closely resembles issue #46, but this time on graalVM & FastR rc11.

I am still trying to render a page from a pdf with R using pdf_tools and again the FastR code has turned my RAW vector into an RDoubleVector which cannot be cast to RIntVector (see stacktrace at the bottom), eventhough it only contains Integers. (The Array on the Scala side is of type Int.)

Edit:
The installed FastR:

ComponentId              Version             Component name
----------------------------------------------------------------
R                        1.0.0-rc11          FastR

R version when running the R command from the graalvm /bin:
R version 3.4.3

Stacktrace:

	at com.oracle.truffle.r.nodes.function.FunctionDefinitionNode.execute(FunctionDefinitionNode.java:325)
	at <R>.pdf_render_page(Unknown)
	at <R>.<language>727354707(myRFile.R:linenumber)
	at <R>.eval(Unknown)
	at <R>.<no source>(unknown.r:1)
	at <R>.myRFile

Problems with Fortran libraries

For various R packages that I try to install, I'm getting errors when it tries to load Fortran libraries:

> install.packages('mgcv')
...
** byte-compile and prepare package for lazy loading
com.oracle.truffle.r.runtime.ffi.DLL$DLLException: unable to load shared object '/Users/kwilliams/Downloads/graalvm-ce-1.0.0-rc8/Contents/Home/jre/languages/R/library/nlme/libs/nlme.so'
  dlopen(/Users/kwilliams/Downloads/graalvm-ce-1.0.0-rc8/Contents/Home/jre/languages/R/library/nlme/libs/nlme.so, 6): Library not loaded: @rpath/libgfortran.3.dylib
  Referenced from: /Users/kwilliams/Downloads/graalvm-ce-1.0.0-rc8/Contents/Home/jre/languages/R/library/nlme/libs/nlme.so
  Reason: image not found

I wondered whether I could solve it by re-installing nlme, but that hits a different Fortran error:

> install.packages('nlme')
...
* installing *source* package ‘nlme’ ...
** package ‘nlme’ successfully unpacked and MD5 sums checked
** libs
/usr/local/bin/gfortran-4.9   -fPIC  -O2  -c chol.f -o chol.o
make: /usr/local/bin/gfortran-4.9: No such file or directory
make: *** [chol.o] Error 1
ERROR: compilation failed for package ‘nlme’

Is this an expected problem, or is there something wrong with my setup? I'm using:

% ./bin/gu info R
Downloading: Component catalog
Filename: https://github.com/oracle/fastr/releases/download/vm-1.0.0-rc8/r-installable-ce-1.0.0-rc8-macos-amd64.jar
Name    : FastR
ID      : R
Version : 1.0.0-rc8
GraalVM : 1.0.0-rc8
Component bundle R cannot be installed
	- The same component FastR (R) is already installed in version 1.0.0-rc8


> R.version
               _                               
platform       x86_64-apple-darwin17.7.0       
arch           x86_64                          
os             darwin17.7.0                    
system         x86_64, darwin17.7.0            
major          3                               
minor          4.0                             
year           2017                            
month          04                              
day            21                              
svn rev                                        
language       R                               
engine         FastR                           
version.string FastR version 3.4.0 (2017-04-21)

(That seems like kind of an old year/month combination, but that's what I got with bin/gu install R.)

Wrong error message

The following code has a bug... in 'mutate', 'gain_per_hour' uses 'hour' in the formula instead of 'hours'. Using 'hours' gives the right result.

library('dplyr')
library('nycflights13')

flights_sml =
  flights %>%
    select(year: day,
           ends_with("delay"),
           distance,
           air_time)

print(flights_sml)

mu = flights_sml %>%
  mutate(gain = arr_delay - dep_delay,
              hours = air_time / 60,
              gain_per_hour = gain / hour)

print(mu)

and this is the stack trance:

RuntimeError:
java.lang.ArrayIndexOutOfBoundsException: -1 (RInternalError)
from com.oracle.truffle.r.nodes.function.FunctionDefinitionNode.execute(FunctionDefinitionNode.java:325)
from org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:275)
from org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:264)
from org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:251)
from org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:233)
from org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:216)
from org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.callProxy(OptimizedDirectCallNode.java:84)
from org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:68)
from com.oracle.truffle.r.nodes.function.call.CallRFunctionNode.execute(CallRFunctionNode.java:59)
from com.oracle.truffle.r.nodes.function.RCallNode$DispatchedCallNode.execute(RCallNode.java:1169)
Caused by:
-1 (ArrayIndexOutOfBoundsException)
from java.util.ArrayList.elementData(ArrayList.java:422)
from java.util.ArrayList.remove(ArrayList.java:499)
from com.oracle.truffle.r.ffi.impl.common.JavaUpCallsRFFIImpl.Rf_unprotect(JavaUpCallsRFFIImpl.java:1572)
from com.oracle.truffle.r.ffi.impl.upcalls.Rf_unprotectCall$Rf_unprotectCallFactory$1.execute(Rf_unprotectCall.java:54)
from org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:275)
from org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:264)
from org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:251)
from org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:233)
from org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:216)
from org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.callProxy(OptimizedDirectCallNode.java:84)

optim error

Hello...

I'm trying a code with function optim from the R documentation and I'm getting an error:

fr <- function(x) { ## Rosenbrock Banana function
x1 <- x[1]
x2 <- x[2]
100 * (x2 - x1 * x1)^2 + (1 - x1)^2
}
grr <- function(x) { ## Gradient of 'fr'
x1 <- x[1]
x2 <- x[2]
c(-400 * x1 * (x2 - x1 * x1) - 2 * (1 - x1),
200 * (x2 - x1 * x1))
}
optim(c(-1.2,1), fr)

Error in optim(c(-1.2, 1), fr) :
unimplemented function at src/statsR_dummy.c:159

Thanks

throws 'invalid or unimplemented arguments' when argument name is special

running following code leads fastR throw

Error in forceAndCall(1, FUN, newX[, i], ...) :
invalid or unimplemented arguments

func <- function(x, n) {
    return (x)
}
ary <- array(1,dim=c(2,3))
apply(ary, c(2), func, n = 1)

but if change second argument name of func from 'n' to 'n1', 'n2', 'nq' or something else, fastR gives correct result
for example:

func <- function(x, nq) {
    return (x)
}
ary <- array(1,dim=c(2,3))
apply(ary, c(2), func, nq = 3)

(I'm on fastR ee11fce )

Run `dplyr` package examples

Make sure FastR can install dplyr and run dplyr examples.

Some issues: dplyr uses Rcpp, which under some circumstances (e.g. in function duplicated) invokes DATAPTR macro on character vector, which is not supported by FastR at the moment.

RcppBDT build but not loadable

install.packages('RcppBDT') can successfully build RcppBDT, but failed during test package loadable, with following error:

** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error: package or namespace load failed for ‘RcppBDT’ in .doLoadActions(where, attach):
error in load action .A.1 for package RcppBDT: loadModule(module = "bdtDdMod", what = TRUE, env = ns, loadNow = TRUE): Unable to loa
d module "bdtDdMod": shared object 'Rcpp_module_bdtDdMod' was not loaded
Error: loading failed

  • DONE (RcppBDT)

RcppBDT seems built into

/usr/lib/jvm/java-8-graal/jre/languages/R/library/RcppBDT/libs/RcppBDT.so

try to load RcppBDT shows similar error:

library(RcppBDT)
Error: package or namespace load failed for ‘RcppBDT’ in .doLoadActions(where, attach):
error in load action .A.1 for package RcppBDT: loadModule(module = "bdtDdMod", what = TRUE, env = ns, loadNow = TRUE): Unable to loa
d module "bdtDdMod": shared object 'Rcpp_module_bdtDdMod' was not loaded

graalvm versions:

GraalVM Polyglot Engine Version 1.0.0-rc9
Installed Languages:
R version 3.4.0
JavaScript version 1.0
llvm version 6.0.0
Installed Tools:
LLVMTracerInstrument version 1.0.0-rc9
CPU Sampler version 0.4.0
CPU Tracer version 0.3.0
Heap Allocation Monitor version 0.1.0
Chrome Inspector version 0.1
Memory Tracer version 0.2

I'm running archlinux 64 with system boost version 1.68.0-2

Pointer error when running `devtools::test()`

I have a company-internal package called AMGUtils that I wanted to test under FastR. Here's what happens:

> devtools::test()
Loading AMGUtils
Error in match(x, table, nomatch = 0L) :
  cannot coerce type 'externalptr' to vector of type 'character'

> traceback()
6: match(x, table, nomatch = 0L)
5: libs %in% pkglibs
4: .dynLibs(libs[!(libs %in% pkglibs)]) at unload.r#119
3: unload_dll(pkg) at load.r#135
2: load_all(pkg, quiet = TRUE)
1: devtools::test()

different dimnames drop behavior when using as.logical in compare expression

following code result an variable with different dimnames between fastR and GNU-R

 lhs <- array(TRUE,dim=c(2,3))
 rhs <- array(FALSE,dim=c(2,3),dimnames=list(c('y1','y2'),c('x1','x2','x3')))
dimnames(as.logical(lhs) == rhs)

fastR:

NULL

GNUR:

[[1]]
[1] "y1" "y2"

[[2]]
[1] "x1" "x2" "x3"

but if change code a little like this

temp <- as.logical(lhs)
dimnames (temp == rhs)

fastR preserve rhs dimnames as GNU-R

Building problem in Ubuntu 16.04

Hi everyone, I am struggling a bit trying to understand what I am doing wrong, following the building instructions on the main page.
I have all necessary packages and the JAVA_HOME pointing out to jvmci folder. Here are my results:

rm -rf R-3.3.2
rm -f Makeconf.done
make[3]: Leaving directory '/home/user/fastR/fastr/com.oracle.truffle.r.native/gnur'
make -f Makefile.libs clean
make[3]: Entering directory '/home/user/fastR/fastr/com.oracle.truffle.r.native/gnur'
rm -f /home/user/fastR/fastr/lib/libRblas /home/user/fastR/fastr/lib/libRlapack
rm -f
rm -f rcopylib.done
make[3]: Leaving directory '/home/user/fastR/fastr/com.oracle.truffle.r.native/gnur'
make -f Makefile.platform clean
make[3]: Entering directory '/home/user/fastR/fastr/com.oracle.truffle.r.native/gnur'
rm -f /home/user/fastR/fastr/com.oracle.truffle.r.native/platform.mk
make[3]: Leaving directory '/home/user/fastR/fastr/com.oracle.truffle.r.native/gnur'
make[2]: Leaving directory '/home/user/fastR/fastr/com.oracle.truffle.r.native/gnur'
make[1]: Leaving directory '/home/user/fastR/fastr/com.oracle.truffle.r.native'
make -C gnur
make[1]: Entering directory '/home/user/fastR/fastr/com.oracle.truffle.r.native/gnur'
make -f Makefile.gnur
make[2]: Entering directory '/home/user/fastR/fastr/com.oracle.truffle.r.native/gnur'
tar xf /home/user/fastR/fastr/com.oracle.truffle.r.native/../libdownloads/R-3.3.2.tar.gz
ed /home/user/fastR/fastr/com.oracle.truffle.r.native/gnur/R-3.3.2/configure < edconfigure # to fix the zlib version check (fixed in GNUR in the meantime)
1473634
1473529
(cd /home/user/fastR/fastr/com.oracle.truffle.r.native/gnur/R-3.3.2; ./configure --with-x=no --with-aqua=no "--without-recommended-packages" --enable-memory-profiling FFLAGS=-O2 > gnur_configure.log 2>&1)
Makefile.gnur:160: recipe for target '/home/user/fastR/fastr/com.oracle.truffle.r.native/gnur/R-3.3.2/Makefile' failed
make[2]: *** [/home/user/fastR/fastr/com.oracle.truffle.r.native/gnur/R-3.3.2/Makefile] Error 1
make[2]: Leaving directory '/home/user/fastR/fastr/com.oracle.truffle.r.native/gnur'
Makefile:31: recipe for target 'makegnur' failed
make[1]: *** [makegnur] Error 2
make[1]: Leaving directory '/home/user/fastR/fastr/com.oracle.truffle.r.native/gnur'
Makefile:46: recipe for target 'all' failed
make: *** [all] Error 2

Building com.oracle.truffle.r.native with GNU Make failed
1 build tasks failed

Thanks everyone in advance.

RC11 java.lang.ArrayIndexOutOfBoundsException escapes tryCatch

Hello!

(Unsure if this is related to #50 )

When I run the code snippet below using GraalVM, it prints the numbers 1 through 11 and then dies with a stacktrace (see further below), stating java.lang.ArrayIndexOutOfBoundsException. The snippet works fine in regular R (catching & printing the error and "Yah, finished"). Depending on throwing errors for application logic is certainly not pretty, but it is a work around we were trying for other issues in RC11 and it is behaviour that is different from regular R, so we were surprised!

library("pdftools")

  object <- "https://www.graalvm.org/uploads/graalvm-language-level-virtualization-oracle-tech-papers.pdf"
  page <- 1

  while(TRUE){

      img_pdf <- tryCatch({
          print(page)
          pdf_render_page(object, page)
      },
      error = function(cond){
          print(cond)
          print("Yah, finished!")
          return(FALSE)
      })

      if (is.logical(img_pdf)) {
          return()
      } else {
          page <- page + 1
      }
  }
[1] 1
[1] 2
[1] 3
[1] 4
[1] 5
[1] 6
[1] 7
[1] 8
[1] 9
[1] 10
[1] 11
Exception in thread "main" org.graalvm.polyglot.PolyglotException: com.oracle.truffle.r.runtime.RInternalError: java.lang.ArrayIndexOutOfBoundsException: -1
	at com.oracle.truffle.r.nodes.function.FunctionDefinitionNode.execute(FunctionDefinitionNode.java:325)
	at <R> poppler_render_page(Unknown)
	at <R> pdf_render_page(unknown.r:1:0-87)
	at <R> <promise>1572487132(src/main/r/complicatedTextProcessing.R:20:438-466)
	at <R> doTryCatch(Unknown)
	at <R> tryCatchOne(unknown.r:1:0-49)
	at <R> tryCatchList(unknown.r:1:0-50)
	at <R> tryCatch(unknown.r:1:0-47)
	at <R> processText(src/main/r/complicatedTextProcessing.R:18-26:391-606)
	at com.oracle.truffle.polyglot.FunctionProxyHandler.invoke(HostInteropReflect.java:436)
	at com.sun.proxy.$Proxy31.apply(Unknown Source)
	at Main$.delayedEndpoint$Main$1(Main.scala:61)
	at Main$delayedInit$body.apply(Main.scala:7)
	at scala.Function0.apply$mcV$sp(Function0.scala:34)
	at scala.Function0.apply$mcV$sp$(Function0.scala:34)
	at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
	at scala.App.$anonfun$main$1$adapted(App.scala:76)
	at scala.collection.immutable.List.foreach(List.scala:389)
	at scala.App.main(App.scala:76)
	at scala.App.main$(App.scala:74)
	at Main$.main(Main.scala:7)
	at Main.main(Main.scala)
Original Internal Error: 
com.oracle.truffle.r.runtime.RInternalError: java.lang.ArrayIndexOutOfBoundsException: -1
	at com.oracle.truffle.r.nodes.function.FunctionDefinitionNode.execute(FunctionDefinitionNode.java:325)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:275)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callInlined(OptimizedCallTarget.java:229)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.callProxy(OptimizedDirectCallNode.java:84)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:68)
	at com.oracle.truffle.r.nodes.function.call.CallRFunctionNode.execute(CallRFunctionNode.java:59)
	at com.oracle.truffle.r.nodes.function.RCallNode$DispatchedCallNode.execute(RCallNode.java:1180)
	at com.oracle.truffle.r.nodes.function.RCallNode$FunctionDispatch.dispatch(RCallNode.java:905)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen$FunctionDispatchNodeGen.execute(RCallNodeGen.java:668)
	at com.oracle.truffle.r.nodes.function.RCallNode.call(RCallNode.java:274)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen.execute(RCallNodeGen.java:161)
	at com.oracle.truffle.r.nodes.access.WriteLocalFrameVariableNodeGen.execute_generic3(WriteLocalFrameVariableNodeGen.java:114)
	at com.oracle.truffle.r.nodes.access.WriteLocalFrameVariableNodeGen.execute(WriteLocalFrameVariableNodeGen.java:48)
	at com.oracle.truffle.r.nodes.access.WriteVariableSyntaxNode.voidExecute(WriteVariableSyntaxNode.java:60)
	at com.oracle.truffle.r.nodes.control.BlockNode.visibleExecute(BlockNode.java:86)
	at com.oracle.truffle.r.nodes.function.FunctionBodyNode.visibleExecute(FunctionBodyNode.java:58)
	at com.oracle.truffle.r.nodes.function.FunctionDefinitionNode.execute(FunctionDefinitionNode.java:280)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:275)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:264)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:233)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:216)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.callProxy(OptimizedDirectCallNode.java:84)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:68)
	at com.oracle.truffle.r.nodes.function.call.CallRFunctionNode.execute(CallRFunctionNode.java:59)
	at com.oracle.truffle.r.nodes.function.RCallNode$DispatchedCallNode.execute(RCallNode.java:1180)
	at com.oracle.truffle.r.nodes.function.RCallNode$FunctionDispatch.dispatch(RCallNode.java:905)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen$FunctionDispatchNodeGen.execute(RCallNodeGen.java:668)
	at com.oracle.truffle.r.nodes.function.RCallNode.call(RCallNode.java:274)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen.execute(RCallNodeGen.java:161)
	at com.oracle.truffle.r.runtime.nodes.RNode.visibleExecute(RNode.java:74)
	at com.oracle.truffle.r.nodes.control.BlockNode.visibleExecute(BlockNode.java:88)
	at com.oracle.truffle.r.nodes.function.WrapArgumentBaseNode.visibleExecute(WrapArgumentBaseNode.java:63)
	at com.oracle.truffle.r.nodes.InlineCacheNode.doCached(InlineCacheNode.java:70)
	at com.oracle.truffle.r.nodes.InlineCacheNodeGen.execute(InlineCacheNodeGen.java:36)
	at com.oracle.truffle.r.nodes.function.PromiseHelperNode.generateValueDefault(PromiseHelperNode.java:170)
	at com.oracle.truffle.r.nodes.function.PromiseHelperNode.evaluate(PromiseHelperNode.java:152)
	at com.oracle.truffle.r.nodes.function.PromiseHelperNode.generateValueNonDefault(PromiseHelperNode.java:191)
	at com.oracle.truffle.r.nodes.function.PromiseHelperNode.evaluate(PromiseHelperNode.java:154)
	at com.oracle.truffle.r.nodes.access.variables.ReadVariableNode.executeInternal(ReadVariableNode.java:295)
	at com.oracle.truffle.r.nodes.access.variables.LookupNode.visibleExecute(ReadVariableNode.java:113)
	at com.oracle.truffle.r.nodes.function.WrapArgumentBaseNode.visibleExecute(WrapArgumentBaseNode.java:63)
	at com.oracle.truffle.r.engine.REngine$AnonymousBodyNode.visibleExecute(REngine.java:632)
	at com.oracle.truffle.r.engine.REngine$AnonymousRootNode.execute(REngine.java:559)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:275)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:264)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:251)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:233)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.call(OptimizedCallTarget.java:209)
	at com.oracle.truffle.r.runtime.data.Closure.eval(Closure.java:138)
	at com.oracle.truffle.r.nodes.InlineCacheNode.evalPromise(InlineCacheNode.java:94)
	at com.oracle.truffle.r.nodes.InlineCacheNode.doGeneric(InlineCacheNode.java:75)
	at com.oracle.truffle.r.nodes.InlineCacheNodeGen.execute(InlineCacheNodeGen.java:42)
	at com.oracle.truffle.r.nodes.function.PromiseHelperNode.generateValueDefault(PromiseHelperNode.java:170)
	at com.oracle.truffle.r.nodes.function.PromiseHelperNode.generateValueNonDefault(PromiseHelperNode.java:206)
	at com.oracle.truffle.r.nodes.function.PromiseHelperNode.evaluate(PromiseHelperNode.java:154)
	at com.oracle.truffle.r.nodes.access.variables.LocalReadVariableNode.execute(LocalReadVariableNode.java:154)
	at com.oracle.truffle.r.nodes.access.variables.LocalReadVariableNode.execute(LocalReadVariableNode.java:84)
	at com.oracle.truffle.r.nodes.function.PeekLocalVariableNode.execute(PeekLocalVariableNode.java:50)
	at com.oracle.truffle.r.nodes.function.PeekLocalVariableNode.visibleExecute(PeekLocalVariableNode.java:60)
	at com.oracle.truffle.r.nodes.builtin.base.ReturnSpecial.execute(Return.java:58)
	at com.oracle.truffle.r.nodes.function.RCallSpecialNode.execute(RCallSpecialNode.java:306)
	at com.oracle.truffle.r.nodes.function.RCallSpecialNode.visibleExecute(RCallSpecialNode.java:378)
	at com.oracle.truffle.r.nodes.function.WrapArgumentBaseNode.visibleExecute(WrapArgumentBaseNode.java:63)
	at com.oracle.truffle.r.nodes.InlineCacheNode.doCached(InlineCacheNode.java:70)
	at com.oracle.truffle.r.nodes.InlineCacheNodeGen.execute(InlineCacheNodeGen.java:36)
	at com.oracle.truffle.r.nodes.function.PromiseHelperNode.generateValueDefault(PromiseHelperNode.java:170)
	at com.oracle.truffle.r.nodes.function.PromiseHelperNode.evaluate(PromiseHelperNode.java:152)
	at com.oracle.truffle.r.nodes.access.variables.ReadVariableNode.executeInternal(ReadVariableNode.java:295)
	at com.oracle.truffle.r.nodes.access.variables.LookupNode.visibleExecute(ReadVariableNode.java:113)
	at com.oracle.truffle.r.nodes.control.BlockNode.visibleExecute(BlockNode.java:88)
	at com.oracle.truffle.r.nodes.function.FunctionBodyNode.visibleExecute(FunctionBodyNode.java:58)
	at com.oracle.truffle.r.nodes.function.FunctionDefinitionNode.execute(FunctionDefinitionNode.java:280)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:275)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:264)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:251)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:233)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:216)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.callProxy(OptimizedDirectCallNode.java:84)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:68)
	at com.oracle.truffle.r.nodes.function.call.CallRFunctionNode.execute(CallRFunctionNode.java:59)
	at com.oracle.truffle.r.nodes.function.RCallNode$DispatchedCallNode.execute(RCallNode.java:1180)
	at com.oracle.truffle.r.nodes.function.RCallNode$FunctionDispatch.dispatch(RCallNode.java:905)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen$FunctionDispatchNodeGen.execute(RCallNodeGen.java:668)
	at com.oracle.truffle.r.nodes.function.RCallNode.call(RCallNode.java:274)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen.execute(RCallNodeGen.java:161)
	at com.oracle.truffle.r.nodes.access.WriteLocalFrameVariableNodeGen.execute_generic3(WriteLocalFrameVariableNodeGen.java:114)
	at com.oracle.truffle.r.nodes.access.WriteLocalFrameVariableNodeGen.execute(WriteLocalFrameVariableNodeGen.java:48)
	at com.oracle.truffle.r.nodes.access.WriteVariableSyntaxNode.voidExecute(WriteVariableSyntaxNode.java:60)
	at com.oracle.truffle.r.nodes.control.BlockNode.visibleExecute(BlockNode.java:86)
	at com.oracle.truffle.r.nodes.function.FunctionBodyNode.visibleExecute(FunctionBodyNode.java:58)
	at com.oracle.truffle.r.nodes.function.FunctionDefinitionNode.execute(FunctionDefinitionNode.java:280)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:275)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:264)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:251)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:233)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:216)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.callProxy(OptimizedDirectCallNode.java:84)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:68)
	at com.oracle.truffle.r.nodes.function.call.CallRFunctionNode.execute(CallRFunctionNode.java:59)
	at com.oracle.truffle.r.nodes.function.RCallNode$DispatchedCallNode.execute(RCallNode.java:1180)
	at com.oracle.truffle.r.nodes.function.RCallNode$FunctionDispatch.dispatch(RCallNode.java:905)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen$FunctionDispatchNodeGen.execute(RCallNodeGen.java:668)
	at com.oracle.truffle.r.nodes.function.RCallNode.call(RCallNode.java:274)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen.execute(RCallNodeGen.java:161)
	at com.oracle.truffle.r.runtime.nodes.RNode.visibleExecute(RNode.java:74)
	at com.oracle.truffle.r.nodes.control.IfNode.visibleExecute(IfNode.java:93)
	at com.oracle.truffle.r.nodes.control.IfNode.visibleExecute(IfNode.java:96)
	at com.oracle.truffle.r.nodes.control.BlockNode.visibleExecute(BlockNode.java:88)
	at com.oracle.truffle.r.nodes.function.FunctionBodyNode.visibleExecute(FunctionBodyNode.java:58)
	at com.oracle.truffle.r.nodes.function.FunctionDefinitionNode.execute(FunctionDefinitionNode.java:280)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:275)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:264)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:251)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:233)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:216)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.callProxy(OptimizedDirectCallNode.java:84)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:68)
	at com.oracle.truffle.r.nodes.function.call.CallRFunctionNode.execute(CallRFunctionNode.java:59)
	at com.oracle.truffle.r.nodes.function.RCallNode$DispatchedCallNode.execute(RCallNode.java:1180)
	at com.oracle.truffle.r.nodes.function.RCallNode$FunctionDispatch.dispatch(RCallNode.java:905)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen$FunctionDispatchNodeGen.execute(RCallNodeGen.java:668)
	at com.oracle.truffle.r.nodes.function.RCallNode.call(RCallNode.java:274)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen.execute(RCallNodeGen.java:161)
	at com.oracle.truffle.r.runtime.nodes.RNode.visibleExecute(RNode.java:74)
	at com.oracle.truffle.r.nodes.control.BlockNode.visibleExecute(BlockNode.java:88)
	at com.oracle.truffle.r.nodes.function.FunctionBodyNode.visibleExecute(FunctionBodyNode.java:58)
	at com.oracle.truffle.r.nodes.function.FunctionDefinitionNode.execute(FunctionDefinitionNode.java:280)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:275)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:264)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:251)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:233)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:216)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.callProxy(OptimizedDirectCallNode.java:84)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:68)
	at com.oracle.truffle.r.nodes.function.call.CallRFunctionNode.execute(CallRFunctionNode.java:59)
	at com.oracle.truffle.r.nodes.function.RCallNode$DispatchedCallNode.execute(RCallNode.java:1180)
	at com.oracle.truffle.r.nodes.function.RCallNode$FunctionDispatch.dispatch(RCallNode.java:905)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen$FunctionDispatchNodeGen.execute(RCallNodeGen.java:668)
	at com.oracle.truffle.r.nodes.function.RCallNode.call(RCallNode.java:274)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen.execute(RCallNodeGen.java:161)
	at com.oracle.truffle.r.nodes.access.WriteLocalFrameVariableNodeGen.execute_generic3(WriteLocalFrameVariableNodeGen.java:114)
	at com.oracle.truffle.r.nodes.access.WriteLocalFrameVariableNodeGen.execute(WriteLocalFrameVariableNodeGen.java:48)
	at com.oracle.truffle.r.nodes.access.WriteVariableSyntaxNode.voidExecute(WriteVariableSyntaxNode.java:60)
	at com.oracle.truffle.r.nodes.control.BlockNode.voidExecute(BlockNode.java:70)
	at com.oracle.truffle.r.nodes.control.WhileNode$WhileRepeatingNode.executeRepeating(WhileNode.java:83)
	at org.graalvm.compiler.truffle.runtime.OptimizedOSRLoopNode.profilingLoop(OptimizedOSRLoopNode.java:135)
	at org.graalvm.compiler.truffle.runtime.OptimizedOSRLoopNode.executeLoop(OptimizedOSRLoopNode.java:112)
	at com.oracle.truffle.r.nodes.control.WhileNode.execute(WhileNode.java:54)
	at com.oracle.truffle.r.runtime.nodes.RNode.voidExecute(RNode.java:66)
	at com.oracle.truffle.r.nodes.control.BlockNode.visibleExecute(BlockNode.java:86)
	at com.oracle.truffle.r.nodes.function.FunctionBodyNode.visibleExecute(FunctionBodyNode.java:58)
	at com.oracle.truffle.r.nodes.function.FunctionDefinitionNode.execute(FunctionDefinitionNode.java:280)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:275)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:264)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:251)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:233)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:216)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.callProxy(OptimizedDirectCallNode.java:84)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:68)
	at com.oracle.truffle.r.nodes.function.call.CallRFunctionNode.execute(CallRFunctionNode.java:59)
	at com.oracle.truffle.r.nodes.function.RCallNode$DispatchedCallNode.execute(RCallNode.java:1180)
	at com.oracle.truffle.r.nodes.function.RCallNode$FunctionDispatch.dispatch(RCallNode.java:905)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen$FunctionDispatchNodeGen.executeAndSpecialize(RCallNodeGen.java:714)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen$FunctionDispatchNodeGen.execute(RCallNodeGen.java:678)
	at com.oracle.truffle.r.nodes.function.RCallNode.call(RCallNode.java:274)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen.executeAndSpecialize(RCallNodeGen.java:226)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen.execute(RCallNodeGen.java:151)
	at com.oracle.truffle.r.nodes.function.call.RExplicitCallNode.doCall(RExplicitCallNode.java:69)
	at com.oracle.truffle.r.nodes.function.call.RExplicitCallNodeGen.executeAndSpecialize(RExplicitCallNodeGen.java:44)
	at com.oracle.truffle.r.nodes.function.call.RExplicitCallNodeGen.execute(RExplicitCallNodeGen.java:31)
	at com.oracle.truffle.r.nodes.function.call.RExplicitCallNode.call(RExplicitCallNode.java:52)
	at com.oracle.truffle.r.engine.interop.RFunctionMR$RFunctionExecuteNode.access(RFunctionMR.java:71)
	at com.oracle.truffle.r.engine.interop.RFunctionMRForeign$RFunctionExecuteSubNode.accessWithTarget(RFunctionMRForeign.java:124)
	at com.oracle.truffle.r.engine.interop.RFunctionMRForeignFactory$RFunctionExecuteSubNodeGen.executeAndSpecialize(RFunctionMRForeignFactory.java:60)
	at com.oracle.truffle.r.engine.interop.RFunctionMRForeignFactory$RFunctionExecuteSubNodeGen.executeWithTarget(RFunctionMRForeignFactory.java:44)
	at com.oracle.truffle.r.engine.interop.RFunctionMRForeign$RFunctionExecuteSubNode$EXECUTERootNode.execute(RFunctionMRForeign.java:146)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:275)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:264)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:251)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:233)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:216)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.callProxy(OptimizedDirectCallNode.java:84)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:68)
	at com.oracle.truffle.api.interop.InteropAccessNode.doCached(InteropAccessNode.java:206)
	at com.oracle.truffle.api.interop.InteropAccessNodeGen.executeAndSpecialize(InteropAccessNodeGen.java:82)
	at com.oracle.truffle.api.interop.InteropAccessNodeGen.executeImpl(InteropAccessNodeGen.java:45)
	at com.oracle.truffle.api.interop.InteropAccessNode.execute(InteropAccessNode.java:87)
	at com.oracle.truffle.api.interop.ForeignAccess.sendExecute(ForeignAccess.java:463)
	at com.oracle.truffle.polyglot.PolyglotExecuteNode.execute(PolyglotExecuteNode.java:89)
	at com.oracle.truffle.polyglot.FunctionProxyNode.executeImpl(HostInteropReflect.java:373)
	at com.oracle.truffle.polyglot.FunctionProxyNode.executeImpl(HostInteropReflect.java:341)
	at com.oracle.truffle.polyglot.HostRootNode.execute(HostRootNode.java:94)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:275)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:264)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:251)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:233)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.call(OptimizedCallTarget.java:209)
	at com.oracle.truffle.polyglot.FunctionProxyHandler.invoke(HostInteropReflect.java:436)
	at com.sun.proxy.$Proxy31.apply(Unknown Source)
	at Main$.delayedEndpoint$Main$1(Main.scala:61)
	at Main$delayedInit$body.apply(Main.scala:7)
	at scala.Function0.apply$mcV$sp(Function0.scala:34)
	at scala.Function0.apply$mcV$sp$(Function0.scala:34)
	at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
	at scala.App.$anonfun$main$1$adapted(App.scala:76)
	at scala.collection.immutable.List.foreach(List.scala:389)
	at scala.App.main(App.scala:76)
	at scala.App.main$(App.scala:74)
	at Main$.main(Main.scala:7)
	at Main.main(Main.scala)
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
	at java.util.ArrayList.elementData(ArrayList.java:422)
	at java.util.ArrayList.remove(ArrayList.java:499)
	at com.oracle.truffle.r.ffi.impl.common.JavaUpCallsRFFIImpl.Rf_unprotect(JavaUpCallsRFFIImpl.java:1600)
	at com.oracle.truffle.r.ffi.impl.upcalls.Rf_unprotectCall$Rf_unprotectCallFactory$1.execute(Rf_unprotectCall.java:54)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:275)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:264)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:251)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:233)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:216)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.callProxy(OptimizedDirectCallNode.java:84)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:68)
	at com.oracle.truffle.api.interop.InteropAccessNode.doCached(InteropAccessNode.java:206)
	at com.oracle.truffle.api.interop.InteropAccessNodeGen.executeImpl(InteropAccessNodeGen.java:35)
	at com.oracle.truffle.api.interop.InteropAccessNode.execute(InteropAccessNode.java:87)
	at com.oracle.truffle.api.interop.ForeignAccess.send(ForeignAccess.java:241)
	at com.oracle.truffle.nfi.impl.LibFFIClosure$CallClosureNode.execute(LibFFIClosure.java:159)
	at com.oracle.truffle.nfi.impl.LibFFIClosure$ObjectRetClosureRootNode.execute(LibFFIClosure.java:218)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:275)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:264)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:251)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:233)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.call(OptimizedCallTarget.java:209)
	at com.oracle.truffle.nfi.impl.NFIContext.executePrimitive(Native Method)
	at com.oracle.truffle.nfi.impl.NFIContext.executePrimitive(NFIContext.java:280)
	at com.oracle.truffle.nfi.impl.LibFFISignature.execute(LibFFISignature.java:185)
	at com.oracle.truffle.nfi.impl.LibFFIFunctionMessageResolution$CachedExecuteNode.cachedSignature(LibFFIFunctionMessageResolution.java:90)
	at com.oracle.truffle.nfi.impl.LibFFIFunctionMessageResolutionFactory$CachedExecuteNodeGen.execute(LibFFIFunctionMessageResolutionFactory.java:38)
	at com.oracle.truffle.nfi.impl.LibFFIFunctionMessageResolution$ExecuteLibFFIFunctionNode.access(LibFFIFunctionMessageResolution.java:197)
	at com.oracle.truffle.nfi.impl.LibFFIFunctionMessageResolutionForeign$ExecuteLibFFIFunctionSubNode.accessWithTarget(LibFFIFunctionMessageResolutionForeign.java:124)
	at com.oracle.truffle.nfi.impl.LibFFIFunctionMessageResolutionForeignFactory$ExecuteLibFFIFunctionSubNodeGen.executeWithTarget(LibFFIFunctionMessageResolutionForeignFactory.java:39)
	at com.oracle.truffle.nfi.impl.LibFFIFunctionMessageResolutionForeign$ExecuteLibFFIFunctionSubNode$EXECUTERootNode.execute(LibFFIFunctionMessageResolutionForeign.java:146)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:275)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callInlined(OptimizedCallTarget.java:229)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.callProxy(OptimizedDirectCallNode.java:84)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:68)
	at com.oracle.truffle.api.interop.InteropAccessNode.doCached(InteropAccessNode.java:206)
	at com.oracle.truffle.api.interop.InteropAccessNodeGen.executeImpl(InteropAccessNodeGen.java:35)
	at com.oracle.truffle.api.interop.InteropAccessNode.execute(InteropAccessNode.java:87)
	at com.oracle.truffle.api.interop.ForeignAccess.sendExecute(ForeignAccess.java:463)
	at com.oracle.truffle.r.ffi.impl.nfi.TruffleNFI_Call$TruffleNFI_InvokeCallNode.invokeCallCached(TruffleNFI_Call.java:97)
	at com.oracle.truffle.r.ffi.impl.nfi.TruffleNFI_CallFactory$TruffleNFI_InvokeCallNodeGen.execute(TruffleNFI_CallFactory.java:41)
	at com.oracle.truffle.r.runtime.ffi.CallRFFI$InvokeCallNode.dispatch(CallRFFI.java:41)
	at com.oracle.truffle.r.nodes.builtin.base.foreign.CallAndExternalFunctions$Dot.dispatch(CallAndExternalFunctions.java:971)
	at com.oracle.truffle.r.nodes.builtin.base.foreign.CallAndExternalFunctions$DotCall.callNamedFunctionWithPackage(CallAndExternalFunctions.java:718)
	at com.oracle.truffle.r.nodes.builtin.base.foreign.CallAndExternalFunctionsFactory$DotCallNodeGen.execute(CallAndExternalFunctionsFactory.java:95)
	at com.oracle.truffle.r.nodes.builtin.RBuiltinNode$Arg3.call(RBuiltinNode.java:200)
	at com.oracle.truffle.r.nodes.function.RCallNode$BuiltinCallNode.execute(RCallNode.java:1123)
	at com.oracle.truffle.r.nodes.function.RCallNode$FunctionDispatch.dispatch(RCallNode.java:905)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen$FunctionDispatchNodeGen.execute(RCallNodeGen.java:668)
	at com.oracle.truffle.r.nodes.function.RCallNode.call(RCallNode.java:274)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen.execute(RCallNodeGen.java:161)
	at com.oracle.truffle.r.runtime.nodes.RNode.visibleExecute(RNode.java:74)
	at com.oracle.truffle.r.nodes.control.BlockNode.visibleExecute(BlockNode.java:88)
	at com.oracle.truffle.r.nodes.function.FunctionBodyNode.visibleExecute(FunctionBodyNode.java:58)
	at com.oracle.truffle.r.nodes.function.FunctionDefinitionNode.execute(FunctionDefinitionNode.java:280)
	... 209 more
Caused by: Attached Guest Language Frames (10)

Process finished with exit code 1

read.csv() breaks when using | (pipe) delimited CSV

Problem:
read.csv() breaks when using | (pipe) delimited CSV

Cause:
This probably uses a RegEx pattern to match the delimiter. Unfortunately, "|" is a metacharacter in regex. The Java RegEx engine interprets the pattern /|/ as an expression that can match zero characters, and therefore matches infinitely. Running "asdf".split("|") in Java returns an array a, s, d, f

1) Consider a script that produces a CSV file delimited by pipes (|)
For some reason, let's say it's the only delimiter that makes sense
2) Attempt to run the command:
db_jira_rec <- read.csv("/Users/xxxxx/auto_sprint_mgr_broken_new/training/big_jira2.csv", sep="|", ...)
3) Print db_jira_rec:

> db_jira_rec
  V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 V17 V18 V19 V20 V21
1  t  h  i  s  _  i  s  _  h   o   w   _   t   h   e   _   o   u   t   p   u
  V22 V23 V24 V25 V26 V27 V28 V29 V30 V31 V32 V33 V34 V35 V36 V37 V38 V39 V40
1   t   _   l   o   o   k   s   _   b   u   t   _   O   r   a   c   l   e   _
  V41 V42 V43 V44 V45 V46 V47 V48 V49 V50 V51 V52 V53 V54 V55 V56 V57 V58 V59
1   w   o   u   l   d   _   g   e   t   _   m   a   d   _   i   f   _   I   _
  V60 V61 V62 V63 V64 V65 V66 V67 V68 V69 V70 V71 V72 V73 V74 V75 V76 V77 V78
1   p   o   s   t   e   d   _   d   a   t   a   _   f   r   o   m   _   t   h
  V79 V80 V81 V82 V83 V84 V85 V86 V87 V88 V89 V90 V91 V92 V93 V94 V95 V96 V97
1   e   i   r   _   J   I   R   A   _   d   a   t   a   b   a   s   e   _   _
...
...
...

install of package Rcpp fails

I am not able to install Rcpp package in FastR. Rcpp package installs without issues on R 3.1 (included in distro) and R 3.3 (from cran3 builds).
Is there any solution or work around?
Thank you.

$ mx r
FastR version 3.2.4
Copyright (c) 2013-16, Oracle and/or its affiliates
Copyright (c) 1995-2016, The R Core Team
Copyright (c) 2016 The R Foundation for Statistical Computing
Copyright (c) 2012-4 Purdue University
Copyright (c) 1997-2002, Makoto Matsumoto and Takuji Nishimura
All rights reserved.

FastR is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information.

Type 'q()' to quit R.
> install.packages("Rcpp", repo="http://cran.cnr.berkeley.edu")
tools:::.install_packages()
* installing *source* package ‘Rcpp’ ...
** package ‘Rcpp’ successfully unpacked and MD5 sums checked
** libs
g++ -I/home/build/projects/dev/r-lang/fastr/include -DNDEBUG -I../inst/include/ -DLIBICONV_PLUG -fpic -DLIBICONV_PLUG -DFASTR -c Date.cpp -o Date.o
g++ -I/home/build/projects/dev/r-lang/fastr/include -DNDEBUG -I../inst/include/ -DLIBICONV_PLUG -fpic -DLIBICONV_PLUG -DFASTR -c Module.cpp -o Module.o
g++ -I/home/build/projects/dev/r-lang/fastr/include -DNDEBUG -I../inst/include/ -DLIBICONV_PLUG -fpic -DLIBICONV_PLUG -DFASTR -c Rcpp_init.cpp -o Rcpp_init.o
g++ -I/home/build/projects/dev/r-lang/fastr/include -DNDEBUG -I../inst/include/ -DLIBICONV_PLUG -fpic -DLIBICONV_PLUG -DFASTR -c api.cpp -o api.o
g++ -I/home/build/projects/dev/r-lang/fastr/include -DNDEBUG -I../inst/include/ -DLIBICONV_PLUG -fpic -DLIBICONV_PLUG -DFASTR -c attributes.cpp -o attributes.o
g++ -I/home/build/projects/dev/r-lang/fastr/include -DNDEBUG -I../inst/include/ -DLIBICONV_PLUG -fpic -DLIBICONV_PLUG -DFASTR -c barrier.cpp -o barrier.o
g++ -shared -L/usr/local/lib -o Rcpp.so Date.o Module.o Rcpp_init.o api.o attributes.o barrier.o
installing to /home/build/projects/dev/r-lang/fastr/library/Rcpp/libs
** R
** inst
** preparing package for lazy loading
Error in .RcppClass$methods : object of type 'closure' is not subsettable
Error: unable to load R code in package ‘Rcpp’

* removing ‘/home/build/projects/dev/r-lang/fastr/library/Rcpp’

The downloaded source packages are in
‘/tmp/Rtmp3WkG5x/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("Rcpp", repo = "http://cran.cnr.berkeley.edu") : installation of package ‘Rcpp’ had non-zero exit status

$ uname -a
Linux amd 4.7.0-0.bpo.1-amd64 #1 SMP Debian 4.7.5-1~bpo8+1 (2016-09-30) x86_64 GNU/Linux

$ java -version
openjdk version "1.8.0_102"
OpenJDK Runtime Environment (build 1.8.0_102-8u102-b14.1-1~bpo8+1-b14)
OpenJDK 64-Bit Server VM (build 25.102-b14, mixed mode)

Installed package ggplot2 cannot be found when using the Polyglot API

Hi,

I am tryin gto execute a R script which requires the ggplot2 library. The script starts with :
library(ggplot2)

I have installed the ggplot2 as follows:

$ Rscript -e "install.packages("ggplot2")"
Content type 'application/octet-stream' length 2213308 bytes (2.1 MB)

  • installing source package ‘ggplot2’ ...
    ** package ‘ggplot2’ successfully unpacked and MD5 sums checked
    ** R
    ** data
    *** moving datasets to lazyload DB
    ** inst
    ** preparing package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** installing vignettes
    ** testing if installed package can be loaded
  • DONE (ggplot2)

The downloaded source packages are in
'/private/var/folders/d5/m03q171j0hbfmpwhtyd_85l400010c/T/Rtmp2ldDvy/downloaded_packages'
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done

I am able to execute the r-spring sample code, from terminal, which uses ggplot2.

However when trying to execute my script using a Polyglot Context, I get the following error:

Error in library(ggplot2) : there is no package called ‘ggplot2’ Failed to execute script: Error in library(ggplot2) : there is no package called ‘ggplot2’

Do I need to setup/install packages in a different way if I intend to use them from Polyglot Context?
Thanks for your help
Edoardo.

Installation of data.table 1.11.4 fails (but 1.10.4 succeeds)

Hi,

On installing data.table for R within the precompiled linux binary of graalvm (graalvm-ce-1.0.0-rc2), I receive the following error (I've highlighted the important line):

install.packages("data.table")
...
** installing vignettes
** testing if installed package can be loaded
Error: package or namespace load failed for ‘data.table’ in runHook(".onLoad", env, package.lib, package):
.onLoad failed in loadNamespace() for 'data.table', details:
call: fun(libname, pkgname)
error: Unexpected base R behaviour: list(x) has copied x
Error: loading failed
...
installation of package ‘data.table’ had non-zero exit status

However, data.table version 1.10.4 installation does work:

install.packages("http://cran.r-project.org/src/contrib/Archive/data.table/data.table_1.10.4.tar.gz")

I notice that between 1.10.4 and 1.11.4 (current) there has been a requirement change in R from 3.0 to 3.1.

The crux of the issue is this section in .onLoad:

'# Test R behaviour that changed in v3.1 and is now depended on
x = 1L:3L
y = list(x)
if (address(x) != address(y[[1L]])) stop("Unexpected base R behaviour: list(x) has copied x")

Does this point to an imlementation difference between GNU R and FastR?

Adam

p.s. thank you for all of your hard work with FastR - I am convinced that it will be a real boon to the community.

Classpath / Linking exception

Can the license be changed so there is a classpath and linking exception. Or ideally make it ASL 2.0, MIT, BSD which mean this can be used to develop your own language using and perhaps copying and adopting some of the constructs from this.

setArrayElement does not work on R array/vector

Hi,

I am trying to use Value.setArrayElement() to populate a R vector from Java (host side).
I have tried the following:

Value rArray = guestLanguageContext.eval("R", "vector()");
rArray.setArrayElement(0, "somevalue");

While the empty vector is successfully created, calling setArrayElement() like that does not change the content of the R array.

Is it possible to use setArrayElement with an R array? Am I not doing it right or is this an issue with the R implementation?

Thanks
Edoardo.

Research of analytics in R from Java Code

I'd like to embed R code to my java project. Do you have some tutorial, pointers to existing code of enbeded R in Java, user guide, demo project or other documentation how to use R code (not standalone) from the system running core in written in Java.

Thanks!

Error installing package 'lobstr'

I got package 'lobstr' working on RC10, but in RC11 I get the following error.

Error: package or namespace load failed for ‘lobstr’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/rbotafogo/lib/graalvm-ce-1.0.0-rc11/jre/languages/R/library/lobstr/libs/lobstr.so'
/home/rbotafogo/lib/graalvm-ce-1.0.0-rc11/jre/languages/R/library/lobstr/libs/lobstr.so: undefined symbol: ALTREP
Error: loading failed

  • DONE (lobstr)

NPE in RScope.createLocalScopes(RContext, Node, Frame) if Frame == null

The API docu of TruffleLanguage.findLocalScopes(C, Node, Frame) allows a null-frame as last argument:

frame The current frame the node is in, or null for lexical access when the program is not running, or is not suspended at the node's location.

But a NullPointerException is thrown when calling with a null-frame.

Caused by: java.lang.NullPointerException
	at com.oracle.truffle.r.runtime.RArguments.isRFrame(RArguments.java:356)
	at com.oracle.truffle.r.runtime.env.RScope.getEnv(RScope.java:100)
	at com.oracle.truffle.r.runtime.env.RScope.createLocalScopes(RScope.java:118)
	at com.oracle.truffle.r.engine.TruffleRLanguageImpl.findLocalScopes(TruffleRLanguageImpl.java:231)
	at com.oracle.truffle.r.engine.TruffleRLanguageImpl.findLocalScopes(TruffleRLanguageImpl.java:1)
	at com.oracle.truffle.api.TruffleLanguage$Env.findLocalScopes(TruffleLanguage.java:2028)
	at com.oracle.truffle.api.TruffleLanguage$LanguageImpl.findLocalScopes(TruffleLanguage.java:2494)
	at com.oracle.truffle.api.instrumentation.TruffleInstrument$Env.findLocalScopes(TruffleInstrument.java:646)

package ‘fastr’ in options("defaultPackages") was not found

Hello,

I tried building fastR based on the linked bitbucket wiki page. The build seems to run and complete just fine but when I start fastR I get a number of complaints based on not being able to find default packages:

Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return  :
  there is no package called ‘fastr’
2:
  package ‘fastr’ in options("defaultPackages") was not found
3:
  package ‘datasets’ in options("defaultPackages") was not found
4:
  package ‘utils’ in options("defaultPackages") was not found
5:
  package ‘grDevices’ in options("defaultPackages") was not found
6:
  package ‘graphics’ in options("defaultPackages") was not found
7:
  package ‘stats’ in options("defaultPackages") was not found
8:
  package ‘methods’ in options("defaultPackages") was not found

I checked my .libPaths() and the stated packages appear to be in my $FASTR_HOME/fastr/library folder but are failing to be loaded.

One option that I suspect may be the cause is that I built fastR from the source code stored in bitbucket. (i.e. mx sclone https://[email protected]/allr/fastr)

I also noticed that some of the stated effects in the wiki were not the case:

After this, you should find three directories called fastr, jvmci and graal in the project root.

Can you confirm these are still the instructions that I should be following for the build process? If not, can someone point me to an updated build process?

Thanks!

An internal error occurred: "should not reach here: ... = value parameter" when installing PerformanceAnalytics package

Hi,

Using your 1.0.0-RC8 Docker image, I installed fastR

gu install R

Then I tried to install the PerformanceAnalytics package in R.

install.packages("PerformanceAnalytics")

The installer installs the dependencies, and starts with the PerformanceAnalytics package:

*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (xts)
* installing *source* package ‘PerformanceAnalytics’ ...
** package ‘PerformanceAnalytics’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/opt/graalvm-ce-1.0.0-rc8/jre/languages/R/include -DNDEBUG   -O2 -I/cm/shared/apps/zlib/1.2.11/include -I/cm/shared/apps/bzip2/1.0.6/include -I/cm/shared/apps/xz/5.2.2/include -I/cm/shared/apps/pcre/8.38/include -I/cm/shared/apps/curl/7.50.1/include -DFASTR -DNO_GNUR   -fpic  -O2 -I/cm/shared/apps/zlib/1.2.11/include -I/cm/shared/apps/bzip2/1.0.6/include -I/cm/shared/apps/xz/5.2.2/include -I/cm/shared/apps/pcre/8.38/include -I/cm/shared/apps/curl/7.50.1/include  -DFASTR -DNO_GNUR -c MCAHelper.c -o MCAHelper.o
gcc -std=gnu99 -I/opt/graalvm-ce-1.0.0-rc8/jre/languages/R/include -DNDEBUG   -O2 -I/cm/shared/apps/zlib/1.2.11/include -I/cm/shared/apps/bzip2/1.0.6/include -I/cm/shared/apps/xz/5.2.2/include -I/cm/shared/apps/pcre/8.38/include -I/cm/shared/apps/curl/7.50.1/include -DFASTR -DNO_GNUR   -fpic  -O2 -I/cm/shared/apps/zlib/1.2.11/include -I/cm/shared/apps/bzip2/1.0.6/include -I/cm/shared/apps/xz/5.2.2/include -I/cm/shared/apps/pcre/8.38/include -I/cm/shared/apps/curl/7.50.1/include  -DFASTR -DNO_GNUR -c comomentsEstimators.c -o comomentsEstimators.o
gcc -std=gnu99 -I/opt/graalvm-ce-1.0.0-rc8/jre/languages/R/include -DNDEBUG   -O2 -I/cm/shared/apps/zlib/1.2.11/include -I/cm/shared/apps/bzip2/1.0.6/include -I/cm/shared/apps/xz/5.2.2/include -I/cm/shared/apps/pcre/8.38/include -I/cm/shared/apps/curl/7.50.1/include -DFASTR -DNO_GNUR   -fpic  -O2 -I/cm/shared/apps/zlib/1.2.11/include -I/cm/shared/apps/bzip2/1.0.6/include -I/cm/shared/apps/xz/5.2.2/include -I/cm/shared/apps/pcre/8.38/include -I/cm/shared/apps/curl/7.50.1/include  -DFASTR -DNO_GNUR -c comomentsHelper.c -o comomentsHelper.o
gcc -std=gnu99 -I/opt/graalvm-ce-1.0.0-rc8/jre/languages/R/include -DNDEBUG   -O2 -I/cm/shared/apps/zlib/1.2.11/include -I/cm/shared/apps/bzip2/1.0.6/include -I/cm/shared/apps/xz/5.2.2/include -I/cm/shared/apps/pcre/8.38/include -I/cm/shared/apps/curl/7.50.1/include -DFASTR -DNO_GNUR   -fpic  -O2 -I/cm/shared/apps/zlib/1.2.11/include -I/cm/shared/apps/bzip2/1.0.6/include -I/cm/shared/apps/xz/5.2.2/include -I/cm/shared/apps/pcre/8.38/include -I/cm/shared/apps/curl/7.50.1/include  -DFASTR -DNO_GNUR -c init.c -o init.o
gcc -std=gnu99 -shared -L/cm/shared/apps/zlib/1.2.11/lib -L/cm/shared/apps/bzip2/1.0.6/lib -L/cm/shared/apps/xz/5.2.2/lib -L/cm/shared/apps/pcre/8.38/lib -L/cm/shared/apps/curl/7.50.1/lib -L/cm/shared/apps/gcc/4.9.1/lib64 -o PerformanceAnalytics.so MCAHelper.o comomentsEstimators.o comomentsHelper.o init.o
installing to /opt/graalvm-ce-1.0.0-rc8/jre/languages/R/library/PerformanceAnalytics/libs
** R
An internal error occurred: "should not reach here: ... = value parameter"
Please report an issue at https://github.com/oracle/fastr including the commands and the error log file '/root/polyglot/fastr_errors_pid998.log'.

I have attached the log as requested.

Thanks,

Tan

fastr_errors_pid998.log

Cannot configure fastr in Ubuntu

Configure_fastr in dying with the following message in Ubuntu... tried to install the library but fastr cannot find it. Any help is appreciated!

checking if PCRE version >= 8.10, < 10.0 and has UTF-8 support... no
checking whether PCRE support suffices... configure: error: pcre >= 8.10 library and headers are required
7451
?

Build errors

Hi, do you know what could be causing the build to fail? I see a few warnings:

8 warnings
Compiling com.oracle.truffle.r.parser with javac-daemon... [dependency TRUFFLE_R_PARSER_PROCESSOR updated]
Compiling com.oracle.truffle.tools.debug.shell with javac-daemon... [dependency TRUFFLE_DSL_PROCESSOR updated]
Downloading JFFI from ['https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/jffi-1.2.9.jar', 'https://search.maven.org/remotecontent?filepath=com/github/jnr/jffi/1.2.9/jffi-1.2.9.jar']
Downloading https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/jffi-1.2.9.jar to C:\Users\Noah\.mx\cache\JFFI_93294973285d2977c41fb1cfcfa864d41b145498.jar
Error reading from https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/jffi-1.2.9.jar: HTTP Error 404: Not Found
** If behind a firewall without direct internet access, use the http_proxy environment variable (e.g. "env http_proxy=proxy.company.com:80 mx ...") or download manually with a web browser.
Traceback (most recent call last):
  File "C:\mx\/mx.py", line 12984, in <module>
    main()
  File "C:\mx\/mx.py", line 12968, in main
    retcode = c(command_args)
  File "C:\fastr\mx.fastr\mx_fastr.py", line 238, in build
    return mx_jvm().build(args)
  File "C:\fastr\mx.fastr\mx_fastr.py", line 57, in build
    return mx.build(args)
  File "C:\mx\/mx.py", line 8511, in build
    t.execute()
  File "C:\mx\/mx.py", line 607, in execute
    self.build()
  File "C:\mx\/mx.py", line 2657, in build
    self.subject.get_path(resolve=True)
  File "C:\mx\/mx.py", line 2609, in get_path
    return download_file_with_sha1(self.name, path, urls, self.sha1, sha1path, resolve, not self.optional, canSymlink=not bootClassPathAgent)
  File "C:\mx\/mx.py", line 2321, in download_file_with_sha1
    download(cachePath, urls)
  File "C:\mx\/mx.py", line 8242, in download
    os.remove(tmp)
WindowsError: [Error 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\Noah\\.mx\\cache\\JFFI_93294973285d2977c41fb1cfcfa864d41b145498.jar.qpwoug'

>[py27] C:\fastr>mx r

>[py27] C:\fastr>python C:\mx\/mx.py r
bash: C:fastretcldpaths: No such file or directory
etc/ldpaths does not define LD_LIBRARY_PATH

I'm not sure if it's the jffi 404 causing the failure or me trying to build on windows 8. I can run a VM if some kind of linux box would work better.

re the jffi 404 I don't see a 1.2.9 in that directory but do see a 1.2.7 if that helps pinpoint the problem.

PolyglotException when calling from clojure

When trying to call ruby from a leiningen session I get the folowing error:

PolyglotException java.lang.NullPointerException com.oracle.truffle.r.runtime.ffi.DLL$DLLInfo.access$1000 (DLL.java:201)

Initialized as follows (source: https://blog.taylorwood.io/2018/11/26/graal-polyglot.html):

user=> (ns polydact.core
user=> (:import (org.graalvm.polyglot Context Value)
user=>          (org.graalvm.polyglot.proxy ProxyArray ProxyExecutable ProxyObject)))
polydact.core=> (def context (-> (Context/newBuilder (into-array ["R"]))
polydact.core=> (.allowAllAccess true)
polydact.core=> (.build)))
polydact.core=> (.eval context "R" "
polydact.core=> 3^2 + 2^2
polydact.core=> ")

dimnames behavior different after dim is changed

  1. ary <- array(NA,dim=c(2,3,4),dimnames=list(1:2,1:3,1:4))
  2. dim(ary) <- c(6,4)
  3. dimnames(ary)[[2]] <- 1:4

fastR reports: length of 'dimnames' [3] must match that of 'dims' [2]

after step 2
dimnames(ary) gives NULL on GNUR, but fastR gives
[[1]]
[1] "1" "2"

[[2]]
[1] "1" "2" "3"

[[3]]
[1] "1" "2" "3" "4"

seems that fastR still preserve old dimnames even array dim is changed

Can't load 'R.oo' package -

When trying to install R.oo in FastR, I see the following:

> install.packages('R.oo')
Installing package into ‘/Users/kwilliams/git/hackday/graal-and-fastr/r-libs’
(as ‘lib’ is unspecified)
--2018-11-02 17:03:26--  https://cran.revolutionanalytics.com/src/contrib/R.oo_1.22.0.tar.gz
Resolving cran.revolutionanalytics.com (cran.revolutionanalytics.com)... 13.66.202.75
Connecting to cran.revolutionanalytics.com (cran.revolutionanalytics.com)|13.66.202.75|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 381495 (373K) [application/octet-stream]
Saving to: ‘/var/folders/zp/hj5hqfw970z0_78mrb_802lm0001z9/T/RtmpOiKhvT/downloaded_packages/R.oo_1.22.0.tar.gz’

/var/folders/zp/hj5hqfw970z0_78mrb_802l 100%[=============================================================================>] 372.55K  1.50MB/s    in 0.2s    

2018-11-02 17:03:27 (1.50 MB/s) - ‘/var/folders/zp/hj5hqfw970z0_78mrb_802lm0001z9/T/RtmpOiKhvT/downloaded_packages/R.oo_1.22.0.tar.gz’ saved [381495/381495]

* installing *source* package ‘R.oo’ ...
** package ‘R.oo’ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error: package or namespace load failed for ‘R.oo’ in runHook(".onAttach", ns, dirname(nspath), nsname):
 .onAttach failed in attachNamespace() for 'R.oo', details:
  call: getEnvironment.Package(this)
  error: could not find function "pos.to.env"
Error: loading failed
* DONE (R.oo)

No such error happens when doing the same in Gnu R. pos.to.env is a function base::pos.to.env, so I'm not sure what's different about the namespaces that's causing it to not be found.

The .onAttach() function is doing this:

> R.oo:::.onAttach
function (libname, pkgname) 
{
    pkg <- get(pkgname, envir = getNamespace(pkgname))
    startupMessage(pkg)
}

And indeed when I run that internal code manually, it fails:

> pkgname <- 'R.oo'; pkg <- get(pkgname, envir = getNamespace(pkgname))
Error in getEnvironment.Package(this) :
  could not find function "pos.to.env"

strptime not work at CST time zone

just run strptime('2013-04-04','%Y-%m-%d'), fastR throws error

Fri Nov 09 19:43:57 CST 2018
com.oracle.truffle.r.runtime.RInternalError: java.time.zone.ZoneRulesException: Unknown time-zone ID: CST
at com.oracle.truffle.r.nodes.function.FunctionDefinitionNode.execute(FunctionDefinitionNode.java:321)
at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:289)
at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:278)

full log here:
fastr_errors_pid22716.log

Warning message in FastR not present in Gnu R

The following code works fine in Gnu R:

library('dplyr')
ex = parse(text = ('cyl == 8'))
filter(mtcars, eval(ex))

In FastR it also works but gives the following warnings:

Warning messages:
1:
SET_ATTRIB: tag in the attributes pairlist must be a symbol. NULL given.
2:
SET_ATTRIB: tag in the attributes pairlist must be a symbol. NULL given.

Raw Vector is turned into `RDoubleVector` where an instance of RAbstractIntVector is expected using `pdftools` and underlying `poppler`

Hello!

I am using GraalVM rc10 with fastR to make our R-functions executable from our Scala codebase. I have made some nice progress, but I’m now stuck on what appears to be an internal issue with how graal/fastr handles R vectors.
I am trying to render a pdf using the R package pdftools, but when passing the function pdf_render_page a raw vector (as it demands) I get the stack trace printed below, saying it dies in the underlying poppler_render_page call. Apparently, somewhere internally, the raw vector gets converted to an RDoubleVector, which cannot be cast to an RAbstractIntVector (makes sense).
The same raw vector works fine when passed to pdf_info (which is from the same pdftools package).

The original data is an Array of Integers handed over from Scala code, using GraalVM, so there is nothing in the data that precludes making it an IntVector. I also explicitly convert it to raw using as.raw().

Not sure if this is relevant, but I am on MacOS and have poppler 0.72.0 installed using brew (required for the pdftools package)

Thanks in advance!

Stacktrace

	at com.oracle.truffle.r.nodes.function.FunctionDefinitionNode.execute(FunctionDefinitionNode.java:325)
	at <R>.poppler_render_page(Unknown)
	at <R>.pdf_render_page(unknown.r:1)
	at <R>.[my application]

rc6 release contains both libpcre.so and libpcre.so.1

Hi! I publish the fastr-bin AUR package, and while updating it to rc6, I ran into this error:

ln: failed to create symbolic link '…/pkg/fastr-bin/usr/lib/jvm/java-8-graal/jre/languages/R/lib/libpcre.so': File exists

The problem is that the jar contains both libpcre.so and libpcre.so.1 in jre/languages/R/lib/, but the META-INF/symlinks file also instructs us to install jre/languages/R/lib/libpcre.so as a symlink to libpcre.so.1. According to the file metadata, the .so file dates to August 2nd while the .so.1 file is from August 31st, so perhaps the .so one (which apparently should be a symlink anyways) is an artifact from an older version that accidentally made it into the package?

The two files are identical, so this isn’t a hard problem to solve from my end, but I thought you’d want to know.

(Edit: turns out libgcc_s.so{,.1}, libgfortran.so{,.3}, libquadmath.so{,.0} and libz.so{,.1} have the same problem. All of them are identical copies as well.)

Error in .Fortran while using TTR runCov

library(TTR)
runCov(1:10,1:10)

fastR reports
Error in .Fortran("runCov", rs1 = as.double(x[beg:NROW(xy)]), avg1 = as.double( :
C symbol name "[runCov]" not in load table

read.csv treat column as character instead of number if missing value after valid value

read following csv

col1,col2
,1
2,

with

csv <-read.csv('test.csv',stringsAsFactors=F)
typeof(csv$col1)
csv$col1
typeof(csv$col2)
csv$col2

GNU-R

integer
NA 2
integer
1 NA

fastR

integer
NA 2
character
"1"  ""

seems this only happen if missing value after valid value. for example add more row like this:

col1,col2
,1
2,
,3

fastR typeof col1 will also changed to character

Cannot install RcppParallel

I'm using graal/fastr 1.0.0 rc11

install.packages('RcppParallel')

Installing package into ‘/b/b/e/fastr/library’
(as ‘lib’ is unspecified)
Content type 'application/octet-stream' length 1265021 bytes (1.2 MB)
* installing *source* package ‘RcppParallel’ ...
** package ‘RcppParallel’ successfully unpacked and MD5 sums checked
* preparing to configure package 'RcppParallel' ...
** executing 'R CMD config'
** executing 'R CMD config'
An internal error occurred.
Please report an issue at https://github.com/oracle/fastr including the commands. You can rerun FastR with --jvm.DR:+PrintErrorStacktracesToFile to turn on internal errors logging. Please attach the log file
 to the issue if possible.
ERROR: configuration failed for package ‘RcppParallel’
* removing ‘/b/b/e/fastr/library/RcppParallel’

filter result has very small differences between fastR and GNU-R ?

I've found that following code gives (very little) different value in fastR and GNU-R

x <- 1:6
lambda <- 0.33
init <- 0
result <- filter(lambda*x, filter = 1-lambda, method='recursive', init = init)

save GNU-R result and load into fast-R, execute same calculation
fastRResult - gnuRResult

[1]  0.000000e+00  0.000000e+00  0.000000e+00  0.000000e+00  0.000000e+00
[6] -8.881784e-16

is this very little differences an implementation defined behavior ,or a bug ?

Support expss package on FastR

When trying to execute the following minimal steps:

require("expss")
P1 <- c(1,1,2,2,2,2,1,2,2,1,1,1,1,1,1,2,2,1,1,1)
val_lab(P1) <- make_labels("
                           1 Masc
                           2 Fem
                           ")
total_x_P1 <- cro_rpct(total(), col_vars = P1, total_row_position = "below", total_label = "Base")

The error occurred and resulted in the following log:

Sat Sep 08 04:56:01 BST 2018
com.oracle.truffle.r.runtime.RInternalError: not implemented: .Internal rapply
	at com.oracle.truffle.r.runtime.RInternalError.unimplemented(RInternalError.java:108)
	at com.oracle.truffle.r.nodes.builtin.InternalNode$InternalUninitializedNode.execute(InternalNode.java:143)
	at com.oracle.truffle.r.nodes.access.WriteLocalFrameVariableNodeGen.execute_generic3(WriteLocalFrameVariableNodeGen.java:114)
	at com.oracle.truffle.r.nodes.access.WriteLocalFrameVariableNodeGen.execute(WriteLocalFrameVariableNodeGen.java:48)
	at com.oracle.truffle.r.nodes.access.WriteVariableSyntaxNode.voidExecute(WriteVariableSyntaxNode.java:60)
	at com.oracle.truffle.r.nodes.control.ReplacementDispatchNode.voidExecute(ReplacementDispatchNode.java:77)
	at com.oracle.truffle.r.nodes.control.BlockNode.visibleExecute(BlockNode.java:86)
	at com.oracle.truffle.r.nodes.function.FunctionBodyNode.visibleExecute(FunctionBodyNode.java:58)
	at com.oracle.truffle.r.nodes.function.FunctionDefinitionNode.execute(FunctionDefinitionNode.java:276)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:269)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:258)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:248)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:230)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:213)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.callProxy(OptimizedDirectCallNode.java:86)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:70)
	at com.oracle.truffle.r.nodes.function.call.CallRFunctionNode.execute(CallRFunctionNode.java:59)
	at com.oracle.truffle.r.nodes.function.RCallNode$DispatchedCallNode.execute(RCallNode.java:1155)
	at com.oracle.truffle.r.nodes.function.RCallNode$FunctionDispatch.dispatch(RCallNode.java:880)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen$FunctionDispatchNodeGen.executeAndSpecialize(RCallNodeGen.java:713)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen$FunctionDispatchNodeGen.execute(RCallNodeGen.java:677)
	at com.oracle.truffle.r.nodes.function.RCallNode.call(RCallNode.java:263)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen.executeAndSpecialize(RCallNodeGen.java:225)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen.execute(RCallNodeGen.java:208)
	at com.oracle.truffle.r.runtime.nodes.RNode.visibleExecute(RNode.java:74)
	at com.oracle.truffle.r.nodes.function.WrapArgumentBaseNode.visibleExecute(WrapArgumentBaseNode.java:63)
	at com.oracle.truffle.r.nodes.InlineCacheNode.doCached(InlineCacheNode.java:70)
	at com.oracle.truffle.r.nodes.InlineCacheNodeGen.executeAndSpecialize(InlineCacheNodeGen.java:83)
	at com.oracle.truffle.r.nodes.InlineCacheNodeGen.execute(InlineCacheNodeGen.java:46)
	at com.oracle.truffle.r.nodes.function.PromiseHelperNode.generateValueDefault(PromiseHelperNode.java:170)
	at com.oracle.truffle.r.nodes.function.PromiseHelperNode.evaluate(PromiseHelperNode.java:152)
	at com.oracle.truffle.r.nodes.access.variables.ReadVariableNode.executeInternal(ReadVariableNode.java:267)
	at com.oracle.truffle.r.nodes.access.variables.LookupNode.execute(ReadVariableNode.java:102)
	at com.oracle.truffle.r.nodes.builtin.InternalNode$InternalCallDefaultNode.prepareArgs(InternalNode.java:273)
	at com.oracle.truffle.r.nodes.builtin.InternalNode$InternalCallNode.execute(InternalNode.java:230)
	at com.oracle.truffle.r.nodes.builtin.InternalNode$InternalUninitializedNode.execute(InternalNode.java:180)
	at com.oracle.truffle.r.nodes.unary.ConvertBooleanNodeGen.executeByte_generic3(ConvertBooleanNodeGen.java:160)
	at com.oracle.truffle.r.nodes.unary.ConvertBooleanNodeGen.executeByte(ConvertBooleanNodeGen.java:121)
	at com.oracle.truffle.r.nodes.control.IfNode.evaluateCondition(IfNode.java:57)
	at com.oracle.truffle.r.nodes.control.IfNode.visibleExecute(IfNode.java:92)
	at com.oracle.truffle.r.nodes.control.BlockNode.visibleExecute(BlockNode.java:88)
	at com.oracle.truffle.r.nodes.function.FunctionBodyNode.visibleExecute(FunctionBodyNode.java:58)
	at com.oracle.truffle.r.nodes.function.FunctionDefinitionNode.execute(FunctionDefinitionNode.java:276)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:269)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:258)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:248)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:230)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:213)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.callProxy(OptimizedDirectCallNode.java:86)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:70)
	at com.oracle.truffle.r.nodes.function.call.CallRFunctionNode.execute(CallRFunctionNode.java:59)
	at com.oracle.truffle.r.nodes.function.RCallNode$DispatchedCallNode.execute(RCallNode.java:1155)
	at com.oracle.truffle.r.nodes.function.RCallNode$FunctionDispatch.dispatch(RCallNode.java:880)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen$FunctionDispatchNodeGen.executeAndSpecialize(RCallNodeGen.java:713)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen$FunctionDispatchNodeGen.execute(RCallNodeGen.java:677)
	at com.oracle.truffle.r.nodes.function.RCallNode.call(RCallNode.java:263)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen.executeAndSpecialize(RCallNodeGen.java:225)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen.execute(RCallNodeGen.java:208)
	at com.oracle.truffle.r.nodes.access.WriteLocalFrameVariableNodeGen.execute_generic3(WriteLocalFrameVariableNodeGen.java:114)
	at com.oracle.truffle.r.nodes.access.WriteLocalFrameVariableNodeGen.execute(WriteLocalFrameVariableNodeGen.java:48)
	at com.oracle.truffle.r.nodes.access.WriteVariableSyntaxNode.voidExecute(WriteVariableSyntaxNode.java:60)
	at com.oracle.truffle.r.nodes.control.ReplacementDispatchNode.voidExecute(ReplacementDispatchNode.java:77)
	at com.oracle.truffle.r.nodes.control.BlockNode.visibleExecute(BlockNode.java:86)
	at com.oracle.truffle.r.nodes.function.FunctionBodyNode.visibleExecute(FunctionBodyNode.java:58)
	at com.oracle.truffle.r.nodes.function.FunctionDefinitionNode.execute(FunctionDefinitionNode.java:276)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:269)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:258)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:248)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:230)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:213)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.callProxy(OptimizedDirectCallNode.java:86)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:70)
	at com.oracle.truffle.r.nodes.function.call.CallRFunctionNode.execute(CallRFunctionNode.java:59)
	at com.oracle.truffle.r.nodes.function.RCallNode$DispatchedCallNode.execute(RCallNode.java:1155)
	at com.oracle.truffle.r.nodes.function.RCallNode$FunctionDispatch.dispatch(RCallNode.java:880)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen$FunctionDispatchNodeGen.executeAndSpecialize(RCallNodeGen.java:713)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen$FunctionDispatchNodeGen.execute(RCallNodeGen.java:677)
	at com.oracle.truffle.r.nodes.function.RCallNode.call(RCallNode.java:263)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen.executeAndSpecialize(RCallNodeGen.java:225)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen.execute(RCallNodeGen.java:208)
	at com.oracle.truffle.r.runtime.nodes.RNode.voidExecute(RNode.java:66)
	at com.oracle.truffle.r.nodes.control.BlockNode.visibleExecute(BlockNode.java:86)
	at com.oracle.truffle.r.nodes.function.FunctionBodyNode.visibleExecute(FunctionBodyNode.java:58)
	at com.oracle.truffle.r.nodes.function.FunctionDefinitionNode.execute(FunctionDefinitionNode.java:276)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:269)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:258)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:248)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:230)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:213)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.callProxy(OptimizedDirectCallNode.java:86)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:70)
	at com.oracle.truffle.r.nodes.function.call.CallRFunctionNode.execute(CallRFunctionNode.java:59)
	at com.oracle.truffle.r.nodes.function.RCallNode$DispatchedCallNode.execute(RCallNode.java:1155)
	at com.oracle.truffle.r.nodes.function.RCallNode$FunctionDispatch.dispatch(RCallNode.java:880)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen$FunctionDispatchNodeGen.executeAndSpecialize(RCallNodeGen.java:713)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen$FunctionDispatchNodeGen.execute(RCallNodeGen.java:677)
	at com.oracle.truffle.r.nodes.function.RCallNode.call(RCallNode.java:263)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen.executeAndSpecialize(RCallNodeGen.java:225)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen.execute(RCallNodeGen.java:208)
	at com.oracle.truffle.r.runtime.nodes.RNode.visibleExecute(RNode.java:74)
	at com.oracle.truffle.r.nodes.control.BlockNode.visibleExecute(BlockNode.java:88)
	at com.oracle.truffle.r.nodes.function.FunctionBodyNode.visibleExecute(FunctionBodyNode.java:58)
	at com.oracle.truffle.r.nodes.function.FunctionDefinitionNode.execute(FunctionDefinitionNode.java:276)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:269)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:258)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:248)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:230)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:213)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.callProxy(OptimizedDirectCallNode.java:86)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:70)
	at com.oracle.truffle.r.nodes.function.call.CallRFunctionNode.execute(CallRFunctionNode.java:59)
	at com.oracle.truffle.r.nodes.function.RCallNode$DispatchedCallNode.execute(RCallNode.java:1155)
	at com.oracle.truffle.r.nodes.function.RCallNode$FunctionDispatch.dispatch(RCallNode.java:880)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen$FunctionDispatchNodeGen.executeAndSpecialize(RCallNodeGen.java:713)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen$FunctionDispatchNodeGen.execute(RCallNodeGen.java:677)
	at com.oracle.truffle.r.nodes.function.RCallNode.call(RCallNode.java:263)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen.executeAndSpecialize(RCallNodeGen.java:225)
	at com.oracle.truffle.r.nodes.function.RCallNodeGen.execute(RCallNodeGen.java:208)
	at com.oracle.truffle.r.nodes.access.WriteLocalFrameVariableNodeGen.execute_generic3(WriteLocalFrameVariableNodeGen.java:114)
	at com.oracle.truffle.r.nodes.access.WriteLocalFrameVariableNodeGen.execute(WriteLocalFrameVariableNodeGen.java:48)
	at com.oracle.truffle.r.nodes.access.WriteVariableSyntaxNode.visibleExecute(WriteVariableSyntaxNode.java:85)
	at com.oracle.truffle.r.nodes.control.ReplacementDispatchNode.visibleExecute(ReplacementDispatchNode.java:90)
	at com.oracle.truffle.r.engine.REngine$AnonymousBodyNode.visibleExecute(REngine.java:634)
	at com.oracle.truffle.r.engine.REngine$AnonymousRootNode.execute(REngine.java:561)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:269)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:258)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:248)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:230)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:213)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.callProxy(OptimizedDirectCallNode.java:86)
	at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:70)
	at com.oracle.truffle.r.engine.EngineRootNode$EngineBodyNode.execute(EngineRootNode.java:133)
	at com.oracle.truffle.r.engine.EngineRootNode.execute(EngineRootNode.java:83)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:269)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:258)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:248)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:230)
	at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.call(OptimizedCallTarget.java:206)
	at com.oracle.truffle.polyglot.PolyglotContextImpl.eval(PolyglotContextImpl.java:698)
	at org.graalvm.polyglot.Context.eval(Context.java:314)
	at com.oracle.truffle.r.launcher.REPL.lambda$readEvalPrint$1(REPL.java:115)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: Attached Guest Language Frames (7)

Frame(d=5): rapply (called as: rapply(list(...), NROW, classes = "ANY", how = "replace"))
Frame(d=4): unlist <split-61f32b03> (called as: unlist(rapply(list(...), NROW, classes = "ANY", how = "replace")))
Frame(d=3): check_sizes (called as: check_sizes("'cro'", cell_vars, col_vars, weight, subgroup))
Frame(d=2): multi_cro <split-91e79ca> (called as: multi_cro(cell_vars = cell_vars, col_vars = col_vars, row_vars = row_vars, )
Frame(d=1): cro_rpct (called as: cro_rpct(total(), col_vars = P1, total_row_position = "below", )
Frame(d=0): <repl wrapper> (called as: <invalid call>)
<empty frame>

with frame slot contents:

Frame(d=5): rapply (called as: rapply(list(...), NROW, classes = "ANY", how = "replace"))
      object = [2, com.oracle.truffle.r.runtime.VirtualEvalFrame$Substitute1@78dd9e90, expr=WrapArgumentNode@b564835, [[[1]], [[1, 1, 2, 2, 2, 2, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1]], NULL, NULL]]
      f = [2, com.oracle.truffle.r.runtime.VirtualEvalFrame$Substitute1@78dd9e90, expr=WrapArgumentNode@2b571455, null]
      classes = [2, null, expr=ConstantObjectNode@3b704853, ANY]
      deflt = [3, null, expr=ConstantObjectNode@23b48ed6, NULL]
      how = [replace]
      ... = RArgsValuesAndNames: 
      Visibility = true
      TempFrameSlot = null
Frame(d=4): unlist <split-61f32b03> (called as: unlist(rapply(list(...), NROW, classes = "ANY", how = "replace")))
      x = [18, org.graalvm.compiler.truffle.runtime.FrameWithoutBoxing@6608f27a, expr=WrapArgumentNode@12c64cf6, null]
      recursive = [3, null, expr=ConstantLogicalScalarNode@2f879bab, 1]
      use.names = [3, null, expr=ConstantLogicalScalarNode@1d4664d7, 1]
      Visibility = null
Frame(d=3): check_sizes (called as: check_sizes("'cro'", cell_vars, col_vars, weight, subgroup))
      caller_name = [2, null, expr=ConstantObjectNode@35bfe919, 'cro']
      ... = RArgsValuesAndNames: null = [4, org.graalvm.compiler.truffle.runtime.FrameWithoutBoxing@3ceb1ced, expr=WrapArgumentNode@7e53f88c, [[1]]], null = [4, org.graalvm.compiler.truffle.runtime.FrameWithoutBoxing@3ceb1ced, expr=WrapArgumentNode@555d0c30, [[1, 1, 2...
      Visibility = true
Frame(d=2): multi_cro <split-91e79ca> (called as: multi_cro(cell_vars = cell_vars, col_vars = col_vars, row_vars = row_vars, )
      cell_vars = [[1]]
      col_vars = [[1, 1, 2, 2, 2, 2, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1]]
      row_vars = [NULL]
      weight = [0, org.graalvm.compiler.truffle.runtime.FrameWithoutBoxing@59c4a42, expr=WrapArgumentNode@36f44d, NULL]
      subgroup = [0, org.graalvm.compiler.truffle.runtime.FrameWithoutBoxing@59c4a42, expr=WrapArgumentNode@3138bc41, NULL]
      total_label = [0, org.graalvm.compiler.truffle.runtime.FrameWithoutBoxing@59c4a42, expr=WrapArgumentNode@43d299c1, null]
      total_statistic = [0, org.graalvm.compiler.truffle.runtime.FrameWithoutBoxing@59c4a42, expr=WrapArgumentNode@55af29ec, null]
      total_row_position = [0, org.graalvm.compiler.truffle.runtime.FrameWithoutBoxing@59c4a42, expr=WrapArgumentNode@620c3b88, null]
      stat_type = [2, null, expr=ConstantObjectNode@1622493c, rpct]
      Visibility = false
Frame(d=1): cro_rpct (called as: cro_rpct(total(), col_vars = P1, total_row_position = "below", )
      cell_vars = [[1]]
      col_vars = [[1, 1, 2, 2, 2, 2, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1]]
      row_vars = [3, null, expr=ConstantObjectNode@2f8564e0, NULL]
      weight = [3, null, expr=ConstantObjectNode@ba5d4d, NULL]
      subgroup = [3, null, expr=ConstantObjectNode@150058eb, NULL]
      total_label = [2, null, expr=ConstantObjectNode@6e3f721b, Base]
      total_statistic = [3, null, expr=ConstantObjectNode@461894ba, u_cases]
      total_row_position = [2, null, expr=ConstantObjectNode@76e4a5f4, below]
      Visibility = true
      str_cell_vars = [total()]
      str_col_vars = [P1]
      str_row_vars = [NULL]
Frame(d=0): <repl wrapper> (called as: <invalid call>)
      Visibility = true
      .Random.seed = active binding
      TempFrameSlot = null
      TempFrameSlot = null
      TempFrameSlot = null
      TempFrameSlot = null
      TempFrameSlot = null
      P1 = [1, 1, 2, 2, 2, 2, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1]
      *rhs*0 = null
      *tmp*0 = null
<empty frame>

Processing of Perl-compatible regexps for gsub() differs from the GNU R

For the gsub() function, processing of Perl-compatible regexps differs from the GNU R.

FastR ( commit acc680f)

> str <- "R> Line 1\n Line 2\n"
> gsub(">.*\n|\n", "", str, perl=TRUE)
[1] "R"
> gsub(">.*\n|\n", "", str, perl=FALSE)
[1] "R"

GNU R ( version 3.2.3 )

> str <- "R> Line 1\n Line 2\n"
> gsub(">.*\n|\n", "", str, perl=TRUE)
[1] "R Line 2"
> gsub(">.*\n|\n", "", str, perl=FALSE)
[1] "R"
> gsub(">.*\n|\n", "", str)
[1] "R"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.