Rcpp: Errors with Rcpp 1.0.6.3

Created on 20 Jan 2021  Â·  4Comments  Â·  Source: RcppCore/Rcpp

Hi!,

After updating from RcppCore to 1.0.6.3 I coudln't install last updates of ggstatsplot (0.6.8), statsExpressions (0.7.0), and tidyBF (0.4.3).
It appeared something like:

* installing *source* package ‘statsExpressions’ ...
** package ‘statsExpressions’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading

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

Traceback:
 1: Module(module, mustStart = TRUE, where = env)
 2: doTryCatch(return(expr), name, parentenv, handler)
 3: tryCatchOne(expr, names, parentenv, handlers[[1L]])
 4: tryCatchList(expr, classes, parentenv, handlers)
 5: tryCatch(Module(module, mustStart = TRUE, where = env), error = function(e) e)
 6: Rcpp::loadModule("class_model_base", what = TRUE)
 7: fun(libname, pkgname)
 8: doTryCatch(return(expr), name, parentenv, handler)
 9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
10: tryCatchList(expr, classes, parentenv, handlers)
11: tryCatch(fun(libname, pkgname), error = identity)
12: runHook(".onLoad", env, package.lib, package)
13: loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]])
14: namespaceImport(ns, loadNamespace(i, c(lib.loc, .libPaths()),     versionCheck = vI[[i]]), from = package)
15: loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]])
16: asNamespace(ns)
17: namespaceImportFrom(ns, loadNamespace(j <- i[[1L]], c(lib.loc,     .libPaths()), versionCheck = vI[[j]]), i[[2L]], from = package)
18: loadNamespace(package = package, lib.loc = lib.loc, keep.source = keep.source,     keep.parse.data = keep.parse.data, partial = TRUE)
19: withCallingHandlers(expr, packageStartupMessage = function(c) invokeRestart("muffleMessage"))
20: suppressPackageStartupMessages(loadNamespace(package = package,     lib.loc = lib.loc, keep.source = keep.source, keep.parse.data = keep.parse.data,     partial = TRUE))
21: code2LazyLoadDB(package, lib.loc = lib.loc, keep.source = keep.source,     keep.parse.data = keep.parse.data, compress = compress, set.install.dir = set.install.dir)
22: tools:::makeLazyLoading("statsExpressions", "/home/iago/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-statsExpressions/00new",     keep.source = FALSE, keep.parse.data = FALSE, set.install.dir = "/home/iago/R/x86_64-pc-linux-gnu-library/3.6/statsExpressions")
An irrecoverable exception occurred. R is aborting now ...
Segmentation fault

I could update them after reinstall Rcpp from CRAN.
Thank you!

Most helpful comment

Please see what I wrote to the rcpp-devel list today:

The Rcpp 1.0.6.2 and 1.0.6.3
versions seem to require a rebuild of packages involving rstan or StanHeaders
and/or maybe a few others. In reverse depedency checking I initially ran
into about 170 or so failures almost all from run-time behaviour of tests and
odd segfaults. But having just re-confirmed in the 1.0.6 release what we C++
programmers "know" that some 'weird' run-time issues do go away sometimes
under rebuilds, I opted to reinstall several hundred packages (which I had
not done in May, thinking my branch was doomed when in fact in wasn't) and
that addressed the concern[s].

The script compiledDeps.r can tell you which dependencies of your packages are compiled; I recommend taking a look and installing those. As I said, I am a little confused as _why_ this happens now but this does happen every now and then with C++ stacks (and yes we did change the API/ABI a little but I still didn't expect this).

So please try Rcpp 1.0.6.3 with rebuild stacks _especially when you see such run-time errors_ as the message above is from the 'can we load it?' phase of the rebuilt package.

All 4 comments

Please see what I wrote to the rcpp-devel list today:

The Rcpp 1.0.6.2 and 1.0.6.3
versions seem to require a rebuild of packages involving rstan or StanHeaders
and/or maybe a few others. In reverse depedency checking I initially ran
into about 170 or so failures almost all from run-time behaviour of tests and
odd segfaults. But having just re-confirmed in the 1.0.6 release what we C++
programmers "know" that some 'weird' run-time issues do go away sometimes
under rebuilds, I opted to reinstall several hundred packages (which I had
not done in May, thinking my branch was doomed when in fact in wasn't) and
that addressed the concern[s].

The script compiledDeps.r can tell you which dependencies of your packages are compiled; I recommend taking a look and installing those. As I said, I am a little confused as _why_ this happens now but this does happen every now and then with C++ stacks (and yes we did change the API/ABI a little but I still didn't expect this).

So please try Rcpp 1.0.6.3 with rebuild stacks _especially when you see such run-time errors_ as the message above is from the 'can we load it?' phase of the rebuilt package.

I coudln't install last updates of ggstatsplot (0.6.8), statsExpressions (0.7.0), and tidyBF (0.4.3).

Using compiledDeps.r I see all three depend on rstan. I'd start by rebuilding that.

I just confirmed that in a clean Docker container (using the r-base image we also maintainer as rocker/r-base). I first installed r-cran-rstan and its dependencies as binaries to quicken this, then install rstan (and RcppParallel and metaBMA) from source after which tidyBF installed cleanly as promised.

Closing this for lack of follow-up --- if you still have issues please reopen with a new example and sufficient detail to reproduce.

That said, I am still not happy that we need this recompilation of some packages and lack better diagnostics as to when we need it. But a simple recompilation seems to fix it.

Was this page helpful?
0 / 5 - 0 ratings