[Rcpp-devel] ColDatum constructors memory safety

Douglas Bates bates at stat.wisc.edu
Wed Mar 17 16:06:01 CET 2010


On Wed, Mar 17, 2010 at 8:55 AM, Alistair Gee <alistair.gee at gmail.com> wrote:
> On Tue, Mar 16, 2010 at 5:49 PM, Dirk Eddelbuettel <edd at debian.org> wrote:
>>
>> On 16 March 2010 at 16:59, Alistair Gee wrote:
>> | Here are patches to RcppFrame.h:
>>
>> Sweet!  Thanks a lot!
>>
>> Now, just to top it off, could provide a unit test that would ideally trigger
>> the issue (or something related) pre-fix but not post-fix?
>>
>> Dirk
>
> I'm not sure how to write a test for this since it is triggered by C++
> code (as opposed to R code), and the bug was only noticeable (aside
> from occasional segfaults) when I inspected the code. What do you
> suggest?
>
> The code that I had that would trigger the problem was:
>
>   vector<ColDatum> colDatumVector(10);

The unit tests for Rcpp and derived packages typically use the inline
package and consist of a combination of C++ code and R code to check
the results.  See the directory Rcpp/inst/unitTests in the source
package.


More information about the Rcpp-devel mailing list