Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

internal error in rnorm #181

Open
rsettlage opened this issue Feb 22, 2021 · 7 comments
Open

internal error in rnorm #181

rsettlage opened this issue Feb 22, 2021 · 7 comments
Labels

Comments

@rsettlage
Copy link

docker run -it ghcr.io/graalvm/graalvm-ce:21.0.0 bash
gu install R
> n<-2^14
> n^2
[1] 268435456
> M<-rnorm(n^2)
An internal error occurred.
Please report an issue at https://github.com/oracle/fastr including the commands. You can rerun FastR with --R.PrintErrorStacktracesToFile=true to turn on internal errors logging. Please attach the log file to the issue if possible.
@rsettlage rsettlage added the bug label Feb 22, 2021
@steve-s
Copy link
Member

steve-s commented Feb 22, 2021

Hello,

can you re-run with --R.PrintErrorStacktracesToFile=true and check what exception this produces (it will be in the log file). My guess would be that it is out of memory error and you'll need to give your application/container more memory (use, e.g., --vm.Xmx4g).

@rsettlage
Copy link
Author

OK, did that, perhaps I didn't do it quite right.

Caused by: java.lang.OutOfMemoryError: Java heap space
at com.oracle.truffle.r.library.stats.RandFunctionsNodes$RandFunctionDoubleExecutorNode.cached(RandFunctionsNodes.java:273)
at com.oracle.truffle.r.library.stats.RandFunctionsNodesFactory$RandFunctionDoubleExecutorNodeGen.executeAndSpecialize(RandFunctionsNodesFactory.java:592)
at com.oracle.truffle.r.library.stats.RandFunctionsNodesFactory$RandFunctionDoubleExecutorNodeGen.execute(RandFunctionsNodesFactory.java:547)
at com.oracle.truffle.r.library.stats.RandFunctionsNodes$RandFunctionExecutorBase.evaluateWithCached(RandFunctionsNodes.java:158)
at com.oracle.truffle.r.library.stats.RandFunctionsNodesFactory$RandFunctionExecutorBaseNodeGen.executeAndSpecialize(RandFunctionsNodesFactory.java:318)
at com.oracle.truffle.r.library.stats.RandFunctionsNodesFactory$RandFunctionExecutorBaseNodeGen.execute(RandFunctionsNodesFactory.java:281)
at com.oracle.truffle.r.library.stats.RandFunctionsNodes$RandFunction2Node.evaluate(RandFunctionsNodes.java:360)
at com.oracle.truffle.r.library.stats.RandFunctionsNodesFactory$RandFunction2NodeGen.executeAndSpecialize(RandFunctionsNodesFactory.java:808)
at com.oracle.truffle.r.library.stats.RandFunctionsNodesFactory$RandFunction2NodeGen.execute(RandFunctionsNodesFactory.java:777)
at com.oracle.truffle.r.nodes.builtin.RExternalBuiltinNode$Arg3.call(RExternalBuiltinNode.java:108)
at com.oracle.truffle.r.nodes.builtin.RExternalBuiltinNode.call(RExternalBuiltinNode.java:40)
at com.oracle.truffle.r.nodes.builtin.base.foreign.CallAndExternalFunctions$Dot.doExternalBuiltinSymbolInfo(CallAndExternalFunctions.java:319)
at com.oracle.truffle.r.nodes.builtin.base.foreign.CallAndExternalFunctionsFactory$DotCallNodeGen.executeAndSpecialize(CallAndExternalFunctionsFactory.java:682)
at com.oracle.truffle.r.nodes.builtin.base.foreign.CallAndExternalFunctionsFactory$DotCallNodeGen.execute(CallAndExternalFunctionsFactory.java:637)
at com.oracle.truffle.r.nodes.builtin.RBuiltinNode$Arg3.call(RBuiltinNode.java:205)
at com.oracle.truffle.r.nodes.function.RCallNode$BuiltinCallNode.execute(RCallNode.java:1165)
at com.oracle.truffle.r.nodes.function.RCallNode$FunctionDispatch.dispatch(RCallNode.java:921)
at com.oracle.truffle.r.nodes.function.RCallNodeGen$FunctionDispatchNodeGen.executeAndSpecialize(RCallNodeGen.java:749)
at com.oracle.truffle.r.nodes.function.RCallNodeGen$FunctionDispatchNodeGen.execute(RCallNodeGen.java:713)
at com.oracle.truffle.r.nodes.function.RCallNode.call(RCallNode.java:296)
at com.oracle.truffle.r.nodes.function.RCallNodeGen.executeAndSpecialize(RCallNodeGen.java:236)
at com.oracle.truffle.r.nodes.function.RCallNodeGen.execute(RCallNodeGen.java:210)
at com.oracle.truffle.r.runtime.nodes.RNode.visibleExecute(RNode.java:74)
at com.oracle.truffle.r.nodes.function.FunctionBodyNode.visibleExecute(FunctionBodyNode.java:67)
at com.oracle.truffle.r.nodes.function.FunctionDefinitionNode.execute(FunctionDefinitionNode.java:289)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:591)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:562)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:512)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:496)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:459)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:71)
at com.oracle.truffle.r.nodes.function.call.CallRFunctionNode.execute(CallRFunctionNode.java:63)
Caused by: Attached Guest Language Frames (3)

Frame(d=1): rnorm (called as: rnorm(n^2))
Frame(d=0): (called as: )

with frame slot contents:

Frame(d=1): rnorm (called as: rnorm(n^2))
n = [4, org.graalvm.compiler.truffle.runtime.FrameWithoutBoxing@577de8df, expr=WrapArgumentNode@57762707, 2.68435456E8]
mean = [3, org.graalvm.compiler.truffle.runtime.FrameWithoutBoxing@21acff7a, expr=ConstantDoubleScalarNode@448acb72, 0.0]
sd = [3, org.graalvm.compiler.truffle.runtime.FrameWithoutBoxing@21acff7a, expr=ConstantDoubleScalarNode@4670bb3d, 1.0]
Visibility = true
Frame(d=0): (called as: )
FunctionEvalCallNode-argsIdentifier = null
FunctionEvalCallNode-funIdentifier = null
Visibility = true
.Random.seed = active binding
RExplicitCall-argsIdentifier = null
n = 16384.0

@steve-s
Copy link
Member

steve-s commented Feb 22, 2021

Caused by: java.lang.OutOfMemoryError

indeed not enough memory. I'll have to give the container and possibly also the JVM (via --vm.Xmx{Size}) more memory.

@rsettlage
Copy link
Author

Just to make sure,, I added this to the container run command -e -vm.Xmx{Size}

@steve-s
Copy link
Member

steve-s commented Mar 3, 2021

You need to pass it to the R command, example:

R --vm.Xmx8g

will set the max heap size to 8GB, which should be enough. Now the question is if you container will have 8GB of memory available, but then that's an issue of properly configuring the container/Docker.

@rsettlage
Copy link
Author

Ah, thanks. Do you have a suggestion for the docker side? I am doing this:

docker run -it --oom-kill-disable -m 18g ghcr.io/graalvm/graalvm-ce:21.0.0 bash

and still getting the killed message for the process inside the container. At least it isn't erring as before!

@steve-s
Copy link
Member

steve-s commented Mar 3, 2021

This documentation: https://docs.docker.com/config/containers/resource_constraints tells me that you probably need something like

docker run --memory=8g -it --oom-kill-disable -m 18g ghcr.io/graalvm/graalvm-ce:21.0.0 bash

and then still run FastR with the --vm.Xmx8g flag. But I am not an expert on Docker :-)

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

No branches or pull requests

2 participants