[R-sig-Debian] Taking determinant of a matrix of NAs results in intermittent memory corruption

Klint Gore kgore4 at une.edu.au
Thu Jan 19 00:38:54 CET 2017


-----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



More information about the R-SIG-Debian mailing list