rjava dependent package installation Segmentation fault (core dumped)

旧巷老猫 提交于 2019-12-18 12:38:45

问题


I am trying to reinstall a package that I was previously able to install and use. I was building a package of my own after my computer unexpectedly restarted and then I started to have problems loading the rpgraph package. So I decided to uninstall it and to reinstall it. When I did so I got the following error:

library(devtools)

library(rJava)
install_github("Albluca/rpgraph")


Downloading GitHub repo Albluca/rpgraph@master
from URL https://api.github.com/repos/Albluca/rpgraph/zipball/master
Installing rpgraph
Running command /usr/lib/R/bin/R
Arguments:
CMD
INSTALL
/tmp/Rtmp5OrtLL/devtools505a703b3ccd/Albluca-rpgraph-de04f96
--library=/home/gonzalo/R/x86_64-pc-linux-gnu-library/3.4
--install-tests

installing source package ‘rpgraph’ ...
** 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
Segmentation fault (core dumped)
ERROR: loading failed
removing ‘/home/gonzalo/R/x86_64-pc-linux-gnu-library/3.4/rpgraph’
Installation failed: run(bin, args = real_cmdargs,         stdout_line_callback = real_callback(stdout), stderr_line_callback =     real_callback(stderr), stdout_callback = real_block_callback,     stderr_callback = real_block_callback, echo_cmd = echo, echo = show,     spinner = spinner, error_on_status = fail_on_status, timeout = timeout) :     System command error`

I tried reinstalling JAva and cran from zero but somehow there is something that remains in my system that avoids the package to be installed. Also, since the error is not very informative, I have no idea on how to narrow where the problem is.

Thanks for any help you can provide.


回答1:


I experienced the same problem while installing the libraries vanneuler and wordnet and solved the issue using the solution proposed by Kenneth. In my case the option -Xss2560k was enough to solve:

export _JAVA_OPTIONS="-Xss2560k"

In addition: instead of running the export command from the terminal the java option can be set directly from the R session with the following command:

options(java.parameters = "-Xss2560k")




回答2:


This seems to be a bug in recent kernel versions, the same problem happens with other R libraries that involve Java, and also other software.

See https://lists.ubuntu.com/archives/ubuntu-devel-discuss/2017-June/017507.html and https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1698919.

This workaround does the trick for me:

export _JAVA_OPTIONS="-Xss2560k -Xmx2g"


来源:https://stackoverflow.com/questions/44682540/rjava-dependent-package-installation-segmentation-fault-core-dumped

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!