Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bus error with SVD of large matrix in R 4.02

I recently discovered that using the base SVD function on a large matrix (109865 x 414) was causing RStudio 1.3.1073 to crash (running R 4.0.2 on macOS 10.15.6 with 32GB RAM). Running the same code in terminal provided the following error:

*** caught bus error *** address 0x1195ed000, cause 'non-existent physical address'

Traceback: 1: La.svd(x, nu, nv) 2: svd(problemMatrix) An irrecoverable exception occurred. R is aborting now ...

*** caught bus error *** address 0x11d604000, cause 'non-existent physical address'

Traceback: 1: La.svd(x, nu, nv) 2: svd(problemMatrix) An irrecoverable exception occurred. R is aborting now ...

*** caught segfault *** address 0x1297b9000, cause 'memory not mapped'

No error is given when performing SVD on a 109865 x 414 matrix of random values. Running the same code on the same original matrix on a different computer (running R 4.0.0 on macOS 10.15.4 with 8 GB RAM) performs the SVD as expected, without throwing an error. The newer R installation has otherwise been completely stable.

So, admittedly a sort of hyperspecific, potentially non-reproducible question, but any thoughts on what might be responsible for this error? Problematic matrix uploaded as an R data file here.

Thanks!

like image 858
Nicholas Bock Avatar asked Dec 14 '25 04:12

Nicholas Bock


1 Answers

This may have related to the homebrew installation of R. The code ran successfully after completely removing R and all packages and then reinstalling manually with the latest release from CRAN.

like image 117
Nicholas Bock Avatar answered Dec 16 '25 18:12

Nicholas Bock



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!