[Rcpp-devel] RcppEigen: Windows binary from CRAN crashes R, but not when installing from source.

Dirk Eddelbuettel edd at debian.org
Thu Oct 16 00:19:47 CEST 2014


(Headers once more corrected)

On 15 October 2014 at 14:53, Kevin Ushey wrote:
| 
| 
| 
| Hi Henrik,
| 
| Thanks for putting this together. FWIW, I cannot reproduce this error
| (either with `trigger()` or `no_trigger()`) on OS X, nor when building
| from source on a Windows VM (while inside RStudio).
| 
| I also tried running the address and undefined behavior sanitizers
| when executing the code and nothing was picked up.
| 
| Can you post the compiler output you get when using
| `devtools::load_all()` vs. a regular `R CMD INSTALL` ? I wonder if the
| compile flags are somehow different and if that could lead to a
| problem.
| 
| Can you also elaborate on how you can reproduce this on Linux? This is
| the environment we're most familiar with and so if we can reproduce
| there then we can most easily discover a solution. I wonder if using
| `gctorture(TRUE)` before running `trigger()` would make the assertion
| failure more likely.

I second Kevin's comments.  I have an outstanding request with Dortmund for
something regarding another package where I also suspect a configuration
issue; this may be as trivial as the Windows binary there being out of sync.

Your code seems fine.  Below is how I would write it, in a self-contained
short snippet you can just 'sourceCpp()' and which will even executed the
short R portion making it truly reproducible and self-contained.

It shows no issue.  This may be a one-off related to win-builder.

Thanks, Dirk



#include <RcppEigen.h>

using namespace Rcpp;

using Eigen::Map;
using Eigen::VectorXd;
using Eigen::RowVectorXd;
using Eigen::MatrixXd;

// [[Rcpp::depends(RcppEigen)]]

// [[Rcpp::export]]
int determinant2(int S, Map<MatrixXd> Ineq) {

    VectorXd thetaTMP = Rcpp::as<VectorXd>(rbeta(S, 0.5, 0.5));
    RowVectorXd theta = thetaTMP.transpose();

    VectorXd IneqT = (theta*Ineq.transpose());

    return 0;
}

/*** R
determinant2(2, matrix(1.0*(1:4),2,2))
*/


-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org


More information about the Rcpp-devel mailing list