[R-pkg-devel] How to debug segfault when running build -> document in Rstudio that includes TMB module

Carl Schwarz c@chw@rz@t@t@|uc@ @end|ng |rom gm@||@com
Wed Jan 24 04:22:43 CET 2024


I'm trying to update my SPAS package to respond to a CRAN check. Before
starting the changes, I tried to rebuild my package, but now get a segfault
when I try to do a devtools::document() or devtools::check(args =
c('--as-cran')). See below for output from the Rstudio "Build" window.

I've
- reinstalled ALL packages
- reinstalled R (4.3.2 on MacOS Intel Chip)
- reinstalled Rstudio

When I try a rebuild/document on a sister package it runs fine, so I
suspect that the problem is related to using a TMB module that is part of
the SPAS package written in Cpp.

How do I start to "debug" this to identify the problem?

Thanks
Carl Schwarz




==> devtools::document(roclets = c('rd', 'collate', 'namespace', 'vignette'))
ℹ Updating SPAS documentationℹ Loading SPAS

 *** caught segfault ***
address 0x54e40, cause 'memory not mapped'

Traceback:
 1: dyn.load(dll_copy_file)
 2: library.dynam2(path, lib)
 3: load_dll(path)
 4: pkgload::load_all(path, helpers = FALSE, attach_testthat = FALSE)
 5: load_code(base_path)
 6: roxygen2::roxygenise(pkg$path, roclets)
 7: devtools::document(roclets = c("rd", "collate", "namespace",
"vignette"))
 8: withCallingHandlers(expr, packageStartupMessage = function(c)
tryInvokeRestart("muffleMessage"))
 9: suppressPackageStartupMessages({    oldLC <-
Sys.getlocale(category = "LC_COLLATE")    Sys.setlocale(category =
"LC_COLLATE", locale = "C")    on.exit(Sys.setlocale(category =
"LC_COLLATE", locale = oldLC))    devtools::document(roclets = c("rd",
"collate", "namespace",         "vignette"))})
An irrecoverable exception occurred. R is aborting now ...

Exited with status 139.

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list