Running ‘testthat.R’ [21s/49s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(libgeos)
  > 
  > test_check("libgeos")
  
   *** caught segfault ***
  address 0, cause 'memory not mapped'
  
  Traceback:
   1: .Call(<pointer: f8a33670>, wkt, rethrow)
   2: wkt_validate_catch("NOPE2", rethrow = TRUE)
   3: eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   4: withCallingHandlers({    code    NULL}, error = function(cnd) {    if (can_entrace(cnd)) {        cnd <- cnd_entrace(cnd)    }    return_from(env, cnd)})
   5: .capture(act$val <- eval_bare(quo_get_expr(.quo), quo_get_env(.quo)),     ...)
   6: quasi_capture(enquo(object), label, capture_error, entrace = TRUE)
   7: expect_error(wkt_validate_catch("NOPE2", rethrow = TRUE), class = "std::exception")
   8: eval(code, test_env)
   9: eval(code, test_env)
  10: withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error)
  11: doTryCatch(return(expr), name, parentenv, handler)
  12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  13: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  14: doTryCatch(return(expr), name, parentenv, handler)
  15: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  16: tryCatchList(expr, classes, parentenv, handlers)
  17: tryCatch(withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error), error = handle_fatal,     skip = function(e) {    })
  18: test_code(desc, code, env = parent.frame())
  19: test_that("Rcpp error handler works without segfaulting", {    cache <- source_rcpp_libgeos("\n    // [[Rcpp::export]]\n    void wkt_validate_catch(CharacterVector wkt, bool rethrow) {\n      LibGEOSHandle handle;\n      LibGEOSWKTReader reader(handle);\n\n      try {\n        for (R_xlen_t i = 0; i < wkt.size(); i++) {\n          LibGEOSGeometry geom = reader.read(wkt[i]);\n        }\n      } catch(std::exception& e) {\n        if (rethrow) {\n          throw e;\n        } else {\n          Rcout << \"Converting error to stdout: \" << e.what();\n        }\n      }\n    }\n\n    // [[Rcpp::export]]\n    void wkt_validate(CharacterVector wkt) {\n      LibGEOSHandle handle;\n      LibGEOSWKTReader reader(handle);\n      for (R_xlen_t i = 0; i < wkt.size(); i++) {\n        LibGEOSGeometry geom = reader.read(wkt[i]);\n      }\n    }\n  ")    source_rcpp_libgeos_init()    expect_silent(wkt_validate_catch("POINT EMPTY", rethrow = FALSE))    expect_silent(wkt_validate_catch("POINT EMPTY", rethrow = TRUE))    expect_output(wkt_validate_catch("NOPE1", rethrow = FALSE),         "ParseException")    expect_error(wkt_validate_catch("NOPE2", rethrow = TRUE),         class = "std::exception")    expect_silent(wkt_validate("POINT EMPTY"))    expect_error(wkt_validate("NOPE3"), "ParseException", class = "LibGEOSRcppException")    unlink(cache, recursive = TRUE)})
  20: eval(code, test_env)
  21: eval(code, test_env)
  22: withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error)
  23: doTryCatch(return(expr), name, parentenv, handler)
  24: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  25: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  26: doTryCatch(return(expr), name, parentenv, handler)
  27: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  28: tryCatchList(expr, classes, parentenv, handlers)
  29: tryCatch(withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error), error = handle_fatal,     skip = function(e) {    })
  30: test_code(NULL, exprs, env)
  31: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  32: force(code)
  33: doWithOneRestart(return(expr), restart)
  34: withOneRestart(expr, restarts[[1L]])
  35: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  36: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter,     {        reporter$start_file(basename(path))        lister$start_file(basename(path))        source_file(path, new.env(parent = env), chdir = TRUE,             wrap = wrap)        reporter$.end_context()        reporter$end_file()    })
  37: FUN(X[[i]], ...)
  38: lapply(paths, test_file, env = env, reporter = current_reporter,     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  39: force(code)
  40: doWithOneRestart(return(expr), restart)
  41: withOneRestart(expr, restarts[[1L]])
  42: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  43: with_reporter(reporter = current_reporter, results <- lapply(paths,     test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE,     load_helpers = FALSE, wrap = wrap))
  44: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,     stop_on_warning = stop_on_warning, wrap = wrap)
  45: test_dir(path = test_path, reporter = reporter, env = env, filter = filter,     ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning,     wrap = wrap)
  46: test_package_dir(package = package, test_path = test_path, filter = filter,     reporter = reporter, ..., stop_on_failure = stop_on_failure,     stop_on_warning = stop_on_warning, wrap = wrap)
  47: test_check("libgeos")
  An irrecoverable exception occurred. R is aborting now ...