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

2018-01-20 Thread Dirk Eddelbuettel
On 20 January 2018 at 19:20, Alexis Sarda wrote: | After testing locally with clang, it seems the problem actually was that | there were different classes inheriting from RcppParallel::Worker in | different cpp files, but they all had the same names and the same | constructors, yet different logic

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

2018-01-20 Thread Alexis Sarda
After testing locally with clang, it seems the problem actually was that there were different classes inheriting from RcppParallel::Worker in different cpp files, but they all had the same names and the same constructors, yet different logic. There were no compilation warnings, but apparently clang

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

2018-01-20 Thread Dirk Eddelbuettel
On 20 January 2018 at 15:05, Alexis Sarda wrote: | 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> series; | series.

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

2018-01-20 Thread Alexis Sarda
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> series; series.push_back(RcppParallel::RVector(vec)); // then in the threads: d

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

2018-01-20 Thread Dirk Eddelbuettel
On 20 January 2018 at 12:45, Alexis Sarda wrote: | I've found out that the problem remains on OSX builds, and apparently it is | caused by clang itself. I used R-hub's fedora-clang-devel to test: | | https://artifacts.r-hub.io/dtwclust_5.1.0.9000.tar.gz-6f452fd6aeea4307921df2ab2337e6bb/dtwclust.

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

2018-01-20 Thread Alexis Sarda
I've found out that the problem remains on OSX builds, and apparently it is caused by clang itself. I used R-hub's fedora-clang-devel to test: https://artifacts.r-hub.io/dtwclust_5.1.0.9000.tar.gz-6f452fd6aeea4307921df2ab2337e6bb/dtwclust.Rcheck/00check.log The error that stands out to me is: **

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

2018-01-17 Thread Alexis Sarda
(I think I forgot to reply to all) I failed to mention that I am also using RcppArmadillo elsewhere, and I found the following post by the Coatless Professor saying that Armadillo requires at least gcc 4.7.2: http://thecoatlessprofessor.com/programming/r/selecting-an-a lternative-compiler-for-r-p

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

2018-01-17 Thread Kevin Ushey
In your RcppParallel worker, it looks like you're trying to write to an Rcpp matrix; e.g. you have: distmat_(i,j) = local_calculator->calculate(i,j); where distmat_ is a matrix. You should avoid using Rcpp classes within RcppParallel workers, as there's no guarantee that the methods available

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

2018-01-17 Thread Dirk Eddelbuettel
On 16 January 2018 at 21:02, Alexis Sarda wrote: | Hello, | | I am integrating RcppParallel into my R package and I'm running into | strange problems with segmentation faults, but only during the continuous | integration checks. I have essentially variations of the following (I hope | GitHub gist

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

2018-01-16 Thread Alexis Sarda
Hello, I am integrating RcppParallel into my R package and I'm running into strange problems with segmentation faults, but only during the continuous integration checks. I have essentially variations of the following (I hope GitHub gist links are ok): https://gist.github.com/asardaes/7d78af394f84