Ian Erickson
2017-Jan-18 22:54 UTC
[R-sig-Debian] Taking determinant of a matrix of NAs results in intermittent memory corruption
Greetings; I've posted the following to R's bug tracking system (at https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17210 ) and Martin Maechler requested that I post to this list as well. If I start R from the command line with --vanilla, then repeatedly execute the following line: det(matrix(nrow=10,ncol=10)) ... I eventually get a crash, with error: *** Error in `/usr/lib/R/bin/exec/R': malloc(): memory corruption: 0x0000000002399400 *** The specific address in memory that is referenced varies. The number of times I need to execute the above line before getting a crash also varies. This occurs with a wide range of matrix dimensions; 10x10 is not the only size that causes this issue. output of R.version: platform x86_64-pc-linux-gnu arch x86_64 os linux-gnu system x86_64, linux-gnu status major 3 minor 3.2 year 2016 month 10 day 31 svn rev 71607 language R version.string R version 3.3.2 (2016-10-31) nickname Sincere Pumpkin Patch I am running Linux Mint 17.3; my CPU is an Intel Core i7-2620m (Sandy Bridge). My RAM is non-ECC. My R binary is from the CRAN Ubuntu repository at cran.cnr.berkeley.edu . (r-base and r-base-core versions 3.3.2-1trusty0 ) I also see this issue running R within Emacs, as well as Rstudio. This issue may be related to https://bugs.r-project.org/bugzilla/show_bug.cgi?id=16862 but I'm not certain. The output of La_version() for me is: [1] "3.5.0" The output of: system(paste("lsof -p", Sys.getpid(), "| grep -iE '(blas|lapack)'")) is: R 3636 <myusername> mem REG 252,0 39272 11930369 /usr/lib/R/modules/lapack.so R 3636 <myusername> mem REG 252,0 5882272 11933488 /usr/lib/lapack/liblapack.so.3.0 R 3636 <myusername> mem REG 252,0 23108112 11929607 /usr/lib/openblas-base/libopenblas.so.0 Is anyone able to reproduce? Thanks, --Ian
Rolf Turner
2017-Jan-18 23:10 UTC
[R-sig-Debian] [FORGED] Taking determinant of a matrix of NAs results in intermittent memory corruption
On 19/01/17 11:54, Ian Erickson wrote:> Greetings; I've posted the following to R's bug tracking system (at https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17210 ) and Martin Maechler requested that I post to this list as well. > If I start R from the command line with --vanilla, then repeatedly execute the following line: > > det(matrix(nrow=10,ncol=10)) > > ... I eventually get a crash, with error: > > *** Error in `/usr/lib/R/bin/exec/R': malloc(): memory corruption: 0x0000000002399400 *** > > The specific address in memory that is referenced varies. The number of times I need to execute the above line before getting a crash also varies. > > This occurs with a wide range of matrix dimensions; 10x10 is not the only size that causes this issue. > > output of R.version: > platform x86_64-pc-linux-gnu > arch x86_64 > os linux-gnu > system x86_64, linux-gnu > status > major 3 > minor 3.2 > year 2016 > month 10 > day 31 > svn rev 71607 > language R > version.string R version 3.3.2 (2016-10-31) > nickname Sincere Pumpkin Patch > > I am running Linux Mint 17.3; my CPU is an Intel Core i7-2620m (Sandy Bridge). My RAM is non-ECC. My R binary is from the CRAN Ubuntu repository at cran.cnr.berkeley.edu . (r-base and r-base-core versions 3.3.2-1trusty0 ) > > I also see this issue running R within Emacs, as well as Rstudio. > > This issue may be related to https://bugs.r-project.org/bugzilla/show_bug.cgi?id=16862 but I'm not certain. > > The output of La_version() for me is: > [1] "3.5.0" > > The output of: > system(paste("lsof -p", Sys.getpid(), "| grep -iE '(blas|lapack)'")) > is: > R 3636 <myusername> mem REG 252,0 39272 11930369 /usr/lib/R/modules/lapack.so > R 3636 <myusername> mem REG 252,0 5882272 11933488 /usr/lib/lapack/liblapack.so.3.0 > R 3636 <myusername> mem REG 252,0 23108112 11929607 /usr/lib/openblas-base/libopenblas.so.0 > Is anyone able to reproduce?I can't. I tried for(i in 1:100000) det(matrix(nrow=10,ncol=10)) and got no crash. I am running Ubuntu 16.04 (with Mate Desktop 1.12.1, if that matters). Output of sessionInfo(): R version 3.3.2 (2016-10-31) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 16.04.1 LTS locale: [1] LC_CTYPE=en_NZ.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_NZ.UTF-8 LC_COLLATE=en_NZ.UTF-8 [5] LC_MONETARY=en_NZ.UTF-8 LC_MESSAGES=en_NZ.UTF-8 [7] LC_PAPER=en_NZ.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_NZ.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] misc_0.0-16 loaded via a namespace (and not attached): [1] deldir_0.1-13 Matrix_1.2-7.1 tools_3.3.2 [4] mgcv_1.8-15 abind_1.4-5 spatstat_1.48-0.010 [7] rpart_4.1-10 nlme_3.1-128 grid_3.3.2 [10] polyclip_1.5-6 lattice_0.20-34 goftest_1.0-3 [13] tensor_1.5 cheers, Rolf Turner -- Technical Editor ANZJS Department of Statistics University of Auckland Phone: +64-9-373-7599 ext. 88276
Dirk Eddelbuettel
2017-Jan-18 23:19 UTC
[R-sig-Debian] Taking determinant of a matrix of NAs results in intermittent memory corruption
On 18 January 2017 at 22:54, Ian Erickson wrote: | Greetings; I've posted the following to R's bug tracking system (at https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17210 ) and Martin Maechler requested that I post to this list as well. | If I start R from the command line with --vanilla, then repeatedly execute the following line: | | det(matrix(nrow=10,ncol=10)) That is not reproducible code. While you a matrix with dimensions, you do not have content in it. Did you mean something like set.seed(42) # or any other seed det(matrix(rnorm(100), nrow=10, ncol=10)) Ok now I looked at your example in the BTS. You meant det(matrix( , nrow=10, ncol=10)) and I just don't know how meaningful that is. It is random input. Sure, R should never die... But just like Martin Maechler, I can run r -e 'for(i in 1:100000) { d <- det(matrix(, 10,10)); stopifnot(identical(d, NA_real_)) }; cat("Alive\n")' just fine on two different machines (which both happen to Ubuntu 16.04 using OpenBLAS). | ... I eventually get a crash, with error: | | *** Error in `/usr/lib/R/bin/exec/R': malloc(): memory corruption: 0x0000000002399400 *** | | The specific address in memory that is referenced varies. The number of times I need to execute the above line before getting a crash also varies. | | This occurs with a wide range of matrix dimensions; 10x10 is not the only size that causes this issue. | | output of R.version: | platform x86_64-pc-linux-gnu | arch x86_64 | os linux-gnu | system x86_64, linux-gnu | status | major 3 | minor 3.2 | year 2016 | month 10 | day 31 | svn rev 71607 | language R | version.string R version 3.3.2 (2016-10-31) | nickname Sincere Pumpkin Patch | | I am running Linux Mint 17.3; my CPU is an Intel Core i7-2620m (Sandy Bridge). My RAM is non-ECC. My R binary is from the CRAN Ubuntu repository at cran.cnr.berkeley.edu . (r-base and r-base-core versions 3.3.2-1trusty0 ) | | I also see this issue running R within Emacs, as well as Rstudio. | | This issue may be related to https://bugs.r-project.org/bugzilla/show_bug.cgi?id=16862 but I'm not certain. | | The output of La_version() for me is: | [1] "3.5.0" | | The output of: | system(paste("lsof -p", Sys.getpid(), "| grep -iE '(blas|lapack)'")) | is: | R 3636 <myusername> mem REG 252,0 39272 11930369 /usr/lib/R/modules/lapack.so | R 3636 <myusername> mem REG 252,0 5882272 11933488 /usr/lib/lapack/liblapack.so.3.0 | R 3636 <myusername> mem REG 252,0 23108112 11929607 /usr/lib/openblas-base/libopenblas.so.0 | Is anyone able to reproduce? I cannot as stated above. Try one of the other blas implementations. On a .deb-based system, this is just a an apt-get way. I keep forgetting whether atlas has higher priority than openblas but you know enough to check this. Dirk | Thanks, | | --Ian | | _______________________________________________ | R-SIG-Debian mailing list | R-SIG-Debian at r-project.org | https://stat.ethz.ch/mailman/listinfo/r-sig-debian -- http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
Klint Gore
2017-Jan-18 23:38 UTC
[R-sig-Debian] Taking determinant of a matrix of NAs results in intermittent memory corruption
-----Original Message----- From: R-SIG-Debian [mailto:r-sig-debian-bounces at r-project.org] On Behalf Of Rolf Turner Sent: Thursday, 19 January 2017 10:11 AM To: Ian Erickson Cc: r-sig-debian at r-project.org Subject: Re: [R-sig-Debian] [FORGED] Taking determinant of a matrix of NAs results in intermittent memory corruption>On 19/01/17 11:54, Ian Erickson wrote: >> Greetings; I've posted the following to R's bug tracking system (at https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17210 ) and Martin Maechler requested that I post to this list as well. >> If I start R from the command line with --vanilla, then repeatedly execute the following line: >> >> det(matrix(nrow=10,ncol=10)) >> >> ... I eventually get a crash, with error: >> >> *** Error in `/usr/lib/R/bin/exec/R': malloc(): memory corruption: >> 0x0000000002399400 *** >> >> Is anyone able to reproduce? > >I can't. I tried > >for(i in 1:100000) det(matrix(nrow=10,ncol=10))I can. It's repeatable as well. CPU is Intel Xeon E5-2630v3 Ubuntu 14.04.5 LTS R from deb http://cran.r-project.org/bin/linux/ubuntu trusty/ R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch" Copyright (C) 2016 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.> La_version()[1] "3.5.0"> system(paste("lsof -p", Sys.getpid(), "| grep -iE '(blas|lapack)'"))R 25596 kgore4 mem REG 8,4 39272 118292573 /usr/lib/R/modules/lapack.so R 25596 kgore4 mem REG 8,4 5882272 118096040 /usr/lib/lapack/liblapack.so.3.0 R 25596 kgore4 mem REG 8,4 23058832 118129172 /usr/lib/openblas-base/libblas.so.3> det(matrix(nrow=10,ncol=10))[1] NA> det(matrix(nrow=10,ncol=10))[1] NA> det(matrix(nrow=10,ncol=10))[1] NA> det(matrix(nrow=10,ncol=10))[1] NA> det(matrix(nrow=10,ncol=10))*** Error in `/usr/lib/R/bin/exec/R': malloc(): memory corruption: 0x0000000001393090 *** Aborted (core dumped) It doesn't seem to matter what happens after the 4th execution it throws it out. Eg I just started mashing the keyboard Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.> det(matrix(nrow=10,ncol=10))[1] NA> det(matrix(nrow=10,ncol=10))[1] NA> det(matrix(nrow=10,ncol=10))[1] NA> det(matrix(nrow=10,ncol=10))[1] NA> sdfsdfjkjsdhfkjsdhfk*** Error in `/usr/lib/R/bin/exec/R': malloc(): memory corruption: 0x00000000025c4090 ***Aborted (core dumped) _______________________________________________ R-SIG-Debian mailing list R-SIG-Debian at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-debian
Seemingly Similar Threads
- [FORGED] Taking determinant of a matrix of NAs results in intermittent memory corruption
- Taking determinant of a matrix of NAs results in intermittent memory corruption
- Taking determinant of a matrix of NAs results in intermittent memory corruption
- Determinant function (PR#9715)
- plotmath degree symbol