Skip to content
Prev 10823 / 10988 Next

[Rcpp-devel] C++ issue only spotted by CRAN and not locally or via rhub

Dear all,

the "mclustAddons" R package contains some C++ functions included via Rcpp. 
It's not the first time I've done this and, although I'm not a C++ expert, I've been able to get it right thanks to the wonderful Rcpp facilities. 

Before submitting to CRAN the new version, I tested the package both locally (on MacOS - Intel machine) and via rhub on many platforms (debian, fedora, ubuntu, windows) with different versions of R (release, develop), including memory sanitizers/valgrind.
The "mclustAddons" package gives me no problems on any tested platform/version.
Unfortunately when I submit it to CRAN the problems start to arise. Below are the links to the log files:

- clang-ASAN <https://www.stats.ox.ac.uk/pub/bdr/memtests/clang-ASAN/mclustAddons>
- gcc-ASAN <https://www.stats.ox.ac.uk/pub/bdr/memtests/gcc-ASAN/mclustAddons>

After several e-mails with CRAN maintainers they suggest me to set up an environment to safely reproduce the ASAN reports:
See https://www.stats.ox.ac.uk/pub/bdr/memtests/README.txt
This of course would be the next thing to do, and I have already asked for help to colleagues at the Physics Dept. 

The code causing the problem is reported below and the offending line is the one with "xa = x.row(i) + a;". 
Since I can't replicate the issue and test it, I can't resubmit the package to CRAN.
Perhaps a C++ expert will spot the problem at first sight...

However, the main problem I have (with CRAN) is that, despite all the efforts that one can reasonably made, it is impossible for a maintainer of a package to be sure that the package will be tested correctly on CRAN. 

Thanks in advance for your help.

Luca