Skip to content

Lapack or Blas crashing R when using "large" matrices (Ubuntu 11.04)

3 messages · Matias Salibian-Barrera, Dirk Eddelbuettel

#
Hello,


This simple SVD calculation (commands are copied immediately below) crashes on my Ubuntu machine (R 2.13.0). However it 
worked fine with R.12 and Ubuntu 10.04, and it also works fine on my Windows 7 machine with R 2.13, so I suspect there's a problem with (my?) Ubuntu and / or R. 

I'm using the R distribution that is accessible with Ubuntu's repositories manager, I am not building my own. 

Can anybody else reproduce it (with Ubuntu 11.04)? Thanks in advance. 

Matias

p <- 500
n <- 300
set.seed(1234)
x <- matrix(rnorm(n*p), n, p)
sih <- var(x)
b <- svd(sih)

produces:
?
?*** caught illegal operation ***
address 0x42b8c9, cause 'illegal operand'

Traceback:
?1: .Call("La_svd", jobu, jobv, x, double(min(n, p)), u, v,? "dgsedd",???? PACKAGE = "base")
?2: La.svd(x, nu, nv)
?3: svd(sih)
?
I'm using Ubuntu 11.04 and
??????????????? _??????????????????????????? 
?platform?????? i686-pc-linux-gnu??????????? 
?arch?????????? i686???????????????????????? 
?os???????????? linux-gnu??????????????????? 
?system???????? i686, linux-gnu????????????? 
?status????????????????????????????????????? 
?major????????? 2??????????????????????????? 
?minor????????? 13.0???????????????????????? 
?year?????????? 2011???????????????????????? 
?month????????? 04?????????????????????????? 
?day??????????? 13?????????????????????????? 
?svn rev??????? 55427??????????????????????? 
?language?????? R??????????????????????????? 
?version.string R version 2.13.0 (2011-04-13)
?
?Thanks,
?
?Matias
#
Works fine here (Ubuntu 11.04, R 2.13.0 from CRAN):

edd at max:~$ cat /tmp/matias.r 
p <- 500
n <- 300
set.seed(1234)
x <- matrix(rnorm(n*p), n, p)
sih <- var(x)
b <- svd(sih)

cat("All good\n")
edd at max:~$ r /tmp/matias.r 
All good
edd at max:~$ 

Maybe you have the wrong atlas package installed?  What does this yield for
you:

edd at max:~$ dpkg -l | grep "atlas\|blas"
ii  gotoblas2-helper                 0.1-12.local.1                   GotoBLAS2 helper
ii  libatlas-headers                 3.6.0-24ubuntu1                  Automatically Tuned Linear Algebra Software,C header files
ii  libatlas3gf-base                 3.8.3-29                         Automatically Tuned Linear Algebra Software, generic shared
ii  libblas-dev                      1.2-8                            Basic Linear Algebra Subroutines 3, static library
ii  libblas-test                     1.2-8                            Basic Linear Algebra Subroutines 3, testing programs
ii  libblas3gf                       1.2-8                            Basic Linear Algebra Reference implementations, shared library
edd at max:~$ 

showing that I use the standard Atlas package from Ubuntu.

Dirk
#
Thanks Dirk. I'm far from a linux power user.

I re-installed the atlas and blas packages, and I removed and re-installed R 2.13 from cran.


Checking for the installed atlas package gives:

matias at tukey:~$ dpkg -l | grep "atlas\|blas"
ii? libatlas-base-dev?????? 3.8.3-29????????? Automatically Tuned Linear Algebra Software, generic static
ii? libatlas-dev??????????????? 3.8.3-29???????? Automatically Tuned Linear Algebra Software, C header files
ii? libatlas-test??????????????? 3.8.3-29???????? Automatically Tuned Linear Algebra Software, test programs
ii? libatlas3gf-base????????? 3.8.3-29???????? Automatically Tuned Linear Algebra Software, generic shared
ii? libblas-dev???????????????? 1.2-8????????????? Basic Linear Algebra Subroutines 3, static library
ii? libblas-test???????????????? 1.2-8????????????? Basic Linear Algebra Subroutines 3, testing programs
ii? libblas3gf?????????????????? 1.2-8????????????? Basic Linear Algebra Reference implementations, shared library


So it seems everything is fine, but the call to svd() in R still produces:
?*** caught illegal operation ***
address 0x8398c9, cause 'illegal operand'

Traceback:
?1: .Call("La_svd", jobu, jobv, x, double(min(n, p)), u, v, "dgsedd",???? PACKAGE = "base")
?2: La.svd(x, nu, nv)
?3: svd(sih)

This time, though I also got some more information on the crash:

*** longjmp causes uninitialized stack frame ***: /usr/lib/R/bin/exec/R terminated
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(__fortify_fail+0x50)[0x527df0]
/lib/i386-linux-gnu/libc.so.6(+0xe5d5a)[0x527d5a]
/usr/lib/R/lib/libR.so(+0x1cd6fe)[0x2dd6fe]
[0xfd2400]
/usr/lib/libblas.so.3gf(ATL_join_tree+0x4c)[0x72c34c]

I really don't know what's behind this. Any help / or further pointer would be much appreciated.

Matias






----- Original Message -----