Error(s) in re-building vignettes:
--- re-building ‘i-introduction.Rmd’ using rmarkdown
--- finished re-building ‘i-introduction.Rmd’

--- re-building ‘ii-modules.Rmd’ using rmarkdown

Attaching package: 'magrittr'

The following object is masked from 'package:raster':

    extract

Setting:
  options(
    spades.modulePath = '/data/gannet/ripley/R/packages/tests-devel/SpaDES.core.Rcheck/SpaDES.core/sampleModules'
  )
Paths set to:
  options(
    rasterTmpDir = '/tmp/RtmpqVJDkr/working_dir/RtmpXg2YW2/raster'
    reproducible.cachePath = '/tmp/RtmpqVJDkr/working_dir/RtmpXg2YW2/Require/cache'
    spades.inputPath = '/tmp/RtmpqVJDkr/working_dir/RtmpBU2dD0/SpaDES/inputs'
    spades.outputPath = '/tmp/RtmpqVJDkr/working_dir/RtmpBU2dD0/SpaDES/outputs'
    spades.modulePath = '/data/gannet/ripley/R/packages/tests-devel/SpaDES.core.Rcheck/SpaDES.core/sampleModules'
  )
options('spades.useRequire' = FALSE), so not checking minimum package version requirements
The following .globals were used:
             module    global
1:  caribouMovement stackName
2:       fireSpread stackName
3: randomLandscapes stackName
options('spades.useRequire' = FALSE), so not checking minimum package version requirements
Nov20 19:42:47 chckpn total elpsd: 0.0066 secs | 0 checkpoint init 0
Nov20 19:42:47 save   total elpsd: 0.015 secs | 0 save init 0
Nov20 19:42:47 prgrss total elpsd: 0.022 secs | 0 progress init 0
Nov20 19:42:47 load   total elpsd: 0.029 secs | 0 load init 0
Nov20 19:42:47 rndmLn total elpsd: 0.035 secs | 0 randomLandscapes init

 *** caught segfault ***
address 0x801f0fc0, cause 'memory not mapped'

Traceback:
 1: RandomFieldsUtils::RFoptions()
 2: internal.rfoptions(xyz_notation = length(y) != 0, expected_number_simu = n,     ..., RELAX = !missing(model) && is(model, "formula"))
 3: RandomFields::RFsimulate(model, y = 1:ncSpeedup, x = 1:nrSpeedup,     grid = TRUE, ...)
 4: raster(RandomFields::RFsimulate(model, y = 1:ncSpeedup, x = 1:nrSpeedup,     grid = TRUE, ...))
 5: gaussMap(template, scale = 10, var = 0.03, speedup = speedup,     inMemory = inMemory)
 6: Init(sim)
 7: get(moduleCall, envir = fnEnv)(sim, cur[["eventTime"]], cur[["eventType"]])
 8: eval(fnCallAsExpr)
 9: eval(fnCallAsExpr)
10: .runEvent(sim, cacheIt, debug, moduleCall, fnEnv, cur, notOlderThan,     showSimilar = showSimilar, .pkgEnv)
11: doEvent(sim, debug = debug, notOlderThan = notOlderThan, events = events,     ...)
12: withCallingHandlers({    recoverModeWrong <- getOption("spades.recoverMode")    if (!is.null(recoverModeWrong))         warning("Please set options('recoveryMode') with a 'y', not options('recoverMode')")    recoverMode <- getOption("spades.recoveryMode", FALSE)    clearFileBackedObjs(.pkgEnv$.sim$.recoverableObjs, recoverMode)    .pkgEnv$.sim <- NULL    .pkgEnv$.sim <- sim    oldGetPaths <- getPaths()    do.call(setPaths, append(sim@paths, list(silent = TRUE)))    on.exit({        do.call(setPaths, append(list(silent = TRUE), oldGetPaths))    }, add = TRUE)    if (!is.null(sim@.xData[["._randomSeed"]])) {        message("Resetting .Random.seed of session because sim$._randomSeed is not NULL. ",             "To get a different seed, run: sim$._randomSeed <- NULL to clear it.")        assign(".Random.seed", sim@.xData$._randomSeed[[1]],             envir = .GlobalEnv)        if (!is.null(sim$._rng.kind)) {            do.call("RNGkind", as.list(sim$._rng.kind))        }        sim@.xData[["._randomSeed"]] <- NULL        sim@.xData[["._rng.kind"]] <- NULL    }    if (is.null(sim@.xData[["._startClockTime"]]))         sim@.xData[["._startClockTime"]] <- Sys.time()    if (is.list(events)) {        unspecifiedEvents <- setdiff(unlist(modules(sim, TRUE)),             names(events))        unspecifiedEvents <- setdiff(unspecifiedEvents, "progress")        if (NROW(sim@outputs) == 0L)             unspecifiedEvents <- setdiff(unspecifiedEvents, "save")        if (NROW(sim@inputs) == 0L)             unspecifiedEvents <- setdiff(unspecifiedEvents, "load")        useChkpnt <- !any(is.na(params(sim)$checkpoint))        if (!useChkpnt)             unspecifiedEvents <- setdiff(unspecifiedEvents, "checkpoint")        if (length(unspecifiedEvents)) {            message("NOTE: ", paste(unspecifiedEvents, collapse = ", "),                 " not specified in events argument. ", "This means all events the module(s) will run. You may have intended to add e.g., list(",                 unspecifiedEvents[1], "= 'init')")        }    }    if (is.null(sim@.xData[["._knownObjects"]])) {        moduleNames <- unname(modules(sim))        names(moduleNames) <- moduleNames        sim@.xData[["._knownObjects"]] <- lapply(moduleNames,             function(x) character())        sim@.xData[["._knownObjects"]]$sim <- character()    }    if (is.null(sim@.xData[["._simRndString"]]))         sim@.xData[["._simRndString"]] <- rndstr(1, 8, characterFirst = TRUE)    .pkgEnv$searchPath <- search()    .pkgEnv[["spades.browserOnError"]] <- (interactive() & !identical(debug,         FALSE) & getOption("spades.browserOnError"))    .pkgEnv[["spades.nCompleted"]] <- getOption("spades.nCompleted")    .pkgEnv[["skipNamespacing"]] <- !getOption("spades.switchPkgNamespaces")    .pkgEnv[["spades.keepCompleted"]] <- getOption("spades.keepCompleted",         TRUE)    if (getOption("spades.memoryUseInterval", 0) > 0) {        if (requireNamespace("future", quietly = TRUE)) {            originalPlan <- future::plan()            sim <- memoryUseSetup(sim, originalPlan)            on.exit({                sim <- memoryUseOnExit(sim, originalPlan)            }, add = TRUE)        }        else {            message(futureMessage)        }    }    sim@.xData$.timeunits <- timeunits(sim)    on.exit({        if (!.pkgEnv[["skipNamespacing"]]) .modifySearchPath(.pkgEnv$searchPath,             removeOthers = TRUE)        rm(".timeunits", envir = sim@.xData)        if (isTRUE(getOption("spades.saveSimOnExit", FALSE))) {            if (!isTRUE(.pkgEnv$.cleanEnd)) {                if (recoverMode > 0) {                  sim <- recoverModeOnExit(sim, rmo, recoverMode)                }                messageInterrupt1(recoverMode)            } else {                message(crayon::magenta("simList saved in\n",                   crayon::blue("SpaDES.core:::.pkgEnv$.sim"),                   "\nIt will be deleted at next spades() call."))            }            .pkgEnv$.sim <- sim            .pkgEnv$.cleanEnd <- NULL        }        if (!is.null(sim$._restartRList)) {            sim@simtimes[["current"]] <- sim@events[[1]]$eventTime            sim$._restartRList$.spadesCall <- match.call()            restartFormals <- formals(restartR)            end(sim) <- sim$._restartRList$endOrig            restartR(sim = sim, reloadPkgs = getOption("spades.restartR.reloadPkgs",                 restartFormals$reloadPkgs), .First = getOption("spades.restartR..First",                 restartFormals$.First), .RDataFile = getOption("spades.restartR.filename",                 sim$._restartRList$simFilename), restartDir = getOption("spades.restartR.restartDir",                 restartFormals$restartDir))        }    }, add = TRUE)    if (!is.null(.plots)) {        sim@params <- updateParamSlotInAllModules(sim@params,             .plots, ".plots", needClass = "character", needValuesMess = paste0("It must be one or more of 'screen', ",                 "'object', 'raw' and any of the classes that ggplot2::ggsave ",                 "can handle, e.g., 'png'"))        if (is.null(.plotInitialTime) && !any(.plots %in% "screen"))             sim@params <- updateParamSlotInAllModules(sim@params,                 NA_integer_, ".plotInitialTime", needClass = "numeric")    }    if (!is.null(.plotInitialTime)) {        sim@params <- updateParamSlotInAllModules(sim@params,             .plotInitialTime, ".plotInitialTime", needClass = "numeric")        if (is.na(.plotInitialTime))             sim@params <- updateParamSlotInAllModules(sim@params,                 NA_character_, ".plots", needClass = "character")    }    if (!is.null(.saveInitialTime)) {        sim@params <- updateParamSlotInAllModules(sim@params,             .saveInitialTime, ".saveInitialTime", needClass = "numeric")    }    if (!is.na(progress)) {        tu <- sim@simtimes[["timeunit"]]        if (isTRUE(progress)) {            progress <- "graphical"        }        if (is.numeric(progress)) {            sim@params$.progress$interval <- (end(sim, tu) -                 start(sim, tu))/progress            progress <- "graphical"        }        if (!is.na(pmatch(progress, "graphical"))) {            sim@params$.progress$type <- "graphical"        }        else if (!is.na(pmatch(progress, "text"))) {            sim@params$.progress$type <- "text"        }        if (!is.na(sim@params$.progress$type) && is.na(sim@params$.progress$interval)) {            sim@params$.progress$interval <- NULL        }    }    if (!(all(unlist(lapply(debug, identical, FALSE))))) {        .pkgEnv[[".spadesDebugFirst"]] <- TRUE        .pkgEnv[[".spadesDebugWidth"]] <- c(9, 10, 9, 13)    }    sim@.xData[["._firstEventClockTime"]] <- Sys.time()    if (length(sim@completed)) {        existingCompleted <- sort(as.integer(ls(sim@completed,             sorted = FALSE)))        prevStart <- get(as.character(existingCompleted[1]),             envir = sim@completed)        prevEnd <- get(as.character(existingCompleted[length(existingCompleted)]),             envir = sim@completed)        if (length(.grepSysCalls(sys.calls(), "restartSpades")) ==             0)             if (start(sim, unit = attr(prevStart[["eventTime"]],                 "unit")) <= prevStart[["eventTime"]] && (time(sim,                 unit = attr(prevStart[["eventTime"]], "unit")) ==                 start(sim, unit = attr(prevStart[["eventTime"]],                   "unit"))))                 sim@completed <- new.env(parent = emptyenv())    }    if (recoverMode > 0) {        rmo <- NULL        allObjNames <- outputObjectNames(sim)        if (is.null(allObjNames))             recoverMode <- 0    }    useFuture <- getOption("spades.futureEvents", FALSE)    if (useFuture) {        if (!requireNamespace("future", quietly = TRUE))             stop("To use 'spades.futureEvents', please run \ninstall.packages('future') ")        message("useFuture is set to TRUE; this will attempt to spawn events in a separate process, ",             "if their outputs are not needed by other events. STILL EXPERIMENTAL. Use cautiously.",             "User must manage future::plan, e.g., \nfuture::plan(multiprocess(workers = 2))")        sim$.futureEventsSkipped <- 0        sim$simFuture <- list()    }    if (length(sim@events)) {        specialStart <- sim@events[[1]][["eventTime"]] < sim@simtimes[["current"]] &&             sim@simtimes[["current"]] > sim@simtimes[["end"]]        if (isTRUE(specialStart))             sim@simtimes[["current"]] <- sim@events[[1]][["eventTime"]]    }    while (sim@simtimes[["current"]] <= sim@simtimes[["end"]]) {        if (recoverMode > 0) {            rmo <- recoverModePre(sim, rmo, allObjNames, recoverMode)        }        sim <- doEvent(sim, debug = debug, notOlderThan = notOlderThan,             events = events, ...)        if (recoverMode > 0) {            rmo <- recoverModePost(sim, rmo, recoverMode)        }        if (exists("._conditionalEvents", envir = sim, inherits = FALSE)) {            condEventsToOmit <- integer()            for (condNum in seq(sim$._conditionalEvents)) {                cond <- sim$._conditionalEvents[[condNum]]                if (isTRUE(eval(cond$condition))) {                  curTime <- time(sim)                  if (curTime >= cond$minEventTime && curTime <=                     cond$maxEventTime) {                    message("  Conditional Event -- ", cond$condition,                       " is true. Scheduling for now")                    sim <- scheduleEvent(sim, eventTime = curTime,                       moduleName = cond$moduleName, eventType = cond$eventType,                       eventPriority = cond$eventPriority)                    condEventsToOmit <- c(condEventsToOmit, condNum)                  }                }            }            if (length(condEventsToOmit)) {                sim$._conditionalEvents <- sim$._conditionalEvents[-condEventsToOmit]                if (length(sim$._conditionalEvents) == 0) {                  rm("._conditionalEvents", envir = sim)                }            }        }        if (useFuture) {            if (length(sim$simFuture) > 1) {                for (simFut in seq_along(sim$simFuture)) {                  if (future::resolved(sim$simFuture[[1]][[1]])) {                    sim <- resolveFutureNow(sim, cause = paste0(modNameInFuture(sim$simFuture[1]),                       " finished running"))                  }                }            }        }    }    if (useFuture) {        if (length(sim$simFuture)) {            for (simFut in seq_along(sim$simFuture)) {                sim <- resolveFutureNow(sim, cause = "End of simulation")            }        }        message(crayon::magenta(sim$.futureEventsSkipped, " events ran while events ran in futures"))    }    sim@simtimes[["current"]] <- sim@simtimes[["end"]]    .pkgEnv$.cleanEnd <- TRUE    return(invisible(sim))}, warning = function(w) {    if (requireNamespace("logging", quietly = TRUE)) {        logging::logwarn(paste0(collapse = " ", c(names(w), w)))    }}, error = function(e) {    if (requireNamespace("logging", quietly = TRUE)) {        logging::logerror(e)    }    else {        stop(e)    }}, message = function(m) {    if (newDebugging && requireNamespace("logging", quietly = TRUE)) {        logging::loginfo(m$message)    }    if (useNormalMessaging) {        message(loggingMessage(m$message))    }    tryCatch(invokeRestart("muffleMessage"), error = function(e) NULL)})
13: spades(.)
14: spades(.)
15: simInit(times = list(start = 0, end = 2, timeunit = "year"),     params = parameters, modules = list("randomLandscapes", "fireSpread",         "caribouMovement"), objects = list(), paths = list(modulePath = system.file("sampleModules",         package = "SpaDES.core"))) %>% spades()
16: eval(expr, envir, enclos)
17: eval(expr, envir, enclos)
18: withVisible(eval(expr, envir, enclos))
19: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler,     error = eHandler, message = mHandler)
20: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir,     enclos)), warning = wHandler, error = eHandler, message = mHandler))
21: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr,     envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
22: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos,     debug = debug, last = i == length(out), use_try = stop_on_error !=         2L, keep_warning = keep_warning, keep_message = keep_message,     output_handler = output_handler, include_timing = include_timing)
23: evaluate::evaluate(...)
24: evaluate(code, envir = env, new_device = FALSE, keep_warning = !isFALSE(options$warning),     keep_message = !isFALSE(options$message), stop_on_error = if (is.numeric(options$error)) options$error else {        if (options$error && options$include)             0L        else 2L    }, output_handler = knit_handlers(options$render, options))
25: in_dir(input_dir(), evaluate(code, envir = env, new_device = FALSE,     keep_warning = !isFALSE(options$warning), keep_message = !isFALSE(options$message),     stop_on_error = if (is.numeric(options$error)) options$error else {        if (options$error && options$include)             0L        else 2L    }, output_handler = knit_handlers(options$render, options)))
26: eng_r(options)
27: block_exec(params)
28: call_block(x)
29: process_group.block(group)
30: process_group(group)
31: withCallingHandlers(if (tangle) process_tangle(group) else process_group(group),     error = function(e) {        setwd(wd)        cat(res, sep = "\n", file = output %n% "")        message("Quitting from lines ", paste(current_lines(i),             collapse = "-"), " (", knit_concord$get("infile"),             ") ")    })
32: process_file(text, output)
33: knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
34: rmarkdown::render(file, encoding = encoding, quiet = quiet, envir = globalenv(),     output_dir = getwd(), ...)
35: vweave_rmarkdown(...)
36: engine$weave(file, quiet = quiet, encoding = enc)
37: doTryCatch(return(expr), name, parentenv, handler)
38: tryCatchOne(expr, names, parentenv, handlers[[1L]])
39: tryCatchList(expr, classes, parentenv, handlers)
40: tryCatch({    engine$weave(file, quiet = quiet, encoding = enc)    setwd(startdir)    output <- find_vignette_product(name, by = "weave", engine = engine)    if (!have.makefile && vignette_is_tex(output)) {        texi2pdf(file = output, clean = FALSE, quiet = quiet)        output <- find_vignette_product(name, by = "texi2pdf",             engine = engine)    }    outputs <- c(outputs, output)}, error = function(e) {    thisOK <<- FALSE    fails <<- c(fails, file)    message(gettextf("Error: processing vignette '%s' failed with diagnostics:\n%s",         file, conditionMessage(e)))})
41: tools:::buildVignettes(dir = "/data/gannet/ripley/R/packages/tests-devel/SpaDES.core.Rcheck/vign_test/SpaDES.core")
An irrecoverable exception occurred. R is aborting now ...