I have an R program I am attempting to use to generate some SVGs. I've been using the cairoDevice library. When running a session not connected to an X session (like if I'm sshed in), attempting "library(cairoDevice)" causes:
*** caught segfault *** address 0x8, cause 'memory not mapped' Traceback: 1: .C("R_gtk_setEventHandler", PACKAGE = "cairoDevice") 2: firstlib(which.lib.loc, package) 3: doTryCatch(return(expr), name, parentenv, handler) 4: tryCatchOne(expr, names, parentenv, handlers[[1]]) 5: tryCatchList(expr, classes, parentenv, handlers) 6: tryCatch(expr, error = function(e) { call <- conditionCall(e) if (!is.null(call)) { if (identical(call[[1]], quote(doTryCatch))) call <- sys.call(-4) dcall <- deparse(call)[1] prefix <- paste("Error in", dcall, ": ") LONGCALL <- 30 if (nchar(dcall) > LONGCALL) prefix <- paste(prefix, "\n\t", sep = "") } else prefix <- "Error : " msg <- paste(prefix, conditionMessage(e), "\n", sep = "") .Internal(seterrmessage(msg[1])) if (!silent && identical(getOption(" show.error.messages"), TRUE)) { cat(msg, file = stderr()) .Internal(printDeferredWarnings()) } invisible(structure(msg, class = "try-error"))}) 7: try(firstlib(which.lib.loc, package)) 8: library(cairoDevice) aborting ... Segmentation fault (core dumped) I'm fine with the idea that Cairo somehow needs the X server to do its business. I would like to not have the program segfault however and instead just skip the SVG if it can't load the library. I've been hunting to see how to do error handling in R and I'm not really finding a good resource. Can anyone suggest one? Will [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.