Running ‘testthat.R’ [12s/38s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(glmmboot)
  > 
  > test_check("glmmboot")
  
   *** caught segfault ***
  address 4, cause 'memory not mapped'
  
  Traceback:
   1: sparseHessianFun(env, skipFixedEffects = skipFixedEffects)
   2: he(par)
   3: newton(par = c(b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0, b = 0), fn = function (par.random,     order = 0, ...) {    par[random] <- par.random    par[-random] <- par.fixed    res <- f(par, order = order, ...)    switch(order + 1, res, res[random], res[random, random])}, gr = function (x) f0(x, order = 1), he = function (par.random) {    par[random] <- par.random    par[-random] <- par.fixed    spHess(par, random = TRUE)}, env = <environment>, maxit = 1000, trace = FALSE)
   4: do.call("newton", c(list(par = eval(random.start), fn = f0, gr = function(x) f0(x,     order = 1), he = H0, env = env), inner.control))
   5: doTryCatch(return(expr), name, parentenv, handler)
   6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
   7: tryCatchList(expr, classes, parentenv, handlers)
   8: tryCatch(expr, error = function(e) {    call <- conditionCall(e)    if (!is.null(call)) {        if (identical(call[[1L]], quote(doTryCatch)))             call <- sys.call(-4L)        dcall <- deparse(call)[1L]        prefix <- paste("Error in", dcall, ": ")        LONG <- 75L        sm <- strsplit(conditionMessage(e), "\n")[[1L]]        w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")        if (is.na(w))             w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],                 type = "b")        if (w > LONG)             prefix <- paste0(prefix, "\n  ")    }    else prefix <- "Error : "    msg <- paste0(prefix, conditionMessage(e), "\n")    .Internal(seterrmessage(msg[1L]))    if (!silent && isTRUE(getOption("show.error.messages"))) {        cat(msg, file = outFile)        .Internal(printDeferredWarnings())    }    invisible(structure(msg, class = "try-error", condition = e))})
   9: try(do.call("newton", c(list(par = eval(random.start), fn = f0,     gr = function(x) f0(x, order = 1), he = H0, env = env), inner.control)),     silent = silent)
  10: ff(x, order = 0)
  11: doTryCatch(return(expr), name, parentenv, handler)
  12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  13: tryCatchList(expr, classes, parentenv, handlers)
  14: tryCatch(expr, error = function(e) {    call <- conditionCall(e)    if (!is.null(call)) {        if (identical(call[[1L]], quote(doTryCatch)))             call <- sys.call(-4L)        dcall <- deparse(call)[1L]        prefix <- paste("Error in", dcall, ": ")        LONG <- 75L        sm <- strsplit(conditionMessage(e), "\n")[[1L]]        w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")        if (is.na(w))             w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],                 type = "b")        if (w > LONG)             prefix <- paste0(prefix, "\n  ")    }    else prefix <- "Error : "    msg <- paste0(prefix, conditionMessage(e), "\n")    .Internal(seterrmessage(msg[1L]))    if (!silent && isTRUE(getOption("show.error.messages"))) {        cat(msg, file = outFile)        .Internal(printDeferredWarnings())    }    invisible(structure(msg, class = "try-error", condition = e))})
  15: try({    if (MCcontrol$doMC) {        ff(x, order = 0)        MC(last.par, n = MCcontrol$n, seed = MCcontrol$seed,             order = 0)    }    else ff(x, order = 0)}, silent = silent)
  16: obj$fn(obj$par)
  17: fitTMB(TMBStruc)
  18: glmmTMB::glmmTMB(formula = model_formula, data = test_data, family = binomial)
  19: withCallingHandlers(expr, warning = function(w) if (inherits(w,     classes)) tryInvokeRestart("muffleWarning"))
  20: suppressWarnings(glmmTMB::glmmTMB(formula = model_formula, data = test_data,     family = binomial))
  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(desc, code, env = parent.frame(), reporter = reporter)
  32: test_that("bootstrap_model works on test_data", {    if (!requireNamespace("glmmTMB", quietly = TRUE)) {        skip("need glmmTMB to be installed for default test_data run")    }    data(test_data)    model_formula <- as.formula(y ~ x_var1 + x_var2 + x_var2 +         (1 | subj))    base_run <- suppressWarnings(glmmTMB::glmmTMB(formula = model_formula,         data = test_data, family = binomial))    expect_error(bootstrap_model(base_model = base_run, base_data = test_data,         resamples = 2, suppress_sampling_message = FALSE), NA)    test_run <- bootstrap_model(base_model = base_run, base_data = test_data,         resamples = 20)    expect_is(test_run, "matrix")    expect_equal(test_run[, "estimate"], coef(summary(base_run))$cond[,         "Estimate"])    targ_data <- test_data    targ_data$targ <- sample(letters[1:10], size = 300, replace = TRUE)    targ_model_formula <- as.formula(y ~ x_var1 + x_var2 + x_var2 +         (1 | subj) + (1 | targ))    base_run <- suppressWarnings(glmmTMB::glmmTMB(formula = targ_model_formula,         data = targ_data, family = binomial))    expect_error(bootstrap_model(base_model = base_run, base_data = targ_data,         resamples = 20), NA)    test_run <- bootstrap_model(base_model = base_run, base_data = targ_data,         resamples = 20, resample_specific_blocks = "targ")    expect_is(test_run, "matrix")    expect_equal(test_run[, "estimate"], coef(summary(base_run))$cond[,         "Estimate"])    expect_error(bootstrap_model(base_model = base_run, base_data = targ_data,         resamples = 20, resample_specific_blocks = "unknown_var"))    small_data <- test_data[1:6, ]    small_base_run <- suppressWarnings(glmmTMB::glmmTMB(formula = model_formula,         data = test_data, family = binomial))    expect_warning(bootstrap_model(base_model = small_base_run,         base_data = small_data, resamples = 20))})
  33: eval(code, test_env)
  34: eval(code, test_env)
  35: 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)
  36: doTryCatch(return(expr), name, parentenv, handler)
  37: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  38: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  39: doTryCatch(return(expr), name, parentenv, handler)
  40: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  41: tryCatchList(expr, classes, parentenv, handlers)
  42: 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) {    })
  43: test_code(NULL, exprs, env)
  44: source_file(path, child_env(env), wrap = wrap)
  45: FUN(X[[i]], ...)
  46: lapply(test_paths, test_one_file, env = env, wrap = wrap)
  47: force(code)
  48: doWithOneRestart(return(expr), restart)
  49: withOneRestart(expr, restarts[[1L]])
  50: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  51: with_reporter(reporters$multi, lapply(test_paths, test_one_file,     env = env, wrap = wrap))
  52: test_files(test_dir = test_dir, test_package = test_package,     test_paths = test_paths, load_helpers = load_helpers, reporter = reporter,     env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning,     wrap = wrap, load_package = load_package)
  53: test_files(test_dir = path, test_paths = test_paths, test_package = package,     reporter = reporter, load_helpers = load_helpers, env = env,     stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning,     wrap = wrap, load_package = load_package, parallel = parallel)
  54: test_dir("testthat", package = package, reporter = reporter,     ..., load_package = "installed")
  55: test_check("glmmboot")
  An irrecoverable exception occurred. R is aborting now ...