2

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:

halfer
  • 19,824
  • 17
  • 99
  • 186
MYaseen208
  • 22,666
  • 37
  • 165
  • 309
  • Can you use lme4 at all? Do the problems persist from the terminal (outside of rstudio)? – user20650 Feb 21 '17 at 18:07
  • Yes, I can load `lme4` library and can get help both in `RStudio` and `Terminal`. The error appears in the `Terminal` too. – MYaseen208 Feb 21 '17 at 18:11
  • I would reinstall the libc package in your Ubuntu Terminal. – J_F Mar 07 '17 at 13:25
  • Thanks @J_F for your comment. I used `sudo apt-get update && sudo apt-get install libc6-dev` to update `libc. However, the problem still persist. Any thoughts. – MYaseen208 Mar 08 '17 at 06:46
  • This is not a question but a bug report. Please submit it to the appropriate place, i.e., the lme4 bug tracker. You might want to show a minimal example too. PS: Why do you use a 32-bit OS? – Roland Mar 08 '17 at 08:03
  • 1
    there have been reports of problems with the latest `Matrix` package on 32-bit OS's. Can you try *downgrading* Matrix? – Ben Bolker Mar 08 '17 at 13:20
  • Thanks @BenBolker for your useful comment. I downgraded Matrix and every thing works fine. Would appreciate if you change your comment to answer for future reference. Thanks – MYaseen208 Mar 08 '17 at 13:39

3 Answers3

4

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’
halfer
  • 19,824
  • 17
  • 99
  • 186
Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
  • Yes, this had something to do with the API change (which also was needed for things to work correctly on some 32bit platforms !!) as we (Dirk and I, maintainers of `RcppEigen` and `Matrix` respectively) had not been aware that `RcppEigen` has a header file which had been more or less copy-pasted from Matrix... and that part had now become outdated and in conflict (on 32-bit Windows at least). Do update the 2 packages to the latest version – Martin Mächler Apr 01 '17 at 16:18
  • Can you give recommended package versions (i.e. everything should be OK if you have `Matrix` >= 1.2.8 and `RcppEigen` >= 0.3.2.9.1 ?) – Ben Bolker Apr 01 '17 at 16:29
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.

Martin Mächler
  • 4,619
  • 27
  • 27
0

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.