[Rcpp-devel] Possible unprotected memory problems

Douglas Bates bates at stat.wisc.edu
Thu Jul 21 20:04:23 CEST 2011

On Thu, Jul 21, 2011 at 12:52 PM, Douglas Bates <bates at stat.wisc.edu> wrote:
> In testing this new version of lme4 based on RcppEigen, I have
> encountered what looks to be a memory protection problem.  Naturally
> it only occurs on the large examples but I may be able to provoke it
> with gctorture even for a small example.
> I'm using Rcpp Modules to expose some classes in C++.  The symptom is
> that suddenly, probably as the result of a garbage collection, the
> value of one of the methods jumps.  In this case the residuals
> suddenly appear to be zero.
> I'll start trying to track this but may end up running out of time as
> I have some presentations for the next few weeks to prepare.

This is probably my fault.  I was being careful to avoid copying some
large structures.  I used the Eigen::Map capability to share R's
storage but, unlike a case where the object in the C structure would
be a NumericVector or NumericMatrix, the contents of the R object were
not being protected because it would go out of scope.  I'll need to
rewrite that part of the logic.  Sorry for the false alarm.

More information about the Rcpp-devel mailing list