I was using the spatsurv package in R and when compiling my code using R in the terminal on Debian GNU/Linux 8 (jessie), segmentation fault was returned and R was closed. After some debugging, I found out that the problem appears when using solve function. In addition, one of the authors of spatsurv package suggested me to test the same problem with each imported package. Then, after making that test, the problem was only with OpenStreetMap package.
library(OpenStreetMap)
x <- solve(diag(1, 1000))
# Segmentation fault
If I use the solve function before loading OpenStreetMap, I get the following:
x <- solve(diag(1, 1000))
library(OpenStreetMap)
x <- solve(diag(1, 1000))
# An irrecoverable stack overflow has occurred.
# Please check if any of your loaded .so files has enabled executable stack (see man page execstack(8))
# Error: segfault from C stack overflow
Information of my clean session is below:
R version 3.3.0 (2016-05-03)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 8 (jessie)
locale:
[1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_GB.UTF-8 LC_COLLATE=en_GB.UTF-8
[5] LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8
[7] LC_PAPER=en_GB.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
I would like to know how to solve this segmentation fault to be able to use spatsurv package.
Related
I am trying to run the some unconstrained optimization on a large problem on
a super computer, so I am trying to use the ucminf (although this problem
also works if I use the ucminf option in optimx). When I run any simple
optimization, I get the following message:
Error in .Call("mfopt", fnstr, grstr, rho, PACKAGE = "ucminf") :
"mfopt" not available for .Call() for package "ucminf"
For simplicity, here is a simple bit of test code that gives me the error.
library(ucminf)
test<-function(x){
(x-3)^2}
ucminf(0,test)
All of this works fine on my personal computer, but does not work on the
super computer. I have tried this on R/3.5.0 and R/3.3.0 on the super
computer and they both give me the same error.
Here is my Session info.
R version 3.5.0 (2018-04-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS release 6.9 (Final)
Matrix products: default
BLAS: /usr/public/R/3.5.0.gnu/lib64/R/lib/libRblas.so
LAPACK: /usr/public/R/3.5.0.gnu/lib64/R/lib/libRlapack.so
locale:
[1] LC_CTYPE=en_US.iso885915 LC_NUMERIC=C
[3] LC_TIME=en_US.iso885915 LC_COLLATE=en_US.iso885915
[5] LC_MONETARY=en_US.iso885915 LC_MESSAGES=en_US.iso885915
[7] LC_PAPER=en_US.iso885915 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.iso885915 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ucminf_1.0-5 numDeriv_2016.8-1
loaded via a namespace (and not attached):
[1] compiler_3.5.0
I have uninstalled and reinstalled the package using Rinstall('ucminf'). Does anyone have experience with this and how to fix it?
I am getting the following error every time I run a Cox model using the survival package in R. This error arose within the last few days. To illustrate the error, I am using a standard example command which is given at https://stat.ethz.ch/R-manual/R-devel/library/survival/html/coxph.html:
# Fit a stratified model, clustered on patients
library(survival)
bladder1 <- bladder[bladder$enum < 5, ]
coxph(Surv(stop, event) ~ (rx + size + number) * strata(enum) +
cluster(id), bladder1)
The error I get is as follows:
Error in fitter(X, Y, strats, offset, init, control, weights = weights, :
object 'Ccoxmart' not found
I am using latest version of R [3.4.0 (2017-04-21) -- "You Stupid Darkness"].
I have tried to consult the survival package manual for R and researched on the internet. I am grateful for any resource or solution you may recommend.
I can confirm this error. It's definitely something to do with the update from R 3.3.3 (Another Canoe) -> R 3.4.0 (You Stupid Darkness). All unit tests in my system working correctly on Friday, broken Monday.
In addition, I'm also having an issue with "Ccoxph_wtest" not being found. Must be a similar issue.
I'll start debugging later today and let you know what I find, but for now if you have to get back up and running, I'd suggest reverting to R v3.3.3 (Another Canoe). I have rerun all my unit tests using v3.3.3 and all is fine.
Here is the sessionInfo():
R version 3.3.3 (2017-03-06)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.2 LTS
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets base
R version 3.4.0 (2017-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.2 LTS
Matrix products: default
BLAS: /usr/lib/atlas-base/atlas/libblas.so.3.0
LAPACK: /usr/lib/atlas-base/atlas/liblapack.so.3.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets base
loaded via a namespace (and not attached):
[1] compiler_3.4.0
My solution was to re-install the survival package. Just install it right on top of the original. install.packages("survival").
You have to re-install packages that use C or Fortran in R 3.4.0:
update.packages(checkBuild=TRUE)
See this post
Packages which register native routines for .C or .Fortran need
to be re-installed for this version (unless installed with
R-devel SVN revision r72375 or later)
Whenever I run lmer or glmer from lme4 package, I get the following error:
Error in '/usr/lib/rstudio/bin/rsession' : malloc(): memory
corruption:
I update all R packages but still getting the same error.
sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: i686-pc-linux-gnu (32-bit)
Running under: Ubuntu 16.04.2 LTS
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] lme4_1.1-13 Matrix_1.2-8
loaded via a namespace (and not attached):
[1] minqa_1.2.4 MASS_7.3-45 tools_3.3.2 Rcpp_0.12.9 splines_3.3.2
[6] nlme_3.1-131 grid_3.3.2 nloptr_1.0.4 lattice_0.20-34
Edited
library(lme4)
fm1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
Throws the following error:
Error in '/usr/lib/rstudio/bin/rsession' : malloc(): memory
corruption:
There have been reports of problems with the latest Matrix package, 1.2-8, on 32-bit OS's (personal communication from Terry Therneau and Brian Ripley). A fix is probably on its way may take a while (personal communication, M. Maechler), so I would try downgrading Matrix to version 1.2-7, e.g. devtools::install_version("Matrix","1.2-7") (you'll need to have compilation tools installed).
Looking at the NEWS file for Matrix, I suspect this has something to do with:
C-API: SuiteSparse_long is now defined as int64_t on all platforms, and we now include (C99) ‘inttypes.h’
In the time the problem has been diagnosed and solved by me (the maintainer of Matrix):
Matrix 1.2-8 had updated its API, but RcppEigen had copied part of Matrix's C API (headers etc)... and now was no longer compatible... on 32-bit only.
In the mean time, RcppEigen has been updated (and Matrix too).
Please install the latest versions of these two and all such lme4 problems should be gone.
May have been an issue with Ubuntu update. I had the same issue, but after the latest update to Ubuntu base the problem was fixed.
I recently installed rSymPy to perform some symbolic calculations in R. This step also installed some dependencies (“rJava”, “rjson” and “rJython”). After the installation was complete, I loaded the library and ran a very simple command which gave me an error:
> library("rSymPy")
Loading required package: rJython
Loading required package: rJava
Loading required package: rjson
> x <- Var("x")
Error in .jcheck() : No running JVM detected. Maybe .jinit() would help.
Here is my sessionInfo(), just in case you need it:
> sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS release 6.7 (Final)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] rSymPy_0.2-1.1 rJython_0.0-4 rjson_0.2.15 rJava_0.9-8
loaded via a namespace (and not attached):
[1] tools_3.2.2 tcltk_3.2.2
I have tried to install different versions of required packages, but I always get this error. I would really appreciate any help.
Thanks,
Aashish
Thanks to Gabor Grothendieck (developer of rSymPy) for pointing out that sometimes one needs to manually initialize JVM. One can simply use "sympyStart()" at the beginning of the code, and that fixes the error.
I have compiled R version 2.12.1 (2010-12-16) for my system (CentOS), and afterwards I installed Cairo_1.4-5.
I'd like use Cairo to produce PNG (and maybe PDF) output of my graphs when I batch-invoke my scripts, but this gives me difficulties when I am using X (I am tunneling X through ssh and it often disconnects while the R scripts are running...), so this is why I want to use Cairo.
(I do not have root access btw).
Although it's installed according to sessionInfo
> sessionInfo()
R version 2.12.1 (2010-12-16)
Platform: x86_64-unknown-linux-gnu (64-bit)
locale:
[1] C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
I can not call CairoPDF:
> CairoPDF()
Error: could not find function "CairoPDF"
Weirdly, I can invoke a function called cairo_pdf
> cairo_pdf()
>
I can not call CairoPNG, cairo_PNG or cairo_png:
> CairoPNG()
Error: could not find function "CairoPNG"
> cairo_PNG()
Error: could not find function "cairo_PNG"
> cairo_png()
Error: could not find function "cairo_png"
Is something wrong withmy installation? Frankly I have no idea how to proceed from here, why can't I even call CairoPNG()?
On Ubuntu I have:
> sessionInfo()
R version 2.12.1 (2010-12-16)
Platform: i486-pc-linux-gnu (32-bit)
locale:
[1] LC_CTYPE=af_ZA.utf8 LC_NUMERIC=C
[3] LC_TIME=af_ZA.utf8 LC_COLLATE=af_ZA.utf8
[5] LC_MONETARY=C LC_MESSAGES=af_ZA.utf8
[7] LC_PAPER=af_ZA.utf8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=af_ZA.utf8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
Then run library(Cairo), if this is not installed
library(Cairo)
Error in library(Cairo) : there is no package called 'Cairo'
This means you will have to install the Cairo R package, which interfaces with the Cairo graphics system
> install.packages('Cairo')
It will download, build and install the package - you don't need root for this
If it was successful, you can run
>library(Cairo)
>sessionInfo()
R version 2.12.1 (2010-12-16)<br>
Platform: i486-pc-linux-gnu (32-bit)
locale:
[1] LC_CTYPE=af_ZA.utf8 LC_NUMERIC=C
[3] LC_TIME=af_ZA.utf8 LC_COLLATE=af_ZA.utf8
[5] LC_MONETARY=C LC_MESSAGES=af_ZA.utf8
[7] LC_PAPER=af_ZA.utf8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=af_ZA.utf8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] Cairo_1.4-5
HTH
This should do:
install.packages("Cairo")
library(Cairo)