Running ‘spelling.R’ [0s/1s]
  Running ‘testthat.R’ [30s/36s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(babelmixr2)
  Loading required package: nlmixr2
  Loading required package: nlmixr2data
  > 
  > test_check("babelmixr2")
  i parameter labels from comments will be replaced by 'label()'
  i writing monolix files
  i done
  > loading into symengine environment...
  > pruning branches (`if`/`else`) of full model...
  v done
  > finding duplicate expressions in EBE model...
  [====|====|====|====|====|====|====|====|====|====] 0:00:00 
  
  > optimizing duplicate expressions in EBE model...
  [====|====|====|====|====|====|====|====|====|====] 0:00:00 
  
  > compiling EBE model...
  using C compiler: ‘gcc-11 (Debian 11.3.0-12) 11.3.0’
  In file included from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                   from /usr/include/stdlib.h:26,
                   from /home/hornik/tmp/R.check/r-release-gcc/Work/build/include/R.h:43,
                   from /home/hornik/tmp/R.check/r-release-gcc/Work/build/Packages/rxode2/include/rxode2.h:8,
                   from /home/hornik/tmp/R.check/r-release-gcc/Work/build/Packages/rxode2parse/include/rxode2_model_shared.h:3,
                   from rx_255d5ace64af77ee328f9bbf759be0b6_.c:115:
  /usr/include/features.h:423:5: warning: #warning _FORTIFY_SOURCE > 2 is treated like 2 on this platform [-Wcpp]
    423 | #   warning _FORTIFY_SOURCE > 2 is treated like 2 on this platform
        |     ^~~~~~~
  
  v done
  rxode2 2.0.13 using 3 threads (see ?getRxThreads)
    no cache: create with `rxCreateCache()`
  > Calculating residuals/tables
  v done
  > compress origData in nlmixr2 object, save 27560
  i monolix parameter history integrated into fit object
  i writing monolix files
  i done
  > loading into symengine environment...
  > pruning branches (`if`/`else`) of full model...
  v done
  > finding duplicate expressions in EBE model...
  [====|====|====|====|====|====|====|====|====|====] 0:00:00 
  
  > optimizing duplicate expressions in EBE model...
  [====|====|====|====|====|====|====|====|====|====] 0:00:00 
  
  > compiling EBE model...
  using C compiler: ‘gcc-11 (Debian 11.3.0-12) 11.3.0’
  In file included from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                   from /usr/include/stdlib.h:26,
                   from /home/hornik/tmp/R.check/r-release-gcc/Work/build/include/R.h:43,
                   from /home/hornik/tmp/R.check/r-release-gcc/Work/build/Packages/rxode2/include/rxode2.h:8,
                   from /home/hornik/tmp/R.check/r-release-gcc/Work/build/Packages/rxode2parse/include/rxode2_model_shared.h:3,
                   from rx_2b1d82cfa70162b25b007a9102504f23_.c:115:
  /usr/include/features.h:423:5: warning: #warning _FORTIFY_SOURCE > 2 is treated like 2 on this platform [-Wcpp]
    423 | #   warning _FORTIFY_SOURCE > 2 is treated like 2 on this platform
        |     ^~~~~~~
  
  v done
  > Calculating residuals/tables
  v done
  > compress origData in nlmixr2 object, save 27560
  i monolix parameter history needs expoted charts, please export charts
  i writing monolix files
  i done
  > loading into symengine environment...
  > pruning branches (`if`/`else`) of full model...
  v done
  > finding duplicate expressions in EBE model...
  [====|====|====|====|====|====|====|====|====|====] 0:00:00 
  
  > optimizing duplicate expressions in EBE model...
  [====|====|====|====|====|====|====|====|====|====] 0:00:00 
  
  > compiling EBE model...
  v done
  > Calculating residuals/tables
  v done
  > compress origData in nlmixr2 object, save 27560
  i monolix parameter history needs expoted charts, please export charts
  i writing monolix files
  i done
  > loading into symengine environment...
  > pruning branches (`if`/`else`) of full model...
  v done
  > finding duplicate expressions in EBE model...
  [====|====|====|====|====|====|====|====|====|====] 0:00:00 
  
  > optimizing duplicate expressions in EBE model...
  [====|====|====|====|====|====|====|====|====|====] 0:00:00 
  
  > compiling EBE model...
  v done
  > Calculating residuals/tables
  
   *** caught segfault ***
  address 0x30, cause 'memory not mapped'
  
  Traceback:
   1: rxSolveSEXP(object, .ctl, .nms, .xtra, params, events, inits,     setupOnlyS = .setupOnly)
   2: withCallingHandlers(expr, warning = function(w) {    assign(".ws", unique(c(w$message, .ws)), .thisEnv)})
   3: withCallingHandlers(expr, warning = function(w) if (inherits(w,     classes)) tryInvokeRestart("muffleWarning"))
   4: suppressWarnings(withCallingHandlers(expr, warning = function(w) {    assign(".ws", unique(c(w$message, .ws)), .thisEnv)}))
   5: .collectWarnings(rxSolveSEXP(object, .ctl, .nms, .xtra, params,     events, inits, setupOnlyS = .setupOnly), lst = TRUE)
   6: doTryCatch(return(expr), name, parentenv, handler)
   7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
   8: tryCatchList(expr, classes, parentenv, handlers)
   9: tryCatch({    .envReset$ret <- .collectWarnings(rxSolveSEXP(object, .ctl,         .nms, .xtra, params, events, inits, setupOnlyS = .setupOnly),         lst = TRUE)}, error = function(e) {    if (regexpr("not provided by package", e$message) != -1) {        if (.envReset$cacheReset) {            .malert("unsuccessful cache reset; try manual reset with 'rxClean()'")            stop(e)        }        else {            gc()            .minfo("try resetting cache")            rxode2::rxClean()            .envReset$cacheReset <- TRUE            .envReset$reset <- TRUE            .msuccess("done")        }    }    else if (regexpr("maximal number of DLLs reached", e$message) !=         -1) {        if (.envReset$unload) {            .malert("Could not unload rxode2 models, try restarting R")            stop(e)        }        else {            gc()            .minfo("try resetting cache and unloading all rxode2 models")            try(rxode2::rxUnloadAll())            rxode2::rxClean()            .envReset$unload <- TRUE            .envReset$reset <- TRUE            .msuccess("done")        }    }    else {        stop(e)    }})
  10: rxSolve.default(..., warnIdSort = FALSE)
  11: rxode2::rxSolve(..., warnIdSort = FALSE)
  12: .foceiSolveWithId(model, pars, fit$dataSav, returnType = returnType,     atol = .atol, rtol = .rtol, maxsteps = fit$maxstepsOde, hmin = fit$hmin,     hmax = fit$hmax, hini = fit$hini, maxordn = fit$maxordn,     maxords = fit$maxords, method = rxode2::odeMethodToInt(currentOdeMethod),     keep = keep, addDosing = addDosing, subsetNonmem = subsetNonmem,     addCov = addCov)
  13: .foceiSolvePars(fit, .ipredModel, thetaEtaParameters$ipred, returnType = "data.frame.TBS",     keep = .keep, what = "ipred", addDosing = addDosing, subsetNonmem = subsetNonmem,     addCov = predOnly)
  14: tolower(names(df))
  15: which(tolower(names(df)) == .v)
  16: .residAdjustIpredNames(.foceiSolvePars(fit, .ipredModel, thetaEtaParameters$ipred,     returnType = "data.frame.TBS", keep = .keep, what = "ipred",     addDosing = addDosing, subsetNonmem = subsetNonmem, addCov = predOnly))
  17: .foceiPredIpredList(fit, data = fit$dataSav, keep = keep, thetaEtaParameters = .thetaEtaParameters,     predOnly = .predOnly, addDosing = table$addDosing, subsetNonmem = table$subsetNonmem)
  18: .calcTables(.fit, data = data, table = table, keep = keep)
  19: force(code)
  20: nlmixrWithTiming("table", {    keep <- unique(c(keep, "nlmixrRowNums"))    .malert("Calculating residuals/tables")    .objName <- substitute(object)    if (!inherits(object, "nlmixr2FitCore")) {        stop("requires a nlmixr2 fit object", call. = FALSE)    }    .fit <- object$env    if (exists("origControl", .fit)) {        .control <- .fit$origControl    }    else if (exists("control", .fit)) {        .control <- .fit$control    }    else {        .control <- foceiControl()    }    if (is.null(.fit$omega)) {        .df <- .calcIres(.fit, data = data, table = table, dv = NULL,             addDosing = table$addDosing, subsetNonmem = table$subsetNonmem,             keep = keep)    }    else {        .tabs <- .calcTables(.fit, data = data, table = table,             keep = keep)        assign("shrink", .tabs$shrink, .fit)        .df <- .tabs$resid    }    .rownum <- as.integer(.df$nlmixrRowNums)    assign(".rownum", .rownum, envir = .fit)    drop <- c(drop, "rxLambda", "rxYj", "nlmixrRowNums")    .w <- -which(names(.df) %in% drop)    if (length(.w) > 0)         .df <- .df[, .w, drop = FALSE]    class(.df) <- "data.frame"    .id <- .df$ID    attr(.id, "levels") <- object$idLvl    class(.id) <- "factor"    .df$ID <- .id    .covLvl <- object$covLvl    for (.v in names(.covLvl)) {        .l <- as.integer(.df[[.v]])        attr(.l, "levels") <- .covLvl[[.v]]        class(.l) <- "factor"        .df[[.v]] <- .l    }    .isDplyr <- requireNamespace("tibble", quietly = TRUE)    if (!.isDplyr) {        .isDataTable <- requireNamespace("data.table", quietly = TRUE)        if (.isDataTable) {            .df <- data.table::data.table(.df)        }    }    else {        .df <- tibble::as_tibble(.df)    }    .cls <- class(.df)    if (!any(names(.control) == "interaction")) {        .control$interaction <- FALSE    }    if (.fit$method == "population only") {        .cls <- c("nlmixr2FitData", "nlmixr2FitCore", "pop",             paste0("nlmixr2.", .fit$env$est), .cls)    }    else {        .cls <- c("nlmixr2FitData", "nlmixr2FitCore", paste0("nlmixr2.",             .fit$env$est), .cls)    }    if (inherits(updateObject, "logical")) {        if (!updateObject) {            .fit <- .cloneEnv(.fit)        }    }    class(.fit) <- "nlmixr2FitCoreSilent"    attr(.cls, ".foceiEnv") <- .fit    class(.df) <- .cls    if (inherits(updateObject, "logical")) {        if (updateObject) {            .parent <- envir            .bound <- do.call("c", lapply(ls(.parent, all.names = TRUE),                 function(.cur) {                  if (.cur == .objName && identical(.parent[[.cur]]$env,                     .fit$env)) {                    return(.cur)                  }                  return(NULL)                }))            if (length(.bound) == 1) {                if (exists(.bound, envir = .parent)) {                  assign(.bound, .df, envir = .parent)                }            }        }    }    .msuccess("done")    .df}, envir = object)
  21: addTable(.ret, updateObject = "no", keep = .ret$table$keep, drop = .ret$table$drop,     table = .ret$table)
  22: .foceiFamilyReturn(env, .ui, ..., est = env$est)
  23: nlmixr2Est.output(.env)
  24: nlmixr2Est(.env)
  25: nlmixr2est::nlmixr2CreateOutputFromUi(env$ui, data = env$origData,     control = env$control, table = env$table, env = env, est = "monolix")
  26: .monolixFinalizeEnv(.ret, .ui)
  27: .monolixFamilyFit(env, ...)
  28: nlmixr2Est.monolix(env, ...)
  29: nlmixr2Est(env, ...)
  30: withCallingHandlers(expr, warning = function(w) {    assign("ws", unique(c(w$message, ws)), this.env)})
  31: withCallingHandlers(expr, warning = function(w) if (inherits(w,     classes)) tryInvokeRestart("muffleWarning"))
  32: suppressWarnings(withCallingHandlers(expr, warning = function(w) {    assign("ws", unique(c(w$message, ws)), this.env)}))
  33: .collectWarn(nlmixr2Est(env, ...), lst = TRUE)
  34: doTryCatch(return(expr), name, parentenv, handler)
  35: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  36: tryCatchList(expr, classes, parentenv, handlers)
  37: 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, nlines = 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))})
  38: try(.collectWarn(nlmixr2Est(env, ...), lst = TRUE))
  39: assign("ret", try(.collectWarn(nlmixr2Est(env, ...), lst = TRUE)),     envir = .envReset)
  40: nlmixr2Est0(.env)
  41: nlmixr2.function(pk.turnover.emax4, nlmixr2data::warfarin, "monolix",     control = monolixControl(modelName = "pk.turnover.emax4"))
  42: nlmixr2::nlmixr(pk.turnover.emax4, nlmixr2data::warfarin, "monolix",     control = monolixControl(modelName = "pk.turnover.emax4"))
  43: force(code)
  44: withr::with_dir(tmp, code)
  45: withr::with_tempdir({    unzip(.path)    f <- nlmixr2::nlmixr(pk.turnover.emax4, nlmixr2data::warfarin,         "monolix", control = monolixControl(modelName = "pk.turnover.emax4"))    expect_true(inherits(f, "nlmixr2FitData"))})
  46: eval(code, test_env)
  47: eval(code, test_env)
  48: 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)
  49: doTryCatch(return(expr), name, parentenv, handler)
  50: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  51: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  52: doTryCatch(return(expr), name, parentenv, handler)
  53: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  54: tryCatchList(expr, classes, parentenv, handlers)
  55: 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) {    })
  56: test_code(desc, code, env = parent.frame(), reporter = reporter)
  57: test_that("test more nlmixr2/monolix features", {    pk.turnover.emax4 <- function() {        ini({            tktr <- log(1)            tka <- log(1)            tcl <- log(0.1)            tv <- log(10)            eta.ktr ~ 1            eta.ka ~ 1            eta.cl ~ 2            eta.v ~ 1            prop.err <- 0.1            pkadd.err <- 0.1            temax <- logit(0.8)            tec50 <- log(0.5)            tkout <- log(0.05)            te0 <- log(100)            eta.emax + eta.ec50 ~ c(0.5, 0.05, 0.5)            eta.kout ~ 0.5            eta.e0 ~ 0.5            pdadd.err <- 10        })        model({            ktr <- exp(tktr + eta.ktr)            ka <- exp(tka + eta.ka)            cl <- exp(tcl + eta.cl)            v <- exp(tv + eta.v)            emax = expit(temax + eta.emax)            ec50 = exp(tec50 + eta.ec50)            kout = exp(tkout + eta.kout)            e0 = exp(te0 + eta.e0)            DCP = center/v            PD = 1 - emax * DCP/(ec50 + DCP)            effect(0) = e0            kin = e0 * kout            d/dt(depot) = -ktr * depot            d/dt(gut) = ktr * depot - ka * gut            d/dt(center) = ka * gut - cl/v * center            d/dt(effect) = kin * PD - kout * effect            cp = center/v            cp ~ prop(prop.err) + add(pkadd.err)            effect ~ add(pdadd.err) | pca        })    }    skip_if_not(file.exists("pk.turnover.emax4-2021.zip"))    .path <- normalizePath("pk.turnover.emax4-2021.zip")    withr::with_tempdir({        unzip(.path)        f <- nlmixr2::nlmixr(pk.turnover.emax4, nlmixr2data::warfarin,             "monolix", control = monolixControl(modelName = "pk.turnover.emax4"))        expect_true(inherits(f, "nlmixr2FitData"))    })})
  58: eval(code, test_env)
  59: eval(code, test_env)
  60: 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)
  61: doTryCatch(return(expr), name, parentenv, handler)
  62: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  63: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  64: doTryCatch(return(expr), name, parentenv, handler)
  65: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  66: tryCatchList(expr, classes, parentenv, handlers)
  67: 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) {    })
  68: test_code(NULL, exprs, env)
  69: source_file(path, child_env(env), wrap = wrap)
  70: FUN(X[[i]], ...)
  71: lapply(test_paths, test_one_file, env = env, wrap = wrap)
  72: doTryCatch(return(expr), name, parentenv, handler)
  73: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  74: tryCatchList(expr, classes, parentenv, handlers)
  75: tryCatch(code, testthat_abort_reporter = function(cnd) {    cat(conditionMessage(cnd), "\n")    NULL})
  76: with_reporter(reporters$multi, lapply(test_paths, test_one_file,     env = env, wrap = wrap))
  77: test_files_serial(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)
  78: 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)
  79: test_dir("testthat", package = package, reporter = reporter,     ..., load_package = "installed")
  80: test_check("babelmixr2")
  An irrecoverable exception occurred. R is aborting now ...
  Segmentation fault