fastr icon indicating copy to clipboard operation
fastr copied to clipboard

GraalVM - CE - cannot load data with load or readRDS

Open jobdiogenes opened this issue 5 years ago • 7 comments

When starting R command line, While loading workspace (".RData")

Note: ** Under Linux Ubuntu amd64 **

we get : Error in load(name, envir = .GlobalEnv) : the input does not start with a magic number compatible with loading from a connection.

When use readRDS to load objects also give errors. follow the logs.

Wed Jan 29 12:31:53 GMT 2020 com.oracle.truffle.r.runtime.RInternalError: java.lang.NullPointerException at com.oracle.truffle.r.nodes.function.FunctionDefinitionNode.execute(FunctionDefinitionNode.java:333) at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:327) at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:317) at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:304) at com.oracle.svm.truffle.api.SubstrateOptimizedCallTarget.doInvoke(SubstrateOptimizedCallTarget.java:135) at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:241) at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:63) at com.oracle.truffle.r.nodes.function.call.CallRFunctionNode.execute(CallRFunctionNode.java:63) at com.oracle.truffle.r.nodes.function.RCallNode$DispatchedCallNode.execute(RCallNode.java:1213) at com.oracle.truffle.r.nodes.function.RCallNode$FunctionDispatch.dispatch(RCallNode.java:911) at com.oracle.truffle.r.nodes.function.RCallNodeGen$FunctionDispatchNodeGen.executeAndSpecialize(RCallNodeGen.java:905) at com.oracle.truffle.r.nodes.function.RCallNodeGen$FunctionDispatchNodeGen.execute(RCallNodeGen.java:869) at com.oracle.truffle.r.nodes.function.RCallNode.call(RCallNode.java:289) at com.oracle.truffle.r.nodes.function.RCallNodeGen.executeAndSpecialize(RCallNodeGen.java:246) at com.oracle.truffle.r.nodes.function.RCallNodeGen.execute(RCallNodeGen.java:220) at com.oracle.truffle.r.runtime.nodes.RNode.visibleExecute(RNode.java:74) 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:327) at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:317) at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:304) at com.oracle.svm.truffle.api.SubstrateOptimizedCallTarget.doInvoke(SubstrateOptimizedCallTarget.java:135) at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:241) at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:63) at com.oracle.truffle.r.engine.EngineRootNode$EngineBodyNode.execute(EngineRootNode.java:138) at com.oracle.truffle.r.engine.EngineRootNode.execute(EngineRootNode.java:85) at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:327) at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:317) at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:304) at com.oracle.svm.truffle.api.SubstrateOptimizedCallTarget.doInvoke(SubstrateOptimizedCallTarget.java:135) at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callIndirect(OptimizedCallTarget.java:229) at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.call(OptimizedCallTarget.java:216) at com.oracle.truffle.polyglot.PolyglotContextImpl.eval(PolyglotContextImpl.java:805) at org.graalvm.polyglot.Context.eval(Context.java:344) at com.oracle.truffle.r.launcher.REPL.lambda$readEvalPrint$1(REPL.java:124) 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) at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:460) at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:193) Caused by: java.lang.NullPointerException at com.oracle.truffle.r.runtime.RSerialize$Input.readItem(RSerialize.java:466) at com.oracle.truffle.r.runtime.RSerialize$Input.readItem(RSerialize.java:429) at com.oracle.truffle.r.runtime.RSerialize$Input.readItem(RSerialize.java:592) at com.oracle.truffle.r.runtime.RSerialize$Input.readItem(RSerialize.java:429) at com.oracle.truffle.r.runtime.RSerialize$Input.unserialize(RSerialize.java:423) at com.oracle.truffle.r.runtime.RSerialize$Input.access$300(RSerialize.java:356) at com.oracle.truffle.r.runtime.RSerialize.unserialize(RSerialize.java:327) at com.oracle.truffle.r.nodes.builtin.base.SerializeFunctions.doUnserializeFromConnBase(SerializeFunctions.java:63) at com.oracle.truffle.r.nodes.builtin.base.SerializeFunctions$UnserializeFromConn.doUnserializeFromConn(SerializeFunctions.java:111) at com.oracle.truffle.r.nodes.builtin.base.SerializeFunctionsFactory$UnserializeFromConnNodeGen.executeAndSpecialize(SerializeFunctionsFactory.java:58) at com.oracle.truffle.r.nodes.builtin.base.SerializeFunctionsFactory$UnserializeFromConnNodeGen.execute(SerializeFunctionsFactory.java:48) at com.oracle.truffle.r.nodes.builtin.RBuiltinNode$Arg2.call(RBuiltinNode.java:187) at com.oracle.truffle.r.nodes.builtin.InternalNode$InternalCallNode.execute(InternalNode.java:241) at com.oracle.truffle.r.nodes.builtin.InternalNode$InternalUninitializedNode.execute(InternalNode.java:182) at com.oracle.truffle.r.runtime.nodes.RNode.visibleExecute(RNode.java:74) at com.oracle.truffle.r.nodes.control.BlockNode.visibleExecute(BlockNode.java:119) at com.oracle.truffle.r.nodes.function.FunctionBodyNode.visibleExecute(FunctionBodyNode.java:58) at com.oracle.truffle.r.nodes.function.FunctionDefinitionNode.execute(FunctionDefinitionNode.java:282) ... 40 more Caused by: Attached Guest Language Frames (3)

Frame(d=1): readRDS (called as: readRDS(file = "notomelas.rds")) Frame(d=0): (called as: )

with frame slot contents:

Frame(d=1): readRDS (called as: readRDS(file = "notomelas.rds")) file = [4, org.graalvm.compiler.truffle.runtime.FrameWithoutBoxing@7f16ab707548, expr=ConstantObjectNode@44dea096, notomelas.rds] refhook = [3, null, expr=ConstantObjectNode@3f0892c3, NULL] Visibility = false con = [3] OnExit = pairlist(type=null, tag=NULL, car=RNull, cdr=RPairList) Frame(d=0): (called as: ) TempFrameSlot = null TempFrameSlot = null Visibility = true TempFrameSlot = null TempFrameSlot = null TempFrameSlot = null TempFrameSlot = null TempFrameSlot = null TempFrameSlot = null TempFrameSlot = null TempFrameSlot = null TempFrameSlot = null TempFrameSlot = null TempFrameSlot = null TempFrameSlot = null .Random.seed = active binding TempFrameSlot = null TempFrameSlot = null

jobdiogenes avatar Jan 29 '20 12:01 jobdiogenes

using load("dat.rda") return:

the input does not start with a magic number compatible with loading from a connection

jobdiogenes avatar Jan 29 '20 12:01 jobdiogenes

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

** Under Linux Ubuntu amd64

While load R from command line.

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. Error in load(name, envir = .GlobalEnv) : the input does not start with a magic number compatible with loading from a connection

jobdiogenes avatar Jan 29 '20 12:01 jobdiogenes

Hello,

thank you for the bug report. Can you share with us the data file that cannot be loaded? Do you know how it was created? By GNU-R or FastR or something else?

steve-s avatar Feb 12 '20 17:02 steve-s

Hi Steve,

I make tests with two files, the first one was created using R-Studio (.Rdata) workspace, and another I download from internet.. The external I try using url: mood_data <- url("http://www.psychology.mcmaster.ca/bennett/psy710/datasets/mood_data.Rdata")

load(mood_data)

and download and them load local.

does not load any file that I try.

jobdiogenes avatar Feb 12 '20 19:02 jobdiogenes

Hello,

for the file from http://www.psychology.mcmaster.ca/bennett/psy710/datasets/mood_data.Rdata I am getting this error:

Error in load("~/Downloads/mood_data.Rdata") :
  error reading connection: serialized stream format not implemented: 65

is that what you see or something else? For the file created by R-Studio: what is your R-Studio version and R version (I think you can check that by running R.version in R-Studio R console)?

steve-s avatar Feb 14 '20 08:02 steve-s

P.S.: could you also post your GraalVM version? It is probably some 19.3.x?

steve-s avatar Feb 14 '20 08:02 steve-s

Hi Steve,

I try using both Graalvm-ce 19.3.1 java 11. R Studio 1.2.1335 (build 4)

In Ubuntu 18.04.

The problem appear to be related with RStudio and file compression (gzip). I make more tests and use R command Line to load and save the workspace (Rdata) to another file. And now load OK.

In anyway while its not solved. Would be nice to advise users in R instructions in website.

jobdiogenes avatar Feb 15 '20 20:02 jobdiogenes