[Rcpp-devel] Rstudio crashes with repeated calls to sourceCpp with Xptr export

Simon Barthelmé simon.barthelme at gipsa-lab.fr
Mon Sep 4 12:14:52 CEST 2017


Hi Helske

I've had this happen to me and if memory serves in my case it was due to 
a memory leak on the C++ side that didn't bother R too much but caused 
sourceCpp to crash. Maybe try valgrind?

Simon

On 04/09/2017 10:22, Helske, Jouni wrote:
>
> Hi,
>
>
> In the bssm package (https://github.com/helske/bssm), I let the users 
> define a state space model via own C++ functions which are then 
> exported as Xptr to R side, and passed back to C++ function for 
> SMC/MCMC etc. Normally this works fine, but when user repeatedly 
> modifies the model functions and re-exports them via repeated calls 
> sourceCpp, sometimes whole Rstudio crashes. I haven't been able to 
> pinpoint the reason or minimal example. Have anyone else experienced 
> similar issues or is it just me i.e. error in my own implementations?
>
>
> Simplest case of this is the discretized SDE models, this is the 
> function which user modifies: 
> https://github.com/helske/bssm/blob/master/vignettes/sde_functions.cpp, <https://github.com/helske/bssm/blob/master/vignettes/sde_functions.cpp>and 
> the relevant parts of the package codes are in 
> src/function_pointers.h, src/sde_ssm.cpp and src/R_sde.cpp (I don't 
> really expect anyone to read through all of these).
>
>
> Best,
>
>
> Jouni Helske
>
>
>
>
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20170904/dfa280ad/attachment.html>


More information about the Rcpp-devel mailing list