<div dir="ltr">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:<div><br></div><div><a href="https://artifacts.r-hub.io/dtwclust_5.1.0.9000.tar.gz-6f452fd6aeea4307921df2ab2337e6bb/dtwclust.Rcheck/00check.log">https://artifacts.r-hub.io/dtwclust_5.1.0.9000.tar.gz-6f452fd6aeea4307921df2ab2337e6bb/dtwclust.Rcheck/00check.log</a><br></div><div><br></div><div>The error that stands out to me is:</div><div><br></div><div><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">*** Error in `/opt/R-devel/lib64/R/bin/exec/R': corrupted double-linked list: 0x00000000099a3870 ***</pre></div><div><br></div><div>I am essentially doing a parallel distance matrix calculation as shown in the Rcpp gallery, but I have several distance functions. All the classes that provide distance calculations have a member wrapping std::vector of either RcppParallel's RVector<double>, RMatrix<double>, or Armadillo's cx_vec. Here's the template I'm using to wrap those members:</div><div><br></div><div><a href="https://github.com/asardaes/dtwclust/blob/master/src/utils/TSTSList.h">https://github.com/asardaes/dtwclust/blob/master/src/utils/TSTSList.h</a><br></div><div><br></div><div>Could the corruption be caused by this?</div><div><br></div><div>Regards,</div><div>Alexis.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 17, 2018 at 1:32 PM, Dirk Eddelbuettel <span dir="ltr"><<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
On 16 January 2018 at 21:02, Alexis Sarda wrote:<br>
| Hello,<br>
|<br>
| I am integrating RcppParallel into my R package and I'm running into<br>
| strange problems with segmentation faults, but only during the continuous<br>
| integration checks. I have essentially variations of the following (I hope<br>
| GitHub gist links are ok):<br>
|<br>
| <a href="https://gist.github.com/asardaes/7d78af394f848a967997ff23e433c9cf" rel="noreferrer" target="_blank">https://gist.github.com/<wbr>asardaes/<wbr>7d78af394f848a967997ff23e433c9<wbr>cf</a><br>
|<br>
| On TravisCI, my Linux builds simply freeze, and the OSX builds show<br>
| messages like:<br>
|<br>
| *** caught segfault ***<br>
| address 0x100000001, cause 'memory not mapped'<br>
|<br>
| I would assume that my distance functions are trying to access memory they<br>
| shouldn't, but during interactive use everything works flawlessly, and I've<br>
| tested all of the following with no problems (which also test correctness,<br>
| i.e. numeric consistency with respect to past results):<br>
|<br>
| - Local Linux R CMD check<br>
| - Local Windows R CMD check<br>
| - CRAN's WinBuilder check<br>
| - AppVeyor (x32 and x64 Windows)<br>
| - Docker R CMD check using rocker's r-devel-san<br>
| - Local Linux R CMD check with valgrind (no leaks)<br>
|<br>
| It is worth mentioning that some of the examples ran during the OSX build<br>
| show incorrect results long before the segfault occurs: some results are<br>
| zero when they shouldn't be. I don't have access to a machine with OSX, but<br>
| the Linux builds in TravisCI also show problems (no segfaults explicitly,<br>
| just hangs).<br>
|<br>
| I am at my wit's end. Any input would be appreciated.<br>
<br>
</div></div>Hard to tell for us, but maybe try the old and trusted route of smaller and<br>
smaller reproducible examples til you reproduce it?<br>
<br>
Or else if it _just_ Travis CI maybe it is a compiler version issue?  Travis<br>
is very conservative in its default setup but there are .travis.yaml scripts<br>
out there that turn on the PPA for compiler builds giving you gcc-5, gcc-6,<br>
... amd different clang versions.<br>
<span class="HOEnZb"><font color="#888888"><br>
Dirk<br>
<br>
--<br>
<a href="http://dirk.eddelbuettel.com" rel="noreferrer" target="_blank">http://dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="mailto:edd@debian.org">edd@debian.org</a><br>
</font></span></blockquote></div><br></div>