<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Helske<br>
    <br>
    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? <br>
    <br>
    Simon<br>
    <br>
    <div class="moz-cite-prefix">On 04/09/2017 10:22, Helske, Jouni
      wrote:<br>
    </div>
    <blockquote cite="mid:5361c84cc698417bb7b0b56bd5342e51@jyu.fi"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
      <div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;"
        dir="ltr">
        <p><span id="ms-rterangepaste-start"></span></p>
        <p>Hi,</p>
        <p><br>
        </p>
        <p>In the bssm package (<a moz-do-not-send="true"
            href="https://github.com/helske/bssm" class="OWAAutoLink"
            id="LPlnk158659" previewremoved="true">https://github.com/helske/bssm</a>),
          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?</p>
        <p><br>
        </p>
        <p>Simplest case of this is the discretized SDE models, this is
          the function which user modifies:
          <a moz-do-not-send="true"
href="https://github.com/helske/bssm/blob/master/vignettes/sde_functions.cpp"
            class="OWAAutoLink" id="LPlnk922418" previewremoved="true">
            https://github.com/helske/bssm/blob/master/vignettes/sde_functions.cpp, 
          </a>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).</p>
        <br>
        <p>Best,</p>
        <p><br>
        </p>
        <p>Jouni Helske<br>
        </p>
        <span id="ms-rterangepaste-end"></span><br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Rcpp-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a>
<a class="moz-txt-link-freetext" href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a></pre>
    </blockquote>
    <br>
  </body>
</html>