Skip to content
Prev 9864 / 10988 Next

[Rcpp-devel] [RcppParallel] Segfault but only on TravisCI

The idea is indeed to avoid copying memory. I thought that doing something
like the following would allow me to read the values created in R from
within the threads:

Rcpp::NumericVector vec(vector_from_R);
std::vector<RcppParallel::RVector<double>> series;
series.push_back(RcppParallel::RVector<double>(vec));
// then in the threads:
double val = series[index_for_this_thread][0];

The data created on the R side is never modified by these functions, just
read. It is possible for different threads to read the same memory, but I
thought reading was not subject to race conditions.

The segfaults are very consistent, every OSX build fails with the same
error at the same point. The fact that it happens with clang++ but not with
gcc++ is puzzling to me.

The Rcpp::List may contain a lot of NumericVector or NumetricMatrix series,
so I would rather not copy all of them.
On Sat, Jan 20, 2018 at 2:46 PM, Dirk Eddelbuettel <edd at debian.org> wrote:

            
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20180120/949ba949/attachment.html>