<div dir="ltr"><div>Hi Guys,  </div><div> </div><div>I embed a data list object of dgCMatrix elements (produced in the same manner as used in package, growfunctions) in an .RData file located in the sparseList \data folder. I'm not sure what script and data ASAN uses to conduct the memory check.  I'm guessing the package examples are run.  So I added an example that loads the .RData object embedded with this toy package, sparseList.  Please pardon me if my understanding is off.   I also embedd an R script in the single toy package .cpp file that generates the same data (list object of dgCMatrix objects created using R::Matrix) and runs an example.</div>
<div> </div><div>Terrance</div><div>​</div><br><div style="padding:5px;border:1px solid rgb(221,221,221);width:396px;height:18px;color:rgb(34,34,34);line-height:1;font-family:arial;font-size:13px;font-style:normal;font-weight:bold;max-height:18px;background-color:rgb(245,245,245)" class="gmail_chip gmail_drive_chip">
<a style="padding:1px 0px;border:currentColor;width:100%;overflow:hidden;text-decoration:none;display:inline-block;white-space:nowrap;text-overflow:ellipsis" href="https://docs.google.com/file/d/0B0DIDcaf6yMwUFI5VU5yX3NZY0MzanZNSVhTUVViblFXNkFv/edit?usp=drive_web" target="_blank"><img style="border: currentColor; vertical-align: bottom;" src="https://ssl.gstatic.com/docs/doclist/images/icon_10_generic_list.png"> <span style="color:rgb(17,85,204);text-decoration:none;vertical-align:bottom" dir="ltr">sparseList_1.1.tar.gz</span></a></div>
​</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Aug 9, 2014 at 3:02 PM, Kevin Ushey <span dir="ltr"><<a href="mailto:kevinushey@gmail.com" target="_blank">kevinushey@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Terrance,<br>
<br>
Can you please try to construct a reproducible example based on the<br>
(tagged, potentially offending) line of code -- that is,<br>
<br>
    #4 0x7f79b6541df0 in IGMRFDPMIX<br>
/data/gannet/ripley/R/packages/tests-49x/growfunctions/src/dpmix.cpp:63<br>
<br>
which has the line:<br>
<br>
    C(k,0)          = as<sp_mat>(Cr[k]);<br>
<br>
Can you construct a small, reproducible example using objects 'C',<br>
'Cr' as you construct in the package, and then see if that gives a<br>
similar error?<br>
<br>
Preferably you can construct this using Rcpp Attributes, so an example<br>
of the form<br>
<br>
    // [[Rcpp::depends(RcppArmadillo)]]<br>
<br>
    #include <RcppArmadillo.h><br>
    using namespace Rcpp;<br>
<br>
    // [[Rcpp::export]]<br>
    SEXP test(SEXP C, SEXP Cr) {<br>
      ... use C, Cr as above...<br>
    }<br>
<br>
    /*** R<br>
    ... construct C, Cr on the R side as necessary ...<br>
    */<br>
<br>
That way, we can 'sourceCpp' it and immediately investigate.<br>
<br>
Thanks,<br>
Kevin<br>
<div><br>
On Sat, Aug 9, 2014 at 11:31 AM, terrance savitsky <<a href="mailto:tds151@gmail.com">tds151@gmail.com</a>> wrote:<br>
> Dirk,  Thanks much for taking the time to investigate this issue.  I've<br>
> created a package (sparseList_1.0.tar.gz) with a minimal example of what<br>
> writing from a list of dgCMatrix matrices at the R layer to a field<sp_mat>.<br>
> I had intended to install boot2docker and use load your R-devel set-up to a<br>
> container so that I could replicate the ASAN-generated error.  Its taking me<br>
> longer than I'd hoped, however, so - for now - I include the package tarball<br>
> with the minimal example and also an R script (sparse_list_to_field.R) so<br>
> that you may see what the function does.<br>
> Terrance<br>
</div>>  sparse_list_to_field.R<br>
><br>
>  sparseList_1.0.tar.gz<br>
<div class="HOEnZb"><div class="h5">><br>
><br>
><br>
> On Sat, Aug 9, 2014 at 11:50 AM, Dirk Eddelbuettel <<a href="mailto:edd@debian.org">edd@debian.org</a>> wrote:<br>
>><br>
>><br>
>> Terrance,<br>
>><br>
>> So I took a look with one of the prebuilt versions of R using the Docker<br>
>> container I prepare (see the blog / sanitizers write-up I linked to) as I<br>
>> realized that we had a Rcpp Gallery post similar to what that as<><br>
>> conversion<br>
>> does.<br>
>><br>
>> And no issue with that code.<br>
>><br>
>> From a brief look at your package it seems like you are pushing the<br>
>> envelope<br>
>> a lot harder with fields and list of sparse matrices ( in dpmix.cpp, where<br>
>> another ASAN log pointed to ) so you may have to debug around there.<br>
>><br>
>> A small reproducible example would surely help us. So far I don't have one<br>
>> for as<sp_mat>.<br>
>><br>
>> Dirk<br>
>><br>
>> --<br>
>> <a href="http://dirk.eddelbuettel.com" target="_blank">http://dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="mailto:edd@debian.org">edd@debian.org</a><br>
><br>
><br>
><br>
><br>
</div></div><div class="HOEnZb"><div class="h5">> --<br>
> Thank you, Terrance Savitsky<br>
><br>
> _______________________________________________<br>
> Rcpp-devel mailing list<br>
> <a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a><br>
> <a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Thank you, Terrance Savitsky
</div>