我最近发现,在大型矩阵 (109865 x 414) 上使用基本 SVD 函数会导致 RStudio 1.3.1073 崩溃(在具有 32GB RAM 的 macOS 10.15.6 上运行 R 4.0.2)。在终端中运行相同的代码会出现以下错误:
*** 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'
对 109865 x 414 随机值矩阵执行 SVD 时不会出现错误。在另一台计算机上的相同原始矩阵上运行相同代码(在具有 8 GB RAM 的 macOS 10.15.4 上运行 R 4.0.0)按预期执行 SVD,无需抛出一个错误。较新的 R 安装在其他方面已经完全稳定。
所以,诚然,这是一种超具体的、可能不可重现的问题,但是对于导致此错误的原因有什么想法吗?有问题的矩阵已作为 R 数据文件上传 here .
谢谢!
最佳答案
这可能与 R 的自制安装有关。完全删除 R 和所有软件包,然后使用 CRAN 的最新版本手动重新安装后,代码成功运行。
关于r - R 4.02 中大矩阵的 SVD 总线错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63595761/