问题
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:
回答1:
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’
回答2:
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.
回答3:
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.
来源:https://stackoverflow.com/questions/42374635/r-lme4-error-in-usr-lib-rstudio-bin-rsession-malloc-memory-corruption