[Rcpp-devel] Passing pointers to objects between libs results in weird UBSAN warning

Jan van der Laan rhelp at eoos.dds.nl
Mon Aug 20 16:26:22 CEST 2018


Hi Dirk,

The suggestion of Iñaki has been changed in the github code and also the 
visitor stuff is not needed to trigger the exception.


On 20-08-18 16:01, Dirk Eddelbuettel wrote:

> 
> The only thought I had so far (and I had no time to play with the code) is to
> maybe wrap Rcpp::Shield<> around the XPtr object.

I have to say that I am currently on the subway with a spotty internet 
connection, so searching is hard, but I have trouble finding 
documentation for shield. From what I could find, it would call a 
PROTECT on contruction and UNPROTECT on destruction. Is that correct. 
Should I do that in pkg1 or pkg2?

Thanks.

Jan

> 
> Dirk
> 





More information about the Rcpp-devel mailing list