[R-pkg-devel] R CMD check warning on Solaris

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Tue Dec 15 23:47:39 CET 2020


On 15/12/2020 4:37 p.m., Akshit Achara wrote:
> Hey everyone,
> 
> I have created a package rminizinc
> <https://cran.r-project.org/package=rminizinc> which is available on CRAN.
> I had issues in
> my configure script as it was only supporting Linux, OSX and Windows and not
> other Unix like OS. I was able to resolve that issue.
> 
> I tested my package on R-hub on Oracle Solaris 10, x86, 32 bit, R-release,
> Oracle Developer Studio 12.6
> and got this warning :
> 
> #> Error(s) in re-building vignettes:
> 
> #> --- re-building ‘R_MiniZinc.Rmd’ using rmarkdown
> 
> #> Warning in engine$weave(file, quiet = quiet, encoding = enc) :
> 
> #> Pandoc (>= 1.12.3) and/or pandoc-citeproc not available. Falling back to
> R Markdown v1.
> 
> #> *** caught segfault ***
> 
> #> address 0, cause 'memory not mapped'
> 
> #> Traceback:
> 
> #> 1: rminizinc:::mzn_parse(mzn_path = mzn_path)
> 
> #> 2: eval(expr, envir, enclos)
> 
> #> 3: eval(expr, envir, enclos)
> 
> #> 4: withVisible(eval(expr, envir, enclos))
> 
> #> 5: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning =
> wHandler, error = eHandler, message = mHandler)
> 
> #> 6: doTryCatch(return(expr), name, parentenv, handler)
> 
> #> 7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
> 
> #> 8: tryCatchList(expr, classes, parentenv, handlers)
> 
> #> 9: 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))})
> 
> #> 10: try(f, silent = TRUE)
> 
> #> 11: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir,
> enclos)), warning = wHandler, error = eHandler, message = mHandler))
> 
> #> 12: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr,
> envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
> 
> #> 13: 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)
> 
> #> 14: evaluate::evaluate(...)
> 
> #> 15: evaluate(code, envir = env, new_device = FALSE, keep_warning =
> !isFALSE(options$warning), keep_message = !isFALSE(options$message),
> stop_on_error = if (options$error && options$include) 0L else 2L,
> output_handler = knit_handlers(options$render, options))
> 
> #> 16: 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 (options$error &&
> options$include) 0L else 2L, output_handler = knit_handlers(options$render,
> options)))
> 
> #> 17: block_exec(params)
> 
> #> 18: call_block(x)
> 
> #> 19: process_group.block(group)
> 
> #> 20: process_group(group)
> 
> #> 21: 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"),
> ") ") })
> 
> #> 22: process_file(text, output)
> 
> #> 23: knit(input, text = text, envir = envir, quiet = quiet)
> 
> #> 24: knit2html(..., force_v1 = TRUE)
> 
> #> 25: (if (grepl("\\.[Rr]md$", file)) knit2html_v1 else if
> (grepl("\\.[Rr]rst$", file)) knit2pandoc else knit)(file, encoding =
> encoding, quiet = quiet, envir = globalenv(), ...)
> 
> #> 26: vweave(...)
> 
> #> 27: engine$weave(file, quiet = quiet, encoding = enc)
> 
> #> 28: doTryCatch(return(expr), name, parentenv, handler)
> 
> #> 29: tryCatchOne(expr, names, parentenv, handlers[[1L]])
> 
> #> 30: tryCatchList(expr, classes, parentenv, handlers)
> 
> #> 31: 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)))})
> 
> #> 32: tools:::buildVignettes(dir =
> "/export/home/XvmX59V/rminizinc.Rcheck/vign_test/rminizinc", ser_elibs =
> "/export/home/XvmX59V/Rtemp/RtmpFgaaxZ/file66b85b0113ad.rds")
> 
> #> An irrecoverable exception occurred. R is aborting now ...
> 
> 
> I think this warning is coming because of the compiler 'Oracle Developer
> Studio 12.6' and I
> was not getting this warning on other operating systems (including the
> Oracle Solaris 10, x86, 32 bit, R-release).
> 
> It would be great if you could please give suggestions on how to resolve
> this warning. It will
> help me to resubmit the package.

Add a test to see whether Pandoc (of a sufficient version) is available. 
  If it isn't, your vignettes shouldn't try to execute any code.  Here's 
the test I use in rgl:

   if (!requireNamespace("rmarkdown") || 
!rmarkdown::pandoc_available("1.14")) {
     warning(call. = FALSE, "These vignettes assume rmarkdown and pandoc 
version 1.14.  These were not found. Older versions will not work.")
     knitr::knit_exit()
   }

This results in very short vignettes on systems that can't produce them, 
but since tar.gz files include the vignettes produced on my system, this 
shouldn't be a big problem.

You should also list the Pandoc requirement as a system requirement in 
your Description file, e.g.

   SystemRequirements: pandoc (>=1.14, needed for vignettes)

You may have other errors; the Pandoc issue probably wouldn't cause a 
segfault.  But if the wrong version of rmarkdown isn't used, all bets 
are off.

Duncan Murdoch



More information about the R-package-devel mailing list