Detailed description |
Apologies if this is a duplicate of one of the existing segfault reports, but for version 1.2-15 of Matrix, if I run:
set.seed(6860)
n <- 2669041L
ni <- 296236L
nj <- 54L
dat <- data.frame(i = structure(sample(seq_len(ni), size = n, replace = TRUE),
.Label = as.character(seq_len(ni)),
class = "factor"
),
j = structure(sample(seq_len(nj), size = n, replace = TRUE),
.Label = as.character(seq_len(nj)),
class = "factor"
)
)
X <- MatrixModels::model.Matrix(~0+i+j, data = dat, sparse = TRUE)
library(Matrix)
XtX <- crossprod(X)
# this segfaults!!!
rnk <- Matrix::rankMatrix(XtX, method = "qr")
then it gives:
*** caught segfault ***
address 0x7f597f74f26c, cause 'memory not mapped'
Traceback:
1: .Call(dgCMatrix_QR, x, if (verbose) -1L else TRUE, keep.dimnames)
2: .local(x, ...)
3: qr(as(as(as(x, "CsparseMatrix"), "dsparseMatrix"), "dgCMatrix"), ...)
4: qr(as(as(as(x, "CsparseMatrix"), "dsparseMatrix"), "dgCMatrix"), ...)
5: qr(if (do.t) t(x) else x, tol = tol, LAPACK = method != "qrLINPACK")
6: qr(if (do.t) t(x) else x, tol = tol, LAPACK = method != "qrLINPACK")
7: structure(if (useGrad) which.min(diff1) else if (Meth == "qr") { if ((do.t <- (d[1L] < d[2L])) && warn.t) warning(gettextf("rankMatrix(x, method='qr'): computing t(x) as nrow(x) < ncol(x)")) q.r <- qr(if (do.t) t(x) else x, tol = tol, LAPACK = method != "qrLINPACK") if (x.dense && (method == "qrLINPACK")) q.r$rank else { diagR <- if (x.dense) diag(q.r$qr) else diag(q.r@R) d.i <- abs(diagR) if ((mdi <- max(d.i)) > 0) sum(d.i >= tol * mdi) else 0L }} else if (sval[1] > 0) sum(sval >= tol * sval[1]) else 0L, method = method, useGrad = useGrad, tol = if (useGrad) NA else tol)
8: Matrix::rankMatrix(XtX, method = "qr")
An irrecoverable exception occurred. R is aborting now ...
Segmentation fault
|
|