Running ‘checkinputs.R’ [71s/86s]
  Running ‘checkmethods.R’ [78s/87s]
  Running ‘checkmodule.R’ [14s/37s]
  Running ‘checkstudy.R’ [68s/54s]
Running the tests in ‘tests/checkmodule.R’ failed.
Complete output:
  > library("runjags")
  > runjags.options(nodata.warning=FALSE)
  > 
  > # Checks that the runjags module distributions are correct.
  > 	
  > # Loading the dynlib requires rjags for Windows:
  > if(.Platform$OS.type != 'windows' || requireNamespace('rjags')){
  + 
  + 	loaded <- runjags:::dynloadmodule()	
  + 	if(!loaded)
  + 		stop("The internal JAGS dynlib could not be loaded - if you installed this package from CRAN, please file a bug report to the package author")
  + 
  + 	cat('Running module tests\n')
  + 
  + 	# Required for nchain etc:
  + 	library("coda")
  + 
  + 	load("moduletargets.Rsave")
  + 
  + 	checksok <- rep(TRUE, N)
  + 	for(i in 1:N){
  + 		success <- try({
  + 		obs <- runjags:::userunjagsmodule(tests[[i]]$distribution, tests[[i]]$funtype, tests[[i]]$parameters, tests[[i]]$x, tests[[i]]$uselog, tests[[i]]$lower)
  + 		expect <- results[[i]]
  + 
  + 		# Allow a bit of a larger tolerance than usual as we have saved the results from a different machine:
  + 		problem <- abs(expect-obs) > max(10^-5, .Machine$double.eps^0.5)
  + 
  + 		# Or obs is NA:
  + 		problem[is.na(problem)] <- TRUE
  + 		if(any(problem)){
  + 			cat("Error with check number ", i, " (which expected observed):  ", paste(paste(which(problem), " ", expect[problem], " ", obs[problem], ";  ", sep=""), collapse=""), "\n", sep="")
  + 			checksok[i] <- FALSE
  + 		}
  + 		})
  + 		if(inherits(success, 'try-error')){
  + 			checksok[i] <- FALSE
  + 			cat("Uncaught crash error with check number", i, "\n")
  + 		}
  + 	}
  + 
  + 	if(!all(checksok)) stop(paste("The runjags module checks failed for test number(s) ", paste(which(!checksok),collapse=","), sep=""))
  + 	
  + 	# From:  Gelman, A. (2006). Prior distributions for variance parameters in hierarchical models. Bayesian Analysis, (3), 515–533.
  + 	# ... the half cauchy should be the same as a ratio of two gammas:
  + 	scale <- seq(1,100,length.out=10)
  + 	quantiles <- seq(0.05,0.95,length.out=10)
  + 	checksok <- rep(TRUE, 10)
  + 	set.seed(1)
  + 
  + 	for(i in 1:10){
  + 		success <- try({
  + 
  + 		xi <- rnorm(10^6, 0, sd=scale[i])
  + 		tau <- rgamma(10^6, shape=0.5, rate=0.5)  	# Chi-squared with 1 df - i.e.= rchisq(10^6, 1)
  + 		gelman <- abs(xi)/sqrt(tau)
  + 		expect <- quantile(gelman,quantiles)
  + 		obs <- runjags:::userunjagsmodule('halfcauchy', 'q', scale[i], quantiles, FALSE, TRUE)
  + 		# Allow a fairly large 5% tolerance as this is a numerical approximation:
  + 		problem <- (abs(expect-obs)/expect) > 0.05
  + 
  + 		# Or obs is NA:
  + 		problem[is.na(problem)] <- TRUE
  + 		if(any(problem)){
  + 			cat("Error with Half Cauchy check number ", i, " - scale=", scale[i], " - (which expected observed):  ", paste(paste(which(problem), " ", expect[problem], " ", obs[problem], ";  ", sep=""), collapse=""), "\n", sep="")
  + 			checksok[i] <- FALSE
  + 		}
  + 		})
  + 		if(inherits(success, 'try-error')){
  + 			checksok[i] <- FALSE
  + 			cat("Uncaught crash error with Half Cauchy check number", i, "\n")
  + 		}		
  + 	}
  + 	if(!all(checksok)) stop(paste("The runjags module Half Cauchy checks failed for test number(s) ", paste(which(!checksok),collapse=","), sep=""))
  + 	
  + 	cat("The internal module tests were passed\n")
  + }else{
  + 	cat("The internal module tests were skipped (not available on Windows)\n")
  + }
  Loading shared library from:
  /tmp/RtmpSkaWgC/RLIBS_38366d581d41/runjags/libs/runjags.so
  Running module tests
  The internal module tests were passed
  > 
  > 
  > # Require the rjags library to run the rest of the checks:
  > dotests <- TRUE
  > if(!require("rjags")){
  + 	cat("The module checks were not performed as rjags is not installed\n")
  + 	dotests <- FALSE
  + }
  Loading required package: rjags
  Linked to JAGS 4.3.0
  
   *** caught segfault ***
  address ef39c778, cause 'memory not mapped'
  
  Traceback:
   1: lapply(list(...), as.character)
   2: .makeMessage(..., domain = domain, appendLF = appendLF)
   3: packageStartupMessage("Loaded modules: ", paste(list.modules(),     collapse = ","))
   4: fun(libname, pkgname)
   5: doTryCatch(return(expr), name, parentenv, handler)
   6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
   7: tryCatchList(expr, classes, parentenv, handlers)
   8: tryCatch(fun(libname, pkgname), error = identity)
   9: runHook(".onAttach", ns, dirname(nspath), nsname)
  10: attachNamespace(ns, pos = pos, deps)
  11: doTryCatch(return(expr), name, parentenv, handler)
  12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  13: tryCatchList(expr, classes, parentenv, handlers)
  14: tryCatch({    attr(package, "LibPath") <- which.lib.loc    ns <- loadNamespace(package, lib.loc)    env <- attachNamespace(ns, pos = pos, deps)}, error = function(e) {    P <- if (!is.null(cc <- conditionCall(e)))         paste(" in", deparse(cc)[1L])    else ""    msg <- gettextf("package or namespace load failed for %s%s:\n %s",         sQuote(package), P, conditionMessage(e))    if (logical.return)         message(paste("Error:", msg), domain = NA)    else stop(msg, call. = FALSE, domain = NA)})
  15: library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,     warn.conflicts = warn.conflicts, quietly = quietly)
  16: doTryCatch(return(expr), name, parentenv, handler)
  17: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  18: tryCatchList(expr, classes, parentenv, handlers)
  19: tryCatch(library(package, lib.loc = lib.loc, character.only = TRUE,     logical.return = TRUE, warn.conflicts = warn.conflicts, quietly = quietly),     error = function(e) e)
  20: require("rjags")
  An irrecoverable exception occurred. R is aborting now ...