[Rcpp-devel] Rcpp example that crashes on 64 bit Windows

Rajen Shah rds37 at cam.ac.uk
Thu Aug 11 13:28:56 CEST 2016


Hello,

I am having trouble debugging a package that appears to work fine on Mac
operating systems but crashes on Unix and Windows.

I have found the following example that crashes on my Windows setup
(session info copied below)

IntegerVector runif_int2() {
  return wrap(floor(runif(1000000)));
}

When this is called about 5-10 times in succession R crashes (e.g. with
set.seed(1), but this doesn't seem to matter).

Any ideas about why this crashes would be much appreciated. To be clear, I
am not looking for an alternative to the above code (which simply produces
a vector of zeroes), but would like to know what aspects of this cause a
crash so I know what code structures may be causing problems in the package
I am creating. The code does not appear to crash on Mac and I have yet to
try it on Unix.

Many thanks in advance,

Rajen

Session info:

R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United
States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United
States.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] tools_3.3.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20160811/6cdb8ac5/attachment.html>


More information about the Rcpp-devel mailing list