Running ‘spelling.R’
  Running ‘testthat.R’ [190s/187s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(bigsnpr)
  Loading required package: bigstatsr
  > 
  > test_check("bigsnpr", filter = "7-")
  ── 1. Failure: parallel bed_prodVec() works (@test-7-OpenMP.R#39)  ─────────────
  all(sapply(test, all.equal, current = true)) isn't true.
  
  
   *** caught segfault ***
  address f8660ffc, cause 'invalid permissions'
  
   *** caught segfault ***
  address f8660ffc, cause 'invalid permissions'
  
  Traceback:
   1: clumping_chr_cached(G, keep, spcor.chr, spInd = ind.sp.grp, rowInd = ind.row,     colInd = ind.chr.grp, ordInd = ord.chr.grp, rankInd = rank.chr.grp,     pos = pos.chr.grp, sumX = sumX.chr.grp, denoX = deno.chr.grp,     size = 1000 * base.size.clmp/thr.clmp, thr = thr.clmp, ncores = ncores)
   2: FUN(X[[i]], ...)
   3: lapply(split(ind.noexcl, infos.chr[ind.noexcl]), function(ind.chr) {    ind.keep <- list()    info.chr <- infos.imp[ind.chr]    S.chr <- lpS[ind.chr]    pos.chr <- infos.pos[ind.chr]    stats <- snp_colstats(G, ind.row, ind.chr, ncores)    sumX.chr <- stats$sumX    denoX.chr <- stats$denoX    spcor.chr <- sparseMatrix(i = integer(), j = integer(), x = double(),         dims = rep(length(ind.chr), 2))    assert_sorted(pos.chr)    for (thr.imp in THR_IMP) {        ind <- which(info.chr >= thr.imp)        ind.chr <- ind.chr[ind]        spcor.chr <- spcor.chr[ind, ind, drop = FALSE]        info.chr <- info.chr[ind]        pos.chr <- pos.chr[ind]        S.chr <- S.chr[ind]        sumX.chr <- sumX.chr[ind]        denoX.chr <- denoX.chr[ind]        for (group in groups) {            ind2 <- which(ind.chr %in% group)            if (length(ind2) == 0) {                for (thr.clmp in THR_CLMP) {                  for (base.size.clmp in BASE_SIZE_CLMP) {                    ind.keep[[length(ind.keep) + 1L]] <- integer()                  }                }            }            else {                ind.sp.grp <- ind2 - 1L                ind.chr.grp <- ind.chr[ind2]                ord.chr.grp <- order(S.chr[ind2], decreasing = TRUE)                rank.chr.grp <- match(seq_along(ord.chr.grp),                   ord.chr.grp)                pos.chr.grp <- pos.chr[ind2]                sumX.chr.grp <- sumX.chr[ind2]                deno.chr.grp <- denoX.chr[ind2]                keep <- FBM(1, length(ind.chr.grp), type = "integer")                for (thr.clmp in THR_CLMP) {                  for (base.size.clmp in BASE_SIZE_CLMP) {                    keep[] <- -1                    spcor.chr <- clumping_chr_cached(G, keep,                       spcor.chr, spInd = ind.sp.grp, rowInd = ind.row,                       colInd = ind.chr.grp, ordInd = ord.chr.grp,                       rankInd = rank.chr.grp, pos = pos.chr.grp,                       sumX = sumX.chr.grp, denoX = deno.chr.grp,                       size = 1000 * base.size.clmp/thr.clmp,                       thr = thr.clmp, ncores = ncores)                    stopifnot(all(keep[] %in% 0:1))                    ind.keep[[length(ind.keep) + 1L]] <- ind.chr.grp[keep[] ==                       1]                  }                }            }        }    }    ind.keep})
   4: snp_grid_clumping(G, ind.row = rows, lpS = lpS, ncores = 2, infos.chr = rep(1,     ncol(G)), infos.pos = cols_along(G), grid.base.size = 0.1,     grid.thr.r2 = c(0.05, 0.5))
   5: FUN(X[[i]], ...)
   6: lapply(X = X, FUN = FUN, ...)
   7: sapply(integer(n), eval.parent(substitute(function(...) expr)),     simplify = simplify)
   8: replicate(5, simplify = FALSE, {    snp_grid_clumping(G, ind.row = rows, lpS = lpS, ncores = 2,         infos.chr = rep(1, ncol(G)), infos.pos = cols_along(G),         grid.base.size = 0.1, grid.thr.r2 = c(0.05, 0.5))})
   9: eval(code, test_env)
  10: eval(code, test_env)
  11: withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error)
  12: doTryCatch(return(expr), name, parentenv, handler)
  13: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  14: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  15: doTryCatch(return(expr), name, parentenv, handler)
  16: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  17: tryCatchList(expr, classes, parentenv, handlers)
  18: tryCatch(withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error), error = handle_fatal,     skip = function(e) {    })
  19: test_code(desc, code, env = parent.frame())
  20: test_that("parallel snp_grid_clumping() works", {    G <- snp_attachExtdata()$genotypes    rows <- sample(nrow(G), replace = TRUE)    lpS <- runif(ncol(G))    test <- replicate(5, simplify = FALSE, {        snp_grid_clumping(G, ind.row = rows, lpS = lpS, ncores = 2,             infos.chr = rep(1, ncol(G)), infos.pos = cols_along(G),             grid.base.size = 0.1, grid.thr.r2 = c(0.05, 0.5))    })    true <- snp_grid_clumping(G, ind.row = rows, lpS = lpS, ncores = 1,         infos.chr = rep(1, ncol(G)), infos.pos = cols_along(G),         grid.base.size = 0.1, grid.thr.r2 = c(0.05, 0.5))    expect_true(all(sapply(test, identical, y = true)))})
  21: eval(code, test_env)
  22: eval(code, test_env)
  23: withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error)
  24: doTryCatch(return(expr), name, parentenv, handler)
  25: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  26: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  27: doTryCatch(return(expr), name, parentenv, handler)
  28: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  29: tryCatchList(expr, classes, parentenv, handlers)
  30: tryCatch(withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error), error = handle_fatal,     skip = function(e) {    })
  31: test_code(NULL, exprs, env)
  32: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  33: force(code)
  34: doWithOneRestart(return(expr), restart)
  35: withOneRestart(expr, restarts[[1L]])
  36: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  37: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter,     {        reporter$start_file(basename(path))        lister$start_file(basename(path))        source_file(path, new.env(parent = env), chdir = TRUE,             wrap = wrap)        reporter$.end_context()        reporter$end_file()    })
  38: FUN(X[[i]], ...)
  39: lapply(paths, test_file, env = env, reporter = current_reporter,     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  40: force(code)
  41: doWithOneRestart(return(expr), restart)
  42: withOneRestart(expr, restarts[[1L]])
  43: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  44: with_reporter(reporter = current_reporter, results <- lapply(paths,     test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE,     load_helpers = FALSE, wrap = wrap))
  45: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,     stop_on_warning = stop_on_warning, wrap = wrap)
  46: test_dir(path = test_path, reporter = reporter, env = env, filter = filter,     ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning,     wrap = wrap)
  47: test_package_dir(package = package, test_path = test_path, filter = filter,     reporter = reporter, ..., stop_on_failure = stop_on_failure,     stop_on_warning = stop_on_warning, wrap = wrap)
  48: test_check("bigsnpr", filter = "7-")
  An irrecoverable exception occurred. R is aborting now ...
  
  Traceback:
   1: clumping_chr_cached(G, keep, spcor.chr, spInd = ind.sp.grp, rowInd = ind.row,     colInd = ind.chr.grp, ordInd = ord.chr.grp, rankInd = rank.chr.grp,     pos = pos.chr.grp, sumX = sumX.chr.grp, denoX = deno.chr.grp,     size = 1000 * base.size.clmp/thr.clmp, thr = thr.clmp, ncores = ncores)
   2: FUN(X[[i]], ...)
   3: lapply(split(ind.noexcl, infos.chr[ind.noexcl]), function(ind.chr) {    ind.keep <- list()    info.chr <- infos.imp[ind.chr]    S.chr <- lpS[ind.chr]    pos.chr <- infos.pos[ind.chr]    stats <- snp_colstats(G, ind.row, ind.chr, ncores)    sumX.chr <- stats$sumX    denoX.chr <- stats$denoX    spcor.chr <- sparseMatrix(i = integer(), j = integer(), x = double(),         dims = rep(length(ind.chr), 2))    assert_sorted(pos.chr)    for (thr.imp in THR_IMP) {        ind <- which(info.chr >= thr.imp)        ind.chr <- ind.chr[ind]        spcor.chr <- spcor.chr[ind, ind, drop = FALSE]        info.chr <- info.chr[ind]        pos.chr <- pos.chr[ind]        S.chr <- S.chr[ind]        sumX.chr <- sumX.chr[ind]        denoX.chr <- denoX.chr[ind]        for (group in groups) {            ind2 <- which(ind.chr %in% group)            if (length(ind2) == 0) {                for (thr.clmp in THR_CLMP) {                  for (base.size.clmp in BASE_SIZE_CLMP) {                    ind.keep[[length(ind.keep) + 1L]] <- integer()                  }                }            }            else {                ind.sp.grp <- ind2 - 1L                ind.chr.grp <- ind.chr[ind2]                ord.chr.grp <- order(S.chr[ind2], decreasing = TRUE)                rank.chr.grp <- match(seq_along(ord.chr.grp),                   ord.chr.grp)                pos.chr.grp <- pos.chr[ind2]                sumX.chr.grp <- sumX.chr[ind2]                deno.chr.grp <- denoX.chr[ind2]                keep <- FBM(1, length(ind.chr.grp), type = "integer")                for (thr.clmp in THR_CLMP) {                  for (base.size.clmp in BASE_SIZE_CLMP) {                    keep[] <- -1e+00                    spcor.chr <- clumping_chr_cached(G, keep,                       spcor.chr, spInd = ind.sp.grp, rowInd = ind.row,                       colInd = ind.chr.grp, ordInd = ord.chr.grp,                       rankInd = rank.chr.grp, pos = pos.chr.grp,                       sumX = sumX.chr.grp, denoX = deno.chr.grp,                       size = 1000 * base.size.clmp/thr.clmp,                       thr = thr.clmp, ncores = ncores)                    stopifnot(all(keep[] %in% 0:1))                    ind.keep[[length(ind.keep) + 1L]] <- ind.chr.grp[keep[] ==                       1]                  }                }            }        }    }    ind.keep})
   4: snp_grid_clumping(G, ind.row = rows, lpS = lpS, ncores = 2, infos.chr = rep(1,     ncol(G)), infos.pos = cols_along(G), grid.base.size = 0.1,     grid.thr.r2 = c(0.05, 0.5))
   5: FUN(X[[i]], ...)
   6: lapply(X = X, FUN = FUN, ...)
   7: sapply(integer(n), eval.parent(substitute(function(...) expr)),     simplify = simplify)
   8: replicate(5, simplify = FALSE, {    snp_grid_clumping(G, ind.row = rows, lpS = lpS, ncores = 2,         infos.chr = rep(1, ncol(G)), infos.pos = cols_along(G),         grid.base.size = 0.1, grid.thr.r2 = c(0.05, 0.5))})
   9: eval(code, test_env)
  10: eval(code, test_env)
  11: withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error)
  12: doTryCatch(return(expr), name, parentenv, handler)
  13: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  14: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  15: doTryCatch(return(expr), name, parentenv, handler)
  16: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  17: tryCatchList(expr, classes, parentenv, handlers)
  18: tryCatch(withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error), error = handle_fatal,     skip = function(e) {    })
  19: test_code(desc, code, env = parent.frame())
  20: test_that("parallel snp_grid_clumping() works", {    G <- snp_attachExtdata()$genotypes    rows <- sample(nrow(G), replace = TRUE)    lpS <- runif(ncol(G))    test <- replicate(5, simplify = FALSE, {        snp_grid_clumping(G, ind.row = rows, lpS = lpS, ncores = 2,             infos.chr = rep(1, ncol(G)), infos.pos = cols_along(G),             grid.base.size = 0.1, grid.thr.r2 = c(0.05, 0.5))    })    true <- snp_grid_clumping(G, ind.row = rows, lpS = lpS, ncores = 1,         infos.chr = rep(1, ncol(G)), infos.pos = cols_along(G),         grid.base.size = 0.1, grid.thr.r2 = c(0.05, 0.5))    expect_true(all(sapply(test, identical, y = true)))})
  21: eval(code, test_env)
  22: eval(code, test_env)
  23: withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error)
  24: doTryCatch(return(expr), name, parentenv, handler)
  25: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  26: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  27: doTryCatch(return(expr), name, parentenv, handler)
  28: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  29: tryCatchList(expr, classes, parentenv, handlers)
  30: tryCatch(withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error), error = handle_fatal,     skip = function(e) {    })
  31: test_code(NULL, exprs, env)
  32: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  33: force(code)
  34: doWithOneRestart(return(expr), restart)
  35: withOneRestart(expr, restarts[[1L]])
  36: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  37: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter,     {        reporter$start_file(basename(path))        lister$start_file(basename(path))        source_file(path, new.env(parent = env), chdir = TRUE,             wrap = wrap)        reporter$.end_context()        reporter$end_file()    })
  38: FUN(X[[i]], ...)
  39: lapply(paths, test_file, env = env, reporter = current_reporter,     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  40: force(code)
  41: doWithOneRestart(return(expr), restart)
  42: withOneRestart(expr, restarts[[1L]])
  43: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  44: with_reporter(reporter = current_reporter, results <- lapply(paths,     test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE,     load_helpers = FALSE, wrap = wrap))
  45: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,     stop_on_warning = stop_on_warning, wrap = wrap)
  46: test_dir(path = test_path, reporter = reporter, env = env, filter = filter,     ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning,     wrap = wrap)
  47: test_package_dir(package = package, test_path = test_path, filter = filter,     reporter = reporter, ..., stop_on_failure = stop_on_failure,     stop_on_warning = stop_on_warning, wrap = wrap)
  48: test_check("bigsnpr", filter = "7-")
  An irrecoverable exception occurred. R is aborting now ...