[Rcpp-devel] "Error during wrapup"

Kevin Ushey kevinushey at gmail.com
Tue May 27 23:46:51 CEST 2014


Hi John,

I think we may have tackled this in some of the latest fixes with the
version of Rcpp on GitHub. Can you try installing that version and
trying again? Ie, try

    install.packages(devtools); devtools::install_github("RcppCore/Rcpp")

then try running your code again.

Alternatively, please supply a small reproducible example that we can
try to run ourselves. You may be able to tease this error out
reproducibly if you run it with gctorture(TRUE) on.

Thanks,
Kevin

On Tue, May 27, 2014 at 2:42 PM, John Mous <john.mous0 at gmail.com> wrote:
> Hello,
>
> I am passing back a very simple std::map<std::string, int> from Rcpp as
> follows:
>
> std::map<std::string, int> result;
> result["X1"] = X1;
> result["X2"] = X2;
> result["X3"] = X3;
> result["X4"] = X4;
> return wrap(result);
>
> The keys are hardcoded as shown, and the values X1-X4 are ints. Almost
> always everything works fine, however, very intermittently, a vector is
> returned on the R side _without_ named fields. For example:
>
> Browse[1]> results
> [1]   1   2 863   0
> Error during wrapup: 'getCharCE' must be called on a CHARSXP
> Browse[1]> str(results)
>  atomic [1:4] 1 2 863 0
>  - attr(*, "")= symbol X1
>  - attr(*, "")= language `[[<-`(`*tmp*`, sim, value = 1L)
>
> results[[X1]] works, but results[["X1"]] does not, and X2-X4 can be
> retrieved only by index. However, again, most runs are successful:
>
> Browse[1]> results
>  X1  X2  X3  X4
>    1    1 3254    0
> Browse[1]> str(results)
>  Named int [1:4] 1 1 3254 0
>  - attr(*, "names")= chr [1:4] "X1" "X2" "X3" "X4"
>
>
> I am using R 3.1.0 and Rcpp 0.11.1. Does the message "Error during wrapup:
> 'getCharCE' must be called on a CHARSXP" within this context hint anything
> to anyone familiar with Rcpp's internals? I realize it's almost impossible
> to diagnose with the given information -- is there a way to get Rcpp to
> display more debugging information?
>
> Thank you.
>
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel


More information about the Rcpp-devel mailing list