Closed Aariq closed 2 years ago
Possibly related: https://github.com/rstudio/rstudio/issues/7761
Running the above with the reprex
and std_out_err = TRUE
:
This reprex appears to crash R. See standard output and standard error for more details.
✖ Install the styler package in order to use `style = TRUE`.
*** caught segfault ***
address 0x9a671030, cause 'memory not mapped'
Traceback:
1: postgresqlNewConnection(drv, ...)
2: dbConnect(drv, ...)
3: dbConnect(drv, ...)
4: doTryCatch(return(expr), name, parentenv, handler)
5: tryCatchOne(expr, names, parentenv, handlers[[1L]])
6: tryCatchList(expr, classes, parentenv, handlers)
7: tryCatch({ con <- dbConnect(drv, ...) dbDisconnect(con) TRUE}, error = function(e) { structure(FALSE, reason = conditionMessage(e))})
8: dbCanConnect(drv, host = "", port = "", dbname = "", user = "", password = "")
9: dbCanConnect(drv, host = "", port = "", dbname = "", user = "", password = "")
10: eval(expr, envir, enclos)
11: eval(expr, envir, enclos)
12: eval_with_user_handlers(expr, envir, enclos, user_handlers)
13: withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers))
14: withCallingHandlers(withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers)), warning = wHandler, error = eHandler, message = mHandler)
15: doTryCatch(return(expr), name, parentenv, handler)
16: tryCatchOne(expr, names, parentenv, handlers[[1L]])
17: tryCatchList(expr, classes, parentenv, handlers)
18: 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))})
19: try(f, silent = TRUE)
20: handle(ev <- withCallingHandlers(withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers)), warning = wHandler, error = eHandler, message = mHandler))
21: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers)), 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(), expr)
26: in_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)))
27: eng_r(options)
28: block_exec(params)
29: call_block(x)
30: process_group.block(group)
31: process_group(group)
32: 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"), ") ") })
33: process_file(text, output)
34: knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
35: rmarkdown::render(input, quiet = TRUE, envir = globalenv(), encoding = "UTF-8")
36: (function (input) { rmarkdown::render(input, quiet = TRUE, envir = globalenv(), encoding = "UTF-8")})(input = base::quote("lucid-carp_reprex.R"))
37: (function (what, args, quote = FALSE, envir = parent.frame()) { if (!is.list(args)) stop("second argument must be a list") if (quote) args <- lapply(args, enquote) .Internal(do.call(what, args, envir))})(base::quote(function (input) { rmarkdown::render(input, quiet = TRUE, envir = globalenv(), encoding = "UTF-8")}), base::quote(list(input = "lucid-carp_reprex.R")), envir = base::quote(<environment>), quote = base::quote(TRUE))
38: do.call(do.call, c(readRDS("/var/folders/wr/by_lst2d2fngf67mknmgf4340000gn/T//RtmpUhhrlN/callr-fun-12f869e2a770"), list(envir = .GlobalEnv, quote = TRUE)), envir = .GlobalEnv, quote = TRUE)
39: saveRDS(do.call(do.call, c(readRDS("/var/folders/wr/by_lst2d2fngf67mknmgf4340000gn/T//RtmpUhhrlN/callr-fun-12f869e2a770"), list(envir = .GlobalEnv, quote = TRUE)), envir = .GlobalEnv, quote = TRUE), file = "/var/folders/wr/by_lst2d2fngf67mknmgf4340000gn/T//RtmpUhhrlN/callr-res-12f867f5eaf21", compress = FALSE)
40: withCallingHandlers({ NULL saveRDS(do.call(do.call, c(readRDS("/var/folders/wr/by_lst2d2fngf67mknmgf4340000gn/T//RtmpUhhrlN/callr-fun-12f869e2a770"), list(envir = .GlobalEnv, quote = TRUE)), envir = .GlobalEnv, quote = TRUE), file = "/var/folders/wr/by_lst2d2fngf67mknmgf4340000gn/T//RtmpUhhrlN/callr-res-12f867f5eaf21", compress = FALSE) flush(stdout()) flush(stderr()) NULL invisible()}, error = function(e) { { callr_data <- as.environment("tools:callr")$`__callr_data__` err <- callr_data$err if (FALSE) { assign(".Traceback", .traceback(4), envir = callr_data) dump.frames("__callr_dump__") assign(".Last.dump", .GlobalEnv$`__callr_dump__`, envir = callr_data) rm("__callr_dump__", envir = .GlobalEnv) } e <- err$process_call(e) e2 <- err$new_error("error in callr subprocess") class(e2) <- c("callr_remote_error", class(e2)) e2 <- err$add_trace_back(e2) cut <- which(e2$trace$scope == "global")[1] if (!is.na(cut)) { e2$trace <- e2$trace[-(1:cut), ] } saveRDS(list("error", e2, e), file = paste0("/var/folders/wr/by_lst2d2fngf67mknmgf4340000gn/T//RtmpUhhrlN/callr-res-12f867f5eaf21", ".error")) }}, interrupt = function(e) { { callr_data <- as.environment("tools:callr")$`__callr_data__` err <- callr_data$err if (FALSE) { assign(".Traceback", .traceback(4), envir = callr_data) dump.frames("__callr_dump__") assign(".Last.dump", .GlobalEnv$`__callr_dump__`, envir = callr_data) rm("__callr_dump__", envir = .GlobalEnv) } e <- err$process_call(e) e2 <- err$new_error("error in callr subprocess") class(e2) <- c("callr_remote_error", class(e2)) e2 <- err$add_trace_back(e2) cut <- which(e2$trace$scope == "global")[1] if (!is.na(cut)) { e2$trace <- e2$trace[-(1:cut), ] } saveRDS(list("error", e2, e), file = paste0("/var/folders/wr/by_lst2d2fngf67mknmgf4340000gn/T//RtmpUhhrlN/callr-res-12f867f5eaf21", ".error")) }}, callr_message = function(e) { try(signalCondition(e))})
41: doTryCatch(return(expr), name, parentenv, handler)
42: tryCatchOne(expr, names, parentenv, handlers[[1L]])
43: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
44: doTryCatch(return(expr), name, parentenv, handler)
45: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), names[nh], parentenv, handlers[[nh]])
46: tryCatchList(expr, classes, parentenv, handlers)
47: tryCatch(withCallingHandlers({ NULL saveRDS(do.call(do.call, c(readRDS("/var/folders/wr/by_lst2d2fngf67mknmgf4340000gn/T//RtmpUhhrlN/callr-fun-12f869e2a770"), list(envir = .GlobalEnv, quote = TRUE)), envir = .GlobalEnv, quote = TRUE), file = "/var/folders/wr/by_lst2d2fngf67mknmgf4340000gn/T//RtmpUhhrlN/callr-res-12f867f5eaf21", compress = FALSE) flush(stdout()) flush(stderr()) NULL invisible()}, error = function(e) { { callr_data <- as.environment("tools:callr")$`__callr_data__` err <- callr_data$err if (FALSE) { assign(".Traceback", .traceback(4), envir = callr_data) dump.frames("__callr_dump__") assign(".Last.dump", .GlobalEnv$`__callr_dump__`, envir = callr_data) rm("__callr_dump__", envir = .GlobalEnv) } e <- err$process_call(e) e2 <- err$new_error("error in callr subprocess") class(e2) <- c("callr_remote_error", class(e2)) e2 <- err$add_trace_back(e2) cut <- which(e2$trace$scope == "global")[1] if (!is.na(cut)) { e2$trace <- e2$trace[-(1:cut), ] } saveRDS(list("error", e2, e), file = paste0("/var/folders/wr/by_lst2d2fngf67mknmgf4340000gn/T//RtmpUhhrlN/callr-res-12f867f5eaf21", ".error")) }}, interrupt = function(e) { { callr_data <- as.environment("tools:callr")$`__callr_data__` err <- callr_data$err if (FALSE) { assign(".Traceback", .traceback(4), envir = callr_data) dump.frames("__callr_dump__") assign(".Last.dump", .GlobalEnv$`__callr_dump__`, envir = callr_data) rm("__callr_dump__", envir = .GlobalEnv) } e <- err$process_call(e) e2 <- err$new_error("error in callr subprocess") class(e2) <- c("callr_remote_error", class(e2)) e2 <- err$add_trace_back(e2) cut <- which(e2$trace$scope == "global")[1] if (!is.na(cut)) { e2$trace <- e2$trace[-(1:cut), ] } saveRDS(list("error", e2, e), file = paste0("/var/folders/wr/by_lst2d2fngf67mknmgf4340000gn/T//RtmpUhhrlN/callr-res-12f867f5eaf21", ".error")) }}, callr_message = function(e) { try(signalCondition(e))}), error = function(e) { NULL try(stop(e))}, interrupt = function(e) { NULL e})
An irrecoverable exception occurred. R is aborting now ...
Probably duplicate of #120? Anyway, please try version 0.7-4, submitted to CRAN just now and will be circulated in a week or so.
Thanks. I just installed the development version and it indeed doesn't crash and instead gives an error.
Reprex:
This causes R Studio to crash. I'd expect it to throw an error.
System info:
OS: macOS 12.5 macbook pro 2.9 GHz 6-Core Intel Core i9 R version 4.2.0 RStudio version 2022.07.1 RPostgreSQL version: 0.7-3