<div dir="ltr"><div>Hello Rcpp Developers,  I had earlier forwarded a report that initialization of arma::SpMat objects through as<arma::spmat>() in my package generated a memory management fault in valgrind for my package, growfunctions.   The issue was sourced (not by me) and a fix was incoporated at RcppArmadillo version 0.4.400 (and I am now using 0.4.550.1.0 in this latest build).  I will remove use of the SpMat type from my package as it is not extensively employed, but perhaps the issue warrants further investigation for RcppArmadillo.   </div><div> </div><div>Thank you,  Terrance Savitsky <br></div><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Prof Brian Ripley</b> <span dir="ltr"><<a href="mailto:ripley@stats.ox.ac.uk">ripley@stats.ox.ac.uk</a>></span><br>Date: Mon, Dec 8, 2014 at 5:33 PM<br>Subject: Re: CRAN submission growfunctions 0.12<br>To: Terrance Savitsky <<a href="mailto:tds151@gmail.com">tds151@gmail.com</a>>, CRAN <<a href="mailto:cran@r-project.org">cran@r-project.org</a>><br><br><br><div class="HOEnZb"><div class="h5">On 08/12/2014 22:04, Prof Brian Ripley wrote:<br>
<blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote"><br>
</blockquote></div></div>
And valgrind is still reporting issues in Armadillo, e.g.<br>
<br>
==30106== Conditional jump or move depends on uninitialised value(s)==30106==    at 0x15EE8D9A: operator!= (test-3.2/RcppArmadillo/<u></u>include/armadillo_bits/SpMat_<u></u>iterators_meat.hpp:239)<br>
==30106==    by 0x15EE8D9A: arma::enable_if2<(arma::is_<u></u>arma_type<arma::Gen<arma::Mat<<u></u>double>, arma::gen_ones_diag> >::value&&arma::is_arma_<u></u>sparse_type<arma::SpM<br>
at<double> >::value)&&arma::is_same_type<<u></u>arma::Gen<arma::Mat<double>, arma::gen_ones_diag>::elem_<u></u>type, arma::SpMat<double>::elem_<u></u>type>::value, arma::Mat<arma::Gen<arma::Mat<<u></u>double>, arma::gen_ones_diag>::elem_<u></u>type> >::result arma::operator-<br>
<arma::Gen<arma::Mat<double>, arma::gen_ones_diag>, arma::SpMat<double> >(arma::Gen<arma::Mat<double>, arma::gen_ones_diag> const&, arma::SpMat<double> const&)<br>
(test-3.2/RcppArmadillo/<u></u>include/armadillo_bits/<u></u>operator_minus.hpp:281)<br>
==30106==    by 0x15EE0FB1: IGMRFDPMIX (packages/incoming/<u></u>growfunctions.Rcheck/00_pkg_<u></u>src/growfunctions/src/dpmix.<u></u>cpp:66)<br>
==30106==    by 0x480C3C: R_doDotCall (svn/R-devel/src/main/dotcode.<u></u>c:655)<br>
==30106==    by 0x48158F: do_dotcall (svn/R-devel/src/main/dotcode.<u></u>c:1251)<br>
<br>
/main/eval.c:2034)==30106==  Uninitialised value was created by a heap allocation<br>
==30106==    at 0x4A09190: memalign (/data/gannet/ripley/Sources/<u></u>srcF20/valgrind-3.10.1/<u></u>coregrind/m_replacemalloc/vg_<u></u>replace_malloc.c:760)<br>
==30106==    by 0x4A092A7: posix_memalign (/data/gannet/ripley/Sources/<u></u>srcF20/valgrind-3.10.1/<u></u>coregrind/m_replacemalloc/vg_<u></u>replace_malloc.c:913)<br>
==30106==    by 0x15EECC85: acquire<unsigned int> (test-3.2/RcppArmadillo/includ<br>
e/armadillo_bits/memory.hpp:<u></u>75)<br>
==30106==    by 0x15EECC85: acquire_chunked<unsigned int> (test-3.2/RcppArmadill<br>
o/include/armadillo_bits/<u></u>memory.hpp:111)<br>
==30106==    by 0x15EECC85: Rcpp::traits::Exporter<arma::<u></u>SpMat<double> >::get()<br>
(test-3.2/RcppArmadillo/<u></u>include/RcppArmadilloAs.h:101)<br>
==30106==    by 0x15EE1096: as<arma::SpMat<double> > (test-3.2/Rcpp/include/Rcpp<br>
/as.h:81)<br>
==30106==    by 0x15EE1096: as<arma::SpMat<double> > (test-3.2/Rcpp/include/Rcpp/<u></u>as.h:144)<br>
==30106==    by 0x15EE1096: IGMRFDPMIX (packages/incoming/<u></u>growfunctions.Rcheck/00_pkg_<u></u>src/growfunctions/src/dpmix.<u></u>cpp:63)<br>
==30106==    by 0x480C3C: R_doDotCall (svn/R-devel/src/main/dotcode.<u></u>c:655)<br>
==30106==    by 0x48158F: do_dotcall (svn/R-devel/src/main/dotcode.<u></u>c:1251)<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
-- <br>
Brian D. Ripley,                  <a href="mailto:ripley@stats.ox.ac.uk" target="_blank">ripley@stats.ox.ac.uk</a><br>
Emeritus Professor of Applied Statistics, University of Oxford<br>
1 South Parks Road, Oxford OX1 3TG, UK<br>
</div></div></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Thank you, Terrance Savitsky</div>
</div>