Git Product home page Git Product logo

Comments (23)

gvegayon avatar gvegayon commented on June 12, 2024 1

Yes, I've checked, and the thing is that it works pre #91 and post #91, so it was not fixed with #91 since, as it was mentioned here, was not an issue of RcppArmadillo (sorry for the confusion!). On the other hand, I did experienced this issue with SpMat objects and iterators (Conditional jump...) which was fixed with #91.

from rcpparmadillo.

eddelbuettel avatar eddelbuettel commented on June 12, 2024

Thanks for all that work. The issue might be your use of libRlapack.so which is a reduced LAPACK shipped by R. On OS X and Linux most builds will automatically use the 'real' system LAPACK library.

from rcpparmadillo.

eddelbuettel avatar eddelbuettel commented on June 12, 2024

Here is a one-file version of your code. When you sourceCpp() it, it will execute the R piece at the bottom.

#include <RcppArmadillo.h>
// [[Rcpp::depends(RcppArmadillo)]]

using namespace Rcpp;

// [[Rcpp::export]]
NumericMatrix arma_inv(const arma::mat& X) {
  // this works fine
  arma::mat res = arma::inv(X);
  return wrap(res);
}


// [[Rcpp::export]]
NumericMatrix arma_inv_sympd(const arma::mat& X) {
  // this gives errors in valgrind
  arma::mat res = arma::inv_sympd(X);
  return wrap(res);
}

/*** R
##library(debugpkg)
set.seed(123)
X <- crossprod(matrix(rnorm(25),5,5))

# this works fine
arma_inv(X)

# this works seeminly fine but valgrind gives an error
arma_inv_sympd(X)
*/

from rcpparmadillo.

eddelbuettel avatar eddelbuettel commented on June 12, 2024

And here is the program running above on my Linux 64 bit system with the same Valgrind call and no issues:

edd@max:~$ R -d "valgrind --tool=memcheck --leak-check=full --track-origins=yes" --vanilla -e 'library(Rcpp); sourceCpp("/tmp/armaIssue72.cpp")'
==11801== Memcheck, a memory error detector
==11801== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==11801== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==11801== Command: /usr/lib/R/bin/exec/R --vanilla -e library(Rcpp);~+~sourceCpp("/tmp/armaIssue72.cpp")
==11801== 

R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(Rcpp); sourceCpp("/tmp/armaIssue72.cpp")

> set.seed(123)

> X <- crossprod(matrix(rnorm(25), 5, 5))

> arma_inv(X)
          [,1]       [,2]       [,3]       [,4]      [,5]
[1,] 166.59171  54.847240 -83.687938  69.901724 18.774028
[2,]  54.84724  19.031467 -28.314272  22.515022  5.733955
[3,] -83.68794 -28.314272  43.680000 -34.961842 -8.592805
[4,]  69.90172  22.515022 -34.961842  29.764602  8.004206
[5,]  18.77403   5.733955  -8.592805   8.004206  2.866702

> arma_inv_sympd(X)
==11801== Conditional jump or move depends on uninitialised value(s)
==11801==    at 0xE53DB76: inv_sympd<double, arma::Mat<double> > (auxlib_meat.hpp:421)
==11801==    by 0xE53DB76: apply<arma::Mat<double> > (op_inv_meat.hpp:146)
==11801==    by 0xE53DB76: Mat<arma::Mat<double>, arma::op_inv_sympd> (Mat_meat.hpp:4549)
==11801==    by 0xE53DB76: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:17)
==11801==    by 0xE53E278: sourceCpp_0_arma_inv_sympd (armaIssue72.cpp:53)
==11801==    by 0x4F09947: do_dotcall (dotcode.c:1251)
==11801==    by 0x4F45107: Rf_eval (eval.c:655)
==11801==    by 0x4F4A908: Rf_applyClosure (eval.c:1045)
==11801==    by 0x4F44CEE: Rf_eval (eval.c:674)
==11801==    by 0x4F45D61: do_eval (eval.c:2477)
==11801==    by 0x4F390BE: bcEval (eval.c:5491)
==11801==    by 0x4F44B6F: Rf_eval (eval.c:558)
==11801==    by 0x4F4A908: Rf_applyClosure (eval.c:1045)
==11801==    by 0x4F3E1AF: bcEval (eval.c:5463)
==11801==    by 0x4F44B6F: Rf_eval (eval.c:558)
==11801==  Uninitialised value was created by a stack allocation
==11801==    at 0xE53D9A6: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:15)
==11801== 
          [,1]       [,2]       [,3]       [,4]      [,5]
[1,] 166.59171  54.847240 -83.687938  69.901724 18.774028
[2,]  54.84724  19.031467 -28.314272  22.515022  5.733955
[3,] -83.68794 -28.314272  43.680000 -34.961842 -8.592805
[4,]  69.90172  22.515022 -34.961842  29.764602  8.004206
[5,]  18.77403   5.733955  -8.592805   8.004206  2.866702
> 
> 
==11801== 
==11801== HEAP SUMMARY:
==11801==     in use at exit: 36,578,283 bytes in 17,237 blocks
==11801==   total heap usage: 46,948 allocs, 29,711 frees, 74,010,480 bytes allocated
==11801== 
==11801== LEAK SUMMARY:
==11801==    definitely lost: 0 bytes in 0 blocks
==11801==    indirectly lost: 0 bytes in 0 blocks
==11801==      possibly lost: 0 bytes in 0 blocks
==11801==    still reachable: 36,578,283 bytes in 17,237 blocks
==11801==         suppressed: 0 bytes in 0 blocks
==11801== Reachable blocks (those to which a pointer was found) are not shown.
==11801== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==11801== 
==11801== For counts of detected and suppressed errors, rerun with: -v
==11801== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
edd@max:~$ 

from rcpparmadillo.

eddelbuettel avatar eddelbuettel commented on June 12, 2024

Could you try an R built with system LAPACK too, please?

I use the Michael Rutter builds on Ubuntu which correspond to my Debian packages. Either variant should be fine. You can even try Docker...

(Congrats by the way on getting seqHMM onto CRAN. Looks like a great package I should take a closer look at.)

from rcpparmadillo.

eddelbuettel avatar eddelbuettel commented on June 12, 2024

Oh, missed that:

RHEL7 using R version 3.2.2

If you need help building R on RH let me know. It's been several years since I needed to use those repos. Are you using a prebuilt version? In which case we should talk to the maintainer to not rely on the Rlapack build ? If it is a local build I am sure we can assist you or your sysadmin in making a better built.

from rcpparmadillo.

helske avatar helske commented on June 12, 2024

Yes I did use prebuilt R installed via yum. I now compiled latest R (3.2.3) by myself with ./configure --enable-memory-profiling which if I understand correctly still uses R supplied. With this I still get same errors, expect that the reference is now to blas.f and lapack.f instead of libRblas.so and libRlapack.so.

I then compiled R with ./configure --with-blas --with-lapack --enable-memory-profiling. I get this:

R is now configured for x86_64-pc-linux-gnu

  Source directory:          .
  Installation directory:    /home/R323

  C compiler:                gcc -std=gnu99  -g -O2
  Fortran 77 compiler:       gfortran  -g -O2

  C++ compiler:              g++  -g -O2
  C++ 11 compiler:           g++  -std=c++11 -g -O2
  Fortran 90/95 compiler:    gfortran -g -O2
  Obj-C compiler:         

  Interfaces supported:      X11, tcltk
  External libraries:        readline, BLAS(generic), LAPACK(generic), zlib, bzlib, lzma, PCRE, curl
  Additional capabilities:   PNG, NLS, ICU
  Options enabled:           R profiling, memory profiling

  Capabilities skipped:      JPEG, TIFF, cairo
  Options not enabled:       shared BLAS

  Recommended packages:      yes

I then installed Rcpp, RcppArmadillo and all their dependencies, and RcppArmadillo states:

* checking LAPACK_LIBS: system LAPACK found

So everything should be okay. I then ran the same valgrind script (using your "slightly" more easier way), and I again I get the same errors:

[jovetale@mad-325-04 git_repos]$ R -d "valgrind --tool=memcheck --leak-check=full --track-origins=yes" --vanilla -e 'library(Rcpp); sourceCpp("armaIssue72.cpp")'
==6198== Memcheck, a memory error detector
==6198== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==6198== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==6198== Command: /home/R323/lib64/R/bin/exec/R --vanilla -e library(Rcpp);~+~sourceCpp("armaIssue72.cpp")
==6198== 

R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(Rcpp); sourceCpp("armaIssue72.cpp")

> set.seed(123)

> X <- crossprod(matrix(rnorm(25), 5, 5))

> arma_inv(X)
          [,1]       [,2]       [,3]       [,4]      [,5]
[1,] 166.59171  54.847240 -83.687938  69.901724 18.774028
[2,]  54.84724  19.031467 -28.314272  22.515022  5.733955
[3,] -83.68794 -28.314272  43.680000 -34.961842 -8.592805
[4,]  69.90172  22.515022 -34.961842  29.764602  8.004206
[5,]  18.77403   5.733955  -8.592805   8.004206  2.866702

> arma_inv_sympd(X)
==6198== Conditional jump or move depends on uninitialised value(s)
==6198==    at 0x4E8969D: lsame_ (in /usr/lib64/libblas.so.3.4.2)
==6198==    by 0x138A2604: dpotrf_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x153DAE4D: potrf<double> (wrapper_lapack.hpp:353)
==6198==    by 0x153DAE4D: inv_sympd<double, arma::Mat<double> > (auxlib_meat.hpp:426)
==6198==    by 0x153DAE4D: apply<arma::Mat<double> > (op_inv_meat.hpp:146)
==6198==    by 0x153DAE4D: Mat<arma::Mat<double>, arma::op_inv_sympd> (Mat_meat.hpp:4549)
==6198==    by 0x153DAE4D: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:17)
==6198==    by 0x153DB417: sourceCpp_0_arma_inv_sympd (armaIssue72.cpp:53)
==6198==    by 0x47FB37: do_dotcall (dotcode.c:1251)
==6198==    by 0x4BC4DE: Rf_eval (eval.c:655)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==    by 0x4BC178: Rf_eval (eval.c:674)
==6198==    by 0x4C09E7: do_eval (eval.c:2477)
==6198==    by 0x4AE751: bcEval (eval.c:5491)
==6198==    by 0x4BC01F: Rf_eval (eval.c:558)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==  Uninitialised value was created by a stack allocation
==6198==    at 0x153DAD15: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:15)
==6198== 
==6198== Conditional jump or move depends on uninitialised value(s)
==6198==    at 0x138A260A: dpotrf_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x153DAE4D: potrf<double> (wrapper_lapack.hpp:353)
==6198==    by 0x153DAE4D: inv_sympd<double, arma::Mat<double> > (auxlib_meat.hpp:426)
==6198==    by 0x153DAE4D: apply<arma::Mat<double> > (op_inv_meat.hpp:146)
==6198==    by 0x153DAE4D: Mat<arma::Mat<double>, arma::op_inv_sympd> (Mat_meat.hpp:4549)
==6198==    by 0x153DAE4D: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:17)
==6198==    by 0x153DB417: sourceCpp_0_arma_inv_sympd (armaIssue72.cpp:53)
==6198==    by 0x47FB37: do_dotcall (dotcode.c:1251)
==6198==    by 0x4BC4DE: Rf_eval (eval.c:655)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==    by 0x4BC178: Rf_eval (eval.c:674)
==6198==    by 0x4C09E7: do_eval (eval.c:2477)
==6198==    by 0x4AE751: bcEval (eval.c:5491)
==6198==    by 0x4BC01F: Rf_eval (eval.c:558)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==    by 0x4B4115: bcEval (eval.c:5463)
==6198==  Uninitialised value was created by a stack allocation
==6198==    at 0x153DAD15: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:15)
==6198== 
==6198== Conditional jump or move depends on uninitialised value(s)
==6198==    at 0x4E8969D: lsame_ (in /usr/lib64/libblas.so.3.4.2)
==6198==    by 0x138A29FA: dpotrf_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x153DAE4D: potrf<double> (wrapper_lapack.hpp:353)
==6198==    by 0x153DAE4D: inv_sympd<double, arma::Mat<double> > (auxlib_meat.hpp:426)
==6198==    by 0x153DAE4D: apply<arma::Mat<double> > (op_inv_meat.hpp:146)
==6198==    by 0x153DAE4D: Mat<arma::Mat<double>, arma::op_inv_sympd> (Mat_meat.hpp:4549)
==6198==    by 0x153DAE4D: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:17)
==6198==    by 0x153DB417: sourceCpp_0_arma_inv_sympd (armaIssue72.cpp:53)
==6198==    by 0x47FB37: do_dotcall (dotcode.c:1251)
==6198==    by 0x4BC4DE: Rf_eval (eval.c:655)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==    by 0x4BC178: Rf_eval (eval.c:674)
==6198==    by 0x4C09E7: do_eval (eval.c:2477)
==6198==    by 0x4AE751: bcEval (eval.c:5491)
==6198==    by 0x4BC01F: Rf_eval (eval.c:558)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==  Uninitialised value was created by a stack allocation
==6198==    at 0x153DAD15: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:15)
==6198== 
==6198== Conditional jump or move depends on uninitialised value(s)
==6198==    at 0x4E8969D: lsame_ (in /usr/lib64/libblas.so.3.4.2)
==6198==    by 0x138A1FAC: dpotf2_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x138A2A4D: dpotrf_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x153DAE4D: potrf<double> (wrapper_lapack.hpp:353)
==6198==    by 0x153DAE4D: inv_sympd<double, arma::Mat<double> > (auxlib_meat.hpp:426)
==6198==    by 0x153DAE4D: apply<arma::Mat<double> > (op_inv_meat.hpp:146)
==6198==    by 0x153DAE4D: Mat<arma::Mat<double>, arma::op_inv_sympd> (Mat_meat.hpp:4549)
==6198==    by 0x153DAE4D: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:17)
==6198==    by 0x153DB417: sourceCpp_0_arma_inv_sympd (armaIssue72.cpp:53)
==6198==    by 0x47FB37: do_dotcall (dotcode.c:1251)
==6198==    by 0x4BC4DE: Rf_eval (eval.c:655)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==    by 0x4BC178: Rf_eval (eval.c:674)
==6198==    by 0x4C09E7: do_eval (eval.c:2477)
==6198==    by 0x4AE751: bcEval (eval.c:5491)
==6198==    by 0x4BC01F: Rf_eval (eval.c:558)
==6198==  Uninitialised value was created by a stack allocation
==6198==    at 0x153DAD15: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:15)
==6198== 
==6198== Conditional jump or move depends on uninitialised value(s)
==6198==    at 0x138A1FB2: dpotf2_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x138A2A4D: dpotrf_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x153DAE4D: potrf<double> (wrapper_lapack.hpp:353)
==6198==    by 0x153DAE4D: inv_sympd<double, arma::Mat<double> > (auxlib_meat.hpp:426)
==6198==    by 0x153DAE4D: apply<arma::Mat<double> > (op_inv_meat.hpp:146)
==6198==    by 0x153DAE4D: Mat<arma::Mat<double>, arma::op_inv_sympd> (Mat_meat.hpp:4549)
==6198==    by 0x153DAE4D: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:17)
==6198==    by 0x153DB417: sourceCpp_0_arma_inv_sympd (armaIssue72.cpp:53)
==6198==    by 0x47FB37: do_dotcall (dotcode.c:1251)
==6198==    by 0x4BC4DE: Rf_eval (eval.c:655)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==    by 0x4BC178: Rf_eval (eval.c:674)
==6198==    by 0x4C09E7: do_eval (eval.c:2477)
==6198==    by 0x4AE751: bcEval (eval.c:5491)
==6198==    by 0x4BC01F: Rf_eval (eval.c:558)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==  Uninitialised value was created by a stack allocation
==6198==    at 0x153DAD15: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:15)
==6198== 
==6198== Conditional jump or move depends on uninitialised value(s)
==6198==    at 0x4E8969D: lsame_ (in /usr/lib64/libblas.so.3.4.2)
==6198==    by 0x138A22EA: dpotf2_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x138A2A4D: dpotrf_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x153DAE4D: potrf<double> (wrapper_lapack.hpp:353)
==6198==    by 0x153DAE4D: inv_sympd<double, arma::Mat<double> > (auxlib_meat.hpp:426)
==6198==    by 0x153DAE4D: apply<arma::Mat<double> > (op_inv_meat.hpp:146)
==6198==    by 0x153DAE4D: Mat<arma::Mat<double>, arma::op_inv_sympd> (Mat_meat.hpp:4549)
==6198==    by 0x153DAE4D: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:17)
==6198==    by 0x153DB417: sourceCpp_0_arma_inv_sympd (armaIssue72.cpp:53)
==6198==    by 0x47FB37: do_dotcall (dotcode.c:1251)
==6198==    by 0x4BC4DE: Rf_eval (eval.c:655)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==    by 0x4BC178: Rf_eval (eval.c:674)
==6198==    by 0x4C09E7: do_eval (eval.c:2477)
==6198==    by 0x4AE751: bcEval (eval.c:5491)
==6198==    by 0x4BC01F: Rf_eval (eval.c:558)
==6198==  Uninitialised value was created by a stack allocation
==6198==    at 0x153DAD15: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:15)
==6198== 
==6198== Conditional jump or move depends on uninitialised value(s)
==6198==    at 0x138A205E: dpotf2_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x138A2A4D: dpotrf_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x153DAE4D: potrf<double> (wrapper_lapack.hpp:353)
==6198==    by 0x153DAE4D: inv_sympd<double, arma::Mat<double> > (auxlib_meat.hpp:426)
==6198==    by 0x153DAE4D: apply<arma::Mat<double> > (op_inv_meat.hpp:146)
==6198==    by 0x153DAE4D: Mat<arma::Mat<double>, arma::op_inv_sympd> (Mat_meat.hpp:4549)
==6198==    by 0x153DAE4D: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:17)
==6198==    by 0x153DB417: sourceCpp_0_arma_inv_sympd (armaIssue72.cpp:53)
==6198==    by 0x47FB37: do_dotcall (dotcode.c:1251)
==6198==    by 0x4BC4DE: Rf_eval (eval.c:655)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==    by 0x4BC178: Rf_eval (eval.c:674)
==6198==    by 0x4C09E7: do_eval (eval.c:2477)
==6198==    by 0x4AE751: bcEval (eval.c:5491)
==6198==    by 0x4BC01F: Rf_eval (eval.c:558)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==  Uninitialised value was created by a stack allocation
==6198==    at 0x153DAD15: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:15)
==6198== 
==6198== Conditional jump or move depends on uninitialised value(s)
==6198==    at 0x4E8969D: lsame_ (in /usr/lib64/libblas.so.3.4.2)
==6198==    by 0x138A2DA7: dpotri_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x153DAEB8: potri<double> (wrapper_lapack.hpp:388)
==6198==    by 0x153DAEB8: inv_sympd<double, arma::Mat<double> > (auxlib_meat.hpp:431)
==6198==    by 0x153DAEB8: apply<arma::Mat<double> > (op_inv_meat.hpp:146)
==6198==    by 0x153DAEB8: Mat<arma::Mat<double>, arma::op_inv_sympd> (Mat_meat.hpp:4549)
==6198==    by 0x153DAEB8: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:17)
==6198==    by 0x153DB417: sourceCpp_0_arma_inv_sympd (armaIssue72.cpp:53)
==6198==    by 0x47FB37: do_dotcall (dotcode.c:1251)
==6198==    by 0x4BC4DE: Rf_eval (eval.c:655)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==    by 0x4BC178: Rf_eval (eval.c:674)
==6198==    by 0x4C09E7: do_eval (eval.c:2477)
==6198==    by 0x4AE751: bcEval (eval.c:5491)
==6198==    by 0x4BC01F: Rf_eval (eval.c:558)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==  Uninitialised value was created by a stack allocation
==6198==    at 0x153DAD15: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:15)
==6198== 
==6198== Conditional jump or move depends on uninitialised value(s)
==6198==    at 0x138A2DAA: dpotri_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x153DAEB8: potri<double> (wrapper_lapack.hpp:388)
==6198==    by 0x153DAEB8: inv_sympd<double, arma::Mat<double> > (auxlib_meat.hpp:431)
==6198==    by 0x153DAEB8: apply<arma::Mat<double> > (op_inv_meat.hpp:146)
==6198==    by 0x153DAEB8: Mat<arma::Mat<double>, arma::op_inv_sympd> (Mat_meat.hpp:4549)
==6198==    by 0x153DAEB8: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:17)
==6198==    by 0x153DB417: sourceCpp_0_arma_inv_sympd (armaIssue72.cpp:53)
==6198==    by 0x47FB37: do_dotcall (dotcode.c:1251)
==6198==    by 0x4BC4DE: Rf_eval (eval.c:655)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==    by 0x4BC178: Rf_eval (eval.c:674)
==6198==    by 0x4C09E7: do_eval (eval.c:2477)
==6198==    by 0x4AE751: bcEval (eval.c:5491)
==6198==    by 0x4BC01F: Rf_eval (eval.c:558)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==    by 0x4B4115: bcEval (eval.c:5463)
==6198==  Uninitialised value was created by a stack allocation
==6198==    at 0x153DAD15: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:15)
==6198== 
==6198== Conditional jump or move depends on uninitialised value(s)
==6198==    at 0x4E8969D: lsame_ (in /usr/lib64/libblas.so.3.4.2)
==6198==    by 0x138A2EA8: dpotri_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x153DAEB8: potri<double> (wrapper_lapack.hpp:388)
==6198==    by 0x153DAEB8: inv_sympd<double, arma::Mat<double> > (auxlib_meat.hpp:431)
==6198==    by 0x153DAEB8: apply<arma::Mat<double> > (op_inv_meat.hpp:146)
==6198==    by 0x153DAEB8: Mat<arma::Mat<double>, arma::op_inv_sympd> (Mat_meat.hpp:4549)
==6198==    by 0x153DAEB8: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:17)
==6198==    by 0x153DB417: sourceCpp_0_arma_inv_sympd (armaIssue72.cpp:53)
==6198==    by 0x47FB37: do_dotcall (dotcode.c:1251)
==6198==    by 0x4BC4DE: Rf_eval (eval.c:655)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==    by 0x4BC178: Rf_eval (eval.c:674)
==6198==    by 0x4C09E7: do_eval (eval.c:2477)
==6198==    by 0x4AE751: bcEval (eval.c:5491)
==6198==    by 0x4BC01F: Rf_eval (eval.c:558)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==  Uninitialised value was created by a stack allocation
==6198==    at 0x153DAD15: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:15)
==6198== 
==6198== Conditional jump or move depends on uninitialised value(s)
==6198==    at 0x4E8969D: lsame_ (in /usr/lib64/libblas.so.3.4.2)
==6198==    by 0x138FB00E: dtrtri_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x138A2E5B: dpotri_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x153DAEB8: potri<double> (wrapper_lapack.hpp:388)
==6198==    by 0x153DAEB8: inv_sympd<double, arma::Mat<double> > (auxlib_meat.hpp:431)
==6198==    by 0x153DAEB8: apply<arma::Mat<double> > (op_inv_meat.hpp:146)
==6198==    by 0x153DAEB8: Mat<arma::Mat<double>, arma::op_inv_sympd> (Mat_meat.hpp:4549)
==6198==    by 0x153DAEB8: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:17)
==6198==    by 0x153DB417: sourceCpp_0_arma_inv_sympd (armaIssue72.cpp:53)
==6198==    by 0x47FB37: do_dotcall (dotcode.c:1251)
==6198==    by 0x4BC4DE: Rf_eval (eval.c:655)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==    by 0x4BC178: Rf_eval (eval.c:674)
==6198==    by 0x4C09E7: do_eval (eval.c:2477)
==6198==    by 0x4AE751: bcEval (eval.c:5491)
==6198==    by 0x4BC01F: Rf_eval (eval.c:558)
==6198==  Uninitialised value was created by a stack allocation
==6198==    at 0x153DAD15: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:15)
==6198== 
==6198== Conditional jump or move depends on uninitialised value(s)
==6198==    at 0x138FB033: dtrtri_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x138A2E5B: dpotri_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x153DAEB8: potri<double> (wrapper_lapack.hpp:388)
==6198==    by 0x153DAEB8: inv_sympd<double, arma::Mat<double> > (auxlib_meat.hpp:431)
==6198==    by 0x153DAEB8: apply<arma::Mat<double> > (op_inv_meat.hpp:146)
==6198==    by 0x153DAEB8: Mat<arma::Mat<double>, arma::op_inv_sympd> (Mat_meat.hpp:4549)
==6198==    by 0x153DAEB8: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:17)
==6198==    by 0x153DB417: sourceCpp_0_arma_inv_sympd (armaIssue72.cpp:53)
==6198==    by 0x47FB37: do_dotcall (dotcode.c:1251)
==6198==    by 0x4BC4DE: Rf_eval (eval.c:655)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==    by 0x4BC178: Rf_eval (eval.c:674)
==6198==    by 0x4C09E7: do_eval (eval.c:2477)
==6198==    by 0x4AE751: bcEval (eval.c:5491)
==6198==    by 0x4BC01F: Rf_eval (eval.c:558)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==  Uninitialised value was created by a stack allocation
==6198==    at 0x153DAD15: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:15)
==6198== 
==6198== Conditional jump or move depends on uninitialised value(s)
==6198==    at 0x4E8969D: lsame_ (in /usr/lib64/libblas.so.3.4.2)
==6198==    by 0x138FB3DA: dtrtri_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x138A2E5B: dpotri_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x153DAEB8: potri<double> (wrapper_lapack.hpp:388)
==6198==    by 0x153DAEB8: inv_sympd<double, arma::Mat<double> > (auxlib_meat.hpp:431)
==6198==    by 0x153DAEB8: apply<arma::Mat<double> > (op_inv_meat.hpp:146)
==6198==    by 0x153DAEB8: Mat<arma::Mat<double>, arma::op_inv_sympd> (Mat_meat.hpp:4549)
==6198==    by 0x153DAEB8: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:17)
==6198==    by 0x153DB417: sourceCpp_0_arma_inv_sympd (armaIssue72.cpp:53)
==6198==    by 0x47FB37: do_dotcall (dotcode.c:1251)
==6198==    by 0x4BC4DE: Rf_eval (eval.c:655)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==    by 0x4BC178: Rf_eval (eval.c:674)
==6198==    by 0x4C09E7: do_eval (eval.c:2477)
==6198==    by 0x4AE751: bcEval (eval.c:5491)
==6198==    by 0x4BC01F: Rf_eval (eval.c:558)
==6198==  Uninitialised value was created by a stack allocation
==6198==    at 0x153DAD15: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:15)
==6198== 
==6198== Conditional jump or move depends on uninitialised value(s)
==6198==    at 0x4E8969D: lsame_ (in /usr/lib64/libblas.so.3.4.2)
==6198==    by 0x138FABF9: dtrti2_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x138FB455: dtrtri_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x138A2E5B: dpotri_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x153DAEB8: potri<double> (wrapper_lapack.hpp:388)
==6198==    by 0x153DAEB8: inv_sympd<double, arma::Mat<double> > (auxlib_meat.hpp:431)
==6198==    by 0x153DAEB8: apply<arma::Mat<double> > (op_inv_meat.hpp:146)
==6198==    by 0x153DAEB8: Mat<arma::Mat<double>, arma::op_inv_sympd> (Mat_meat.hpp:4549)
==6198==    by 0x153DAEB8: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:17)
==6198==    by 0x153DB417: sourceCpp_0_arma_inv_sympd (armaIssue72.cpp:53)
==6198==    by 0x47FB37: do_dotcall (dotcode.c:1251)
==6198==    by 0x4BC4DE: Rf_eval (eval.c:655)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==    by 0x4BC178: Rf_eval (eval.c:674)
==6198==    by 0x4C09E7: do_eval (eval.c:2477)
==6198==    by 0x4AE751: bcEval (eval.c:5491)
==6198==  Uninitialised value was created by a stack allocation
==6198==    at 0x153DAD15: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:15)
==6198== 
==6198== Conditional jump or move depends on uninitialised value(s)
==6198==    at 0x138FAC22: dtrti2_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x138FB455: dtrtri_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x138A2E5B: dpotri_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x153DAEB8: potri<double> (wrapper_lapack.hpp:388)
==6198==    by 0x153DAEB8: inv_sympd<double, arma::Mat<double> > (auxlib_meat.hpp:431)
==6198==    by 0x153DAEB8: apply<arma::Mat<double> > (op_inv_meat.hpp:146)
==6198==    by 0x153DAEB8: Mat<arma::Mat<double>, arma::op_inv_sympd> (Mat_meat.hpp:4549)
==6198==    by 0x153DAEB8: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:17)
==6198==    by 0x153DB417: sourceCpp_0_arma_inv_sympd (armaIssue72.cpp:53)
==6198==    by 0x47FB37: do_dotcall (dotcode.c:1251)
==6198==    by 0x4BC4DE: Rf_eval (eval.c:655)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==    by 0x4BC178: Rf_eval (eval.c:674)
==6198==    by 0x4C09E7: do_eval (eval.c:2477)
==6198==    by 0x4AE751: bcEval (eval.c:5491)
==6198==    by 0x4BC01F: Rf_eval (eval.c:558)
==6198==  Uninitialised value was created by a stack allocation
==6198==    at 0x153DAD15: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:15)
==6198== 
==6198== Conditional jump or move depends on uninitialised value(s)
==6198==    at 0x4E8969D: lsame_ (in /usr/lib64/libblas.so.3.4.2)
==6198==    by 0x138FAF2A: dtrti2_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x138FB455: dtrtri_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x138A2E5B: dpotri_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x153DAEB8: potri<double> (wrapper_lapack.hpp:388)
==6198==    by 0x153DAEB8: inv_sympd<double, arma::Mat<double> > (auxlib_meat.hpp:431)
==6198==    by 0x153DAEB8: apply<arma::Mat<double> > (op_inv_meat.hpp:146)
==6198==    by 0x153DAEB8: Mat<arma::Mat<double>, arma::op_inv_sympd> (Mat_meat.hpp:4549)
==6198==    by 0x153DAEB8: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:17)
==6198==    by 0x153DB417: sourceCpp_0_arma_inv_sympd (armaIssue72.cpp:53)
==6198==    by 0x47FB37: do_dotcall (dotcode.c:1251)
==6198==    by 0x4BC4DE: Rf_eval (eval.c:655)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==    by 0x4BC178: Rf_eval (eval.c:674)
==6198==    by 0x4C09E7: do_eval (eval.c:2477)
==6198==    by 0x4AE751: bcEval (eval.c:5491)
==6198==  Uninitialised value was created by a stack allocation
==6198==    at 0x153DAD15: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:15)
==6198== 
==6198== Conditional jump or move depends on uninitialised value(s)
==6198==    at 0x138FAC65: dtrti2_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x138FB455: dtrtri_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x138A2E5B: dpotri_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x153DAEB8: potri<double> (wrapper_lapack.hpp:388)
==6198==    by 0x153DAEB8: inv_sympd<double, arma::Mat<double> > (auxlib_meat.hpp:431)
==6198==    by 0x153DAEB8: apply<arma::Mat<double> > (op_inv_meat.hpp:146)
==6198==    by 0x153DAEB8: Mat<arma::Mat<double>, arma::op_inv_sympd> (Mat_meat.hpp:4549)
==6198==    by 0x153DAEB8: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:17)
==6198==    by 0x153DB417: sourceCpp_0_arma_inv_sympd (armaIssue72.cpp:53)
==6198==    by 0x47FB37: do_dotcall (dotcode.c:1251)
==6198==    by 0x4BC4DE: Rf_eval (eval.c:655)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==    by 0x4BC178: Rf_eval (eval.c:674)
==6198==    by 0x4C09E7: do_eval (eval.c:2477)
==6198==    by 0x4AE751: bcEval (eval.c:5491)
==6198==    by 0x4BC01F: Rf_eval (eval.c:558)
==6198==  Uninitialised value was created by a stack allocation
==6198==    at 0x153DAD15: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:15)
==6198== 
==6198== Conditional jump or move depends on uninitialised value(s)
==6198==    at 0x4E8969D: lsame_ (in /usr/lib64/libblas.so.3.4.2)
==6198==    by 0x138906C4: dlauum_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x138A2E81: dpotri_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x153DAEB8: potri<double> (wrapper_lapack.hpp:388)
==6198==    by 0x153DAEB8: inv_sympd<double, arma::Mat<double> > (auxlib_meat.hpp:431)
==6198==    by 0x153DAEB8: apply<arma::Mat<double> > (op_inv_meat.hpp:146)
==6198==    by 0x153DAEB8: Mat<arma::Mat<double>, arma::op_inv_sympd> (Mat_meat.hpp:4549)
==6198==    by 0x153DAEB8: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:17)
==6198==    by 0x153DB417: sourceCpp_0_arma_inv_sympd (armaIssue72.cpp:53)
==6198==    by 0x47FB37: do_dotcall (dotcode.c:1251)
==6198==    by 0x4BC4DE: Rf_eval (eval.c:655)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==    by 0x4BC178: Rf_eval (eval.c:674)
==6198==    by 0x4C09E7: do_eval (eval.c:2477)
==6198==    by 0x4AE751: bcEval (eval.c:5491)
==6198==    by 0x4BC01F: Rf_eval (eval.c:558)
==6198==  Uninitialised value was created by a stack allocation
==6198==    at 0x153DAD15: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:15)
==6198== 
==6198== Conditional jump or move depends on uninitialised value(s)
==6198==    at 0x138906CA: dlauum_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x138A2E81: dpotri_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x153DAEB8: potri<double> (wrapper_lapack.hpp:388)
==6198==    by 0x153DAEB8: inv_sympd<double, arma::Mat<double> > (auxlib_meat.hpp:431)
==6198==    by 0x153DAEB8: apply<arma::Mat<double> > (op_inv_meat.hpp:146)
==6198==    by 0x153DAEB8: Mat<arma::Mat<double>, arma::op_inv_sympd> (Mat_meat.hpp:4549)
==6198==    by 0x153DAEB8: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:17)
==6198==    by 0x153DB417: sourceCpp_0_arma_inv_sympd (armaIssue72.cpp:53)
==6198==    by 0x47FB37: do_dotcall (dotcode.c:1251)
==6198==    by 0x4BC4DE: Rf_eval (eval.c:655)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==    by 0x4BC178: Rf_eval (eval.c:674)
==6198==    by 0x4C09E7: do_eval (eval.c:2477)
==6198==    by 0x4AE751: bcEval (eval.c:5491)
==6198==    by 0x4BC01F: Rf_eval (eval.c:558)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==  Uninitialised value was created by a stack allocation
==6198==    at 0x153DAD15: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:15)
==6198== 
==6198== Conditional jump or move depends on uninitialised value(s)
==6198==    at 0x4E8969D: lsame_ (in /usr/lib64/libblas.so.3.4.2)
==6198==    by 0x13890AA2: dlauum_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x138A2E81: dpotri_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x153DAEB8: potri<double> (wrapper_lapack.hpp:388)
==6198==    by 0x153DAEB8: inv_sympd<double, arma::Mat<double> > (auxlib_meat.hpp:431)
==6198==    by 0x153DAEB8: apply<arma::Mat<double> > (op_inv_meat.hpp:146)
==6198==    by 0x153DAEB8: Mat<arma::Mat<double>, arma::op_inv_sympd> (Mat_meat.hpp:4549)
==6198==    by 0x153DAEB8: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:17)
==6198==    by 0x153DB417: sourceCpp_0_arma_inv_sympd (armaIssue72.cpp:53)
==6198==    by 0x47FB37: do_dotcall (dotcode.c:1251)
==6198==    by 0x4BC4DE: Rf_eval (eval.c:655)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==    by 0x4BC178: Rf_eval (eval.c:674)
==6198==    by 0x4C09E7: do_eval (eval.c:2477)
==6198==    by 0x4AE751: bcEval (eval.c:5491)
==6198==    by 0x4BC01F: Rf_eval (eval.c:558)
==6198==  Uninitialised value was created by a stack allocation
==6198==    at 0x153DAD15: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:15)
==6198== 
==6198== Conditional jump or move depends on uninitialised value(s)
==6198==    at 0x4E8969D: lsame_ (in /usr/lib64/libblas.so.3.4.2)
==6198==    by 0x138902BF: dlauu2_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x13890AF5: dlauum_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x138A2E81: dpotri_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x153DAEB8: potri<double> (wrapper_lapack.hpp:388)
==6198==    by 0x153DAEB8: inv_sympd<double, arma::Mat<double> > (auxlib_meat.hpp:431)
==6198==    by 0x153DAEB8: apply<arma::Mat<double> > (op_inv_meat.hpp:146)
==6198==    by 0x153DAEB8: Mat<arma::Mat<double>, arma::op_inv_sympd> (Mat_meat.hpp:4549)
==6198==    by 0x153DAEB8: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:17)
==6198==    by 0x153DB417: sourceCpp_0_arma_inv_sympd (armaIssue72.cpp:53)
==6198==    by 0x47FB37: do_dotcall (dotcode.c:1251)
==6198==    by 0x4BC4DE: Rf_eval (eval.c:655)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==    by 0x4BC178: Rf_eval (eval.c:674)
==6198==    by 0x4C09E7: do_eval (eval.c:2477)
==6198==    by 0x4AE751: bcEval (eval.c:5491)
==6198==  Uninitialised value was created by a stack allocation
==6198==    at 0x153DAD15: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:15)
==6198== 
==6198== Conditional jump or move depends on uninitialised value(s)
==6198==    at 0x138902C5: dlauu2_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x13890AF5: dlauum_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x138A2E81: dpotri_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x153DAEB8: potri<double> (wrapper_lapack.hpp:388)
==6198==    by 0x153DAEB8: inv_sympd<double, arma::Mat<double> > (auxlib_meat.hpp:431)
==6198==    by 0x153DAEB8: apply<arma::Mat<double> > (op_inv_meat.hpp:146)
==6198==    by 0x153DAEB8: Mat<arma::Mat<double>, arma::op_inv_sympd> (Mat_meat.hpp:4549)
==6198==    by 0x153DAEB8: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:17)
==6198==    by 0x153DB417: sourceCpp_0_arma_inv_sympd (armaIssue72.cpp:53)
==6198==    by 0x47FB37: do_dotcall (dotcode.c:1251)
==6198==    by 0x4BC4DE: Rf_eval (eval.c:655)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==    by 0x4BC178: Rf_eval (eval.c:674)
==6198==    by 0x4C09E7: do_eval (eval.c:2477)
==6198==    by 0x4AE751: bcEval (eval.c:5491)
==6198==    by 0x4BC01F: Rf_eval (eval.c:558)
==6198==  Uninitialised value was created by a stack allocation
==6198==    at 0x153DAD15: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:15)
==6198== 
==6198== Conditional jump or move depends on uninitialised value(s)
==6198==    at 0x4E8969D: lsame_ (in /usr/lib64/libblas.so.3.4.2)
==6198==    by 0x138904DE: dlauu2_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x13890AF5: dlauum_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x138A2E81: dpotri_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x153DAEB8: potri<double> (wrapper_lapack.hpp:388)
==6198==    by 0x153DAEB8: inv_sympd<double, arma::Mat<double> > (auxlib_meat.hpp:431)
==6198==    by 0x153DAEB8: apply<arma::Mat<double> > (op_inv_meat.hpp:146)
==6198==    by 0x153DAEB8: Mat<arma::Mat<double>, arma::op_inv_sympd> (Mat_meat.hpp:4549)
==6198==    by 0x153DAEB8: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:17)
==6198==    by 0x153DB417: sourceCpp_0_arma_inv_sympd (armaIssue72.cpp:53)
==6198==    by 0x47FB37: do_dotcall (dotcode.c:1251)
==6198==    by 0x4BC4DE: Rf_eval (eval.c:655)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==    by 0x4BC178: Rf_eval (eval.c:674)
==6198==    by 0x4C09E7: do_eval (eval.c:2477)
==6198==    by 0x4AE751: bcEval (eval.c:5491)
==6198==  Uninitialised value was created by a stack allocation
==6198==    at 0x153DAD15: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:15)
==6198== 
==6198== Conditional jump or move depends on uninitialised value(s)
==6198==    at 0x1389031F: dlauu2_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x13890AF5: dlauum_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x138A2E81: dpotri_ (in /usr/lib64/liblapack.so.3.4.2)
==6198==    by 0x153DAEB8: potri<double> (wrapper_lapack.hpp:388)
==6198==    by 0x153DAEB8: inv_sympd<double, arma::Mat<double> > (auxlib_meat.hpp:431)
==6198==    by 0x153DAEB8: apply<arma::Mat<double> > (op_inv_meat.hpp:146)
==6198==    by 0x153DAEB8: Mat<arma::Mat<double>, arma::op_inv_sympd> (Mat_meat.hpp:4549)
==6198==    by 0x153DAEB8: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:17)
==6198==    by 0x153DB417: sourceCpp_0_arma_inv_sympd (armaIssue72.cpp:53)
==6198==    by 0x47FB37: do_dotcall (dotcode.c:1251)
==6198==    by 0x4BC4DE: Rf_eval (eval.c:655)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==    by 0x4BC178: Rf_eval (eval.c:674)
==6198==    by 0x4C09E7: do_eval (eval.c:2477)
==6198==    by 0x4AE751: bcEval (eval.c:5491)
==6198==    by 0x4BC01F: Rf_eval (eval.c:558)
==6198==  Uninitialised value was created by a stack allocation
==6198==    at 0x153DAD15: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:15)
==6198== 
==6198== Conditional jump or move depends on uninitialised value(s)
==6198==    at 0x153DAEBC: inv_sympd<double, arma::Mat<double> > (auxlib_meat.hpp:433)
==6198==    by 0x153DAEBC: apply<arma::Mat<double> > (op_inv_meat.hpp:146)
==6198==    by 0x153DAEBC: Mat<arma::Mat<double>, arma::op_inv_sympd> (Mat_meat.hpp:4549)
==6198==    by 0x153DAEBC: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:17)
==6198==    by 0x153DB417: sourceCpp_0_arma_inv_sympd (armaIssue72.cpp:53)
==6198==    by 0x47FB37: do_dotcall (dotcode.c:1251)
==6198==    by 0x4BC4DE: Rf_eval (eval.c:655)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==    by 0x4BC178: Rf_eval (eval.c:674)
==6198==    by 0x4C09E7: do_eval (eval.c:2477)
==6198==    by 0x4AE751: bcEval (eval.c:5491)
==6198==    by 0x4BC01F: Rf_eval (eval.c:558)
==6198==    by 0x4BD816: Rf_applyClosure (eval.c:1045)
==6198==    by 0x4B4115: bcEval (eval.c:5463)
==6198==    by 0x4BC01F: Rf_eval (eval.c:558)
==6198==  Uninitialised value was created by a stack allocation
==6198==    at 0x153DAD15: arma_inv_sympd(arma::Mat<double> const&) (armaIssue72.cpp:15)
==6198== 
          [,1]       [,2]       [,3]       [,4]      [,5]
[1,] 166.59171  54.847240 -83.687938  69.901724 18.774028
[2,]  54.84724  19.031467 -28.314272  22.515022  5.733955
[3,] -83.68794 -28.314272  43.680000 -34.961842 -8.592805
[4,]  69.90172  22.515022 -34.961842  29.764602  8.004206
[5,]  18.77403   5.733955  -8.592805   8.004206  2.866702
> 
> 
==6198== 
==6198== HEAP SUMMARY:
==6198==     in use at exit: 36,608,043 bytes in 17,244 blocks
==6198==   total heap usage: 45,315 allocs, 28,071 frees, 73,707,095 bytes allocated
==6198== 
==6198== LEAK SUMMARY:
==6198==    definitely lost: 0 bytes in 0 blocks
==6198==    indirectly lost: 0 bytes in 0 blocks
==6198==      possibly lost: 0 bytes in 0 blocks
==6198==    still reachable: 36,608,043 bytes in 17,244 blocks
==6198==         suppressed: 0 bytes in 0 blocks
==6198== Reachable blocks (those to which a pointer was found) are not shown.
==6198== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==6198== 
==6198== For counts of detected and suppressed errors, rerun with: -v
==6198== ERROR SUMMARY: 25 errors from 25 contexts (suppressed: 1 from 1)

I would say that there is something wrong somewhere in my own setup, but the same error was actually found by BDR in CRAN checks of seqHMM package: http://www.stats.ox.ac.uk/pub/bdr/memtests/valgrind/seqHMM-Ex.Rout:

> set.seed(123)
> obs <- seqdef(rbind(
+   matrix(sample(letters[1:3], 5000, TRUE, prob = c(0.1, 0.6, 0.3)), 500, 10),
+   matrix(sample(letters[1:3], 2000, TRUE, prob = c(0.4, 0.4, 0.2)), 200, 10)))
 [>] 3 distinct states appear in the data: 
     1 = a
     2 = b
     3 = c
 [>] state coding:
       [alphabet]  [label]  [long label] 
     1  a           a        a
     2  b           b        b
     3  c           c        c
 [>] 700 sequences in the data set
 [>] min/max sequence length: 10/10
> 
> model <- build_lcm(obs, simulate_emission_probs(2, 3))
> fit <- fit_model(model)
> # how many of the observations were correctly classified:
> sum(summary(fit$model)$most_probable_cluster == rep(c("Class 2", "Class 1"), times = c(500, 200)))
==431== Conditional jump or move depends on uninitialised value(s)
==431==    at 0x4C153C8: lsame_ (svn/R-devel/src/extra/blas/blas.f:7082)
==431==    by 0xF337430: dpotrf_ (svn/R-devel/src/modules/lapack/dlapack.f:110554)
==431==    by 0x17914C0B: potrf<double> (R-devel/site-library/RcppArmadillo/include/armadillo_bits/wrapper_lapack.hpp:353)
==431==    by 0x17914C0B: inv_sympd<double, arma::eOp<arma::Mat<double>, arma::eop_neg> > (R-devel/site-library/RcppArmadillo/include/armadillo_bits/auxlib_meat.hpp:426)
==431==    by 0x17914C0B: apply<arma::eOp<arma::Mat<double>, arma::eop_neg> > (R-devel/site-library/RcppArmadillo/include/armadillo_bits/op_inv_meat.hpp:146)
==431==    by 0x17914C0B: Mat<arma::eOp<arma::Mat<double>, arma::eop_neg>, arma::op_inv_sympd> (R-devel/site-library/RcppArmadillo/include/armadillo_bits/Mat_meat.hpp:4549)
==431==    by 0x17914C0B: SEXPREC* Rcpp::wrap<arma::eOp<arma::Mat<double>, arma::eop_neg>, arma::op_inv_sympd>(arma::Op<arma::eOp<arma::Mat<double>, arma::eop_neg>, arma::op_inv_sympd> const&) (R-devel/site-library/RcppArmadillo/include/RcppArmadilloWrap.h:139)
==431==    by 0x17913DAE: varcoef(arma::Mat<double> const&, arma::Mat<double> const&) (packages/tests-vg/seqHMM/src/varcoef.cpp:10)
==431==    by 0x178AF269: seqHMM_varcoef (packages/tests-vg/seqHMM/src/RcppExports.cpp:328)
==431==    by 0x47A002: do_dotcall (svn/R-devel/src/main/dotcode.c:1251)
==431==    by 0x4AE5F9: Rf_eval (svn/R-devel/src/main/eval.c:655)
==431==    by 0x4B0748: do_begin (svn/R-devel/src/main/eval.c:1719)
==431==    by 0x4AE450: Rf_eval (svn/R-devel/src/main/eval.c:627)
==431==    by 0x4AF956: Rf_applyClosure (svn/R-devel/src/main/eval.c:1045)
==431==    by 0x4AE280: Rf_eval (svn/R-devel/src/main/eval.c:674)
==431==    by 0x4B179D: do_set (svn/R-devel/src/main/eval.c:2109)
==431==  Uninitialised value was created by a stack allocation
==431==    at 0x179137CF: varcoef(arma::Mat<double> const&, arma::Mat<double> const&) (packages/tests-vg/seqHMM/src/varcoef.cpp:6)

... and so on ...

Personally this is not a big issue, I circumvented the problem by replacing inv_sympd with inv in seqHMM which seems to work fine (the Hessian which is being inverted is usually rather small so at least the potential performance gains of inv_sympd are minimal compared to inv).

Please let me know if there is something peculiar in the way I compiled R or if I should try some other configuration.

from rcpparmadillo.

eddelbuettel avatar eddelbuettel commented on June 12, 2024

Weird.

We do know that the setup BDR uses often does not include a shared BLAS/LAPACK but using R's. I think we see that here as in the last block you quote, we get references to svn/R-devel/src/extra/blas and lapack. Now, if that was the main difference I'd blame R's internal code or setup. But then you say you also have it via you use of external BLAS. Could this be related to how Valgrind is set up?

In any event, I agree with you that the quickest way forward is to stick with inv instead. But I'd still like to understand better what goes on here -- but as I cannot replicate this at my end I am a little lost.

from rcpparmadillo.

eddelbuettel avatar eddelbuettel commented on June 12, 2024

Here is one more variant---now standalone C++ linked against Armadillo and LAPACK. No issue.

// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; compile-command: "g++ -s -Wall -O3 -o arma_sym_inv arma_sym_inv.cpp -larmadillo" -*-

// cf https://github.com/RcppCore/RcppArmadillo/issues/72
// now trying outside of R

#include <iostream>
#include <armadillo>

using namespace std;
using namespace arma;

int main(int argc, char** argv) {
    arma_rng::set_seed(123); 
    mat A = randn<mat>(5,5);

    mat B = A * trans(A);
    cout << B << endl;

    mat C = inv_sympd(B);
    cout << C << endl;

    return 0;
}


#if 0

edd@max:~/src/progs/C++$ valgrind --tool=memcheck --leak-check=full --track-origins=yes ./arma_sym_inv
==28016== Memcheck, a memory error detector
==28016== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==28016== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==28016== Command: ./arma_sym_inv
==28016== 
   12.2741   -0.6598   -1.4571    3.8146   -2.7375
   -0.6598    3.0448   -2.1492    0.5045    0.9815
   -1.4571   -2.1492    4.4715    0.2012   -0.1215
    3.8146    0.5045    0.2012    2.2655   -1.0930
   -2.7375    0.9815   -0.1215   -1.0930    2.8287

   0.5741   0.9072   0.6770  -1.3503  -0.2518
   0.9072   2.2583   1.4738  -2.5629  -0.8326
   0.6770   1.4738   1.2208  -1.8214  -0.5075
  -1.3503  -2.5629  -1.8214   3.9434   1.0280
  -0.2518  -0.8326  -0.5075   1.0280   0.7741

==28016== 
==28016== HEAP SUMMARY:
==28016==     in use at exit: 0 bytes in 0 blocks
==28016==   total heap usage: 28 allocs, 28 frees, 138,317 bytes allocated
==28016== 
==28016== All heap blocks were freed -- no leaks are possible
==28016== 
==28016== For counts of detected and suppressed errors, rerun with: -v
==28016== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
edd@max:~/src/progs/C++$ 

#endif

from rcpparmadillo.

kthohr avatar kthohr commented on June 12, 2024

On OS X, I get the following errors using Dirk's stand-alone C++ code. (Armadillo version 6.400.3.)

==91982== Memcheck, a memory error detector
==91982== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==91982== Using Valgrind-3.12.0.SVN and LibVEX; rerun with -h for copyright info
==91982== Command: ./inv_sympd_check
==91982== 
==91982== Conditional jump or move depends on uninitialised value(s)
==91982==    at 0x100004438: void arma::op_inv_sympd::apply<arma::Mat<double> >(arma::Mat<arma::Mat<double>::elem_type>&, arma::Op<arma::Mat<double>, arma::op_inv_sympd> const&) (auxlib_meat.hpp:421)
==91982==    by 0x100000DAC: main (Mat_meat.hpp:4549)
==91982==  Uninitialised value was created by a stack allocation
==91982==    at 0x100000D07: main (inv_sympd_check.cpp:18)
==91982== 
==91982== Conditional jump or move depends on uninitialised value(s)
==91982==    at 0x1000044A5: void arma::op_inv_sympd::apply<arma::Mat<double> >(arma::Mat<arma::Mat<double>::elem_type>&, arma::Op<arma::Mat<double>, arma::op_inv_sympd> const&) (auxlib_meat.hpp:433)
==91982==    by 0x100000DAC: main (Mat_meat.hpp:4549)
==91982==  Uninitialised value was created by a stack allocation
==91982==    at 0x100000D07: main (inv_sympd_check.cpp:18)
==91982== 
==91982== 
==91982== HEAP SUMMARY:
==91982==     in use at exit: 22,583 bytes in 196 blocks
==91982==   total heap usage: 279 allocs, 83 frees, 29,463 bytes allocated
==91982== 
==91982== LEAK SUMMARY:
==91982==    definitely lost: 0 bytes in 0 blocks
==91982==    indirectly lost: 0 bytes in 0 blocks
==91982==      possibly lost: 2,064 bytes in 1 blocks
==91982==    still reachable: 0 bytes in 0 blocks
==91982==         suppressed: 20,519 bytes in 195 blocks
==91982== 
==91982== For counts of detected and suppressed errors, rerun with: -v
==91982== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 19 from 19)

from rcpparmadillo.

eddelbuettel avatar eddelbuettel commented on June 12, 2024

What's your LAPACK / BLAS library? I currently use Atlas:

edd@max:~/src/progs/C++(master)$ ldd arma_sym_inv
        linux-vdso.so.1 =>  (0x00007ffc82dab000)
        libarmadillo.so.4 => /usr/lib/libarmadillo.so.4 (0x00007f48c415c000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f48c3e4d000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f48c3b45000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f48c392f000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f48c3565000)
        libblas.so.3 => /usr/lib/atlas-base/atlas/libblas.so.3 (0x00007f48c3327000)
        liblapack.so.3 => /usr/lib/atlas-base/atlas/liblapack.so.3 (0x00007f48c2b2a000)
        libarpack.so.2 => /usr/lib/libarpack.so.2 (0x00007f48c28dc000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f48c4363000)
        libatlas.so.3 => /usr/lib/libatlas.so.3 (0x00007f48c2368000)
        libgfortran.so.3 => /usr/lib/x86_64-linux-gnu/libgfortran.so.3 (0x00007f48c203f000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f48c1e21000)
        libquadmath.so.0 => /usr/lib/x86_64-linux-gnu/libquadmath.so.0 (0x00007f48c1be3000)
edd@max:~/src/progs/C++(master)$ 

from rcpparmadillo.

kthohr avatar kthohr commented on June 12, 2024

I linked to vecLib, Apple's version of BLAS/Lapack, in the Accelerate framework; compiler options:

clang++ -O2 -Wall -I/opt/local/include inv_sympd_check.cpp -o inv_sympd_check -framework Accelerate

With OpenBLAS I get something similar:

==91754== Memcheck, a memory error detector
==91754== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==91754== Using Valgrind-3.12.0.SVN and LibVEX; rerun with -h for copyright info
==91754== Command: ./inv_sympd_check
==91754== 
==91754== Conditional jump or move depends on uninitialised value(s)
==91754==    at 0x100004438: void arma::op_inv_sympd::apply<arma::Mat<double> >(arma::Mat<arma::Mat<double>::elem_type>&, arma::Op<arma::Mat<double>, arma::op_inv_sympd> const&) (in ./inv_sympd_check)
==91754==    by 0x100000DAC: main (in ./inv_sympd_check)
==91754==  Uninitialised value was created by a stack allocation
==91754==    at 0x100000D07: main (in ./inv_sympd_check)
==91754== 
==91754== Conditional jump or move depends on uninitialised value(s)
==91754==    at 0x1000044A5: void arma::op_inv_sympd::apply<arma::Mat<double> >(arma::Mat<arma::Mat<double>::elem_type>&, arma::Op<arma::Mat<double>, arma::op_inv_sympd> const&) (in ./inv_sympd_check)
==91754==    by 0x100000DAC: main (in ./inv_sympd_check)
==91754==  Uninitialised value was created by a stack allocation
==91754==    at 0x100000D07: main (in ./inv_sympd_check)
==91754== 
==91754== 
==91754== HEAP SUMMARY:
==91754==     in use at exit: 21,679 bytes in 180 blocks
==91754==   total heap usage: 263 allocs, 83 frees, 31,872 bytes allocated
==91754== 
==91754== 2,064 bytes in 1 blocks are possibly lost in loss record 53 of 58
==91754==    at 0x1000101FC: malloc_zone_malloc (vg_replace_malloc.c:304)
==91754==    by 0x101FF6EFD: _objc_copyClassNamesForImage (in /usr/lib/libobjc.A.dylib)
==91754==    by 0x101FEA182: protocols() (in /usr/lib/libobjc.A.dylib)
==91754==    by 0x101FEA093: readClass(objc_class*, bool, bool) (in /usr/lib/libobjc.A.dylib)
==91754==    by 0x101FE7C13: gc_init (in /usr/lib/libobjc.A.dylib)
==91754==    by 0x101FEF24E: objc_initializeClassPair_internal(objc_class*, char const*, objc_class*, objc_class*) (in /usr/lib/libobjc.A.dylib)
==91754==    by 0x101FFC132: layout_string_create (in /usr/lib/libobjc.A.dylib)
==91754==    by 0x101FEA83C: realizeClass(objc_class*) (in /usr/lib/libobjc.A.dylib)
==91754==    by 0x101FEA300: copySwiftV1MangledName(char const*, bool) (in /usr/lib/libobjc.A.dylib)
==91754==    by 0x101FEA2E9: copySwiftV1MangledName(char const*, bool) (in /usr/lib/libobjc.A.dylib)
==91754==    by 0x101FEA2E9: copySwiftV1MangledName(char const*, bool) (in /usr/lib/libobjc.A.dylib)
==91754==    by 0x101FEA2E9: copySwiftV1MangledName(char const*, bool) (in /usr/lib/libobjc.A.dylib)
==91754== 
==91754== LEAK SUMMARY:
==91754==    definitely lost: 0 bytes in 0 blocks
==91754==    indirectly lost: 0 bytes in 0 blocks
==91754==      possibly lost: 2,064 bytes in 1 blocks
==91754==    still reachable: 0 bytes in 0 blocks
==91754==         suppressed: 19,615 bytes in 179 blocks
==91754== 
==91754== For counts of detected and suppressed errors, rerun with: -v
==91754== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 15 from 15)

keith$ otool -L ./inv_sympd_check
./inv_sympd_check:
    /usr/local/lib/libopenblas_haswellp-r0.2.16.dev.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)

from rcpparmadillo.

eddelbuettel avatar eddelbuettel commented on June 12, 2024

I never get Conditional jump or move depends on uninitialised value(s). Different compiler options?

from rcpparmadillo.

kthohr avatar kthohr commented on June 12, 2024

Hmm. I just compiled the same file using gcc (v5) instead of clang: no specific Conditional jump or move depends on uninitialised value(s) errors anymore.

keith$ g++-mp-5 -g -O2 -Wall -I/opt/local/include inv_sympd_check.cpp -o inv_sympd_check_2 -framework Accelerate
keith$ valgrind --tool=memcheck --leak-check=full --track-origins=yes --show-possibly-lost=no ./inv_sympd_check_2
==91976== Memcheck, a memory error detector
==91976== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==91976== Using Valgrind-3.12.0.SVN and LibVEX; rerun with -h for copyright info
==91976== Command: ./inv_sympd_check_2
==91976== 
==91976== 
==91976== HEAP SUMMARY:
==91976==     in use at exit: 95,199 bytes in 186 blocks
==91976==   total heap usage: 287 allocs, 101 frees, 103,167 bytes allocated
==91976== 
==91976== LEAK SUMMARY:
==91976==    definitely lost: 0 bytes in 0 blocks
==91976==    indirectly lost: 0 bytes in 0 blocks
==91976==      possibly lost: 2,064 bytes in 1 blocks
==91976==    still reachable: 72,704 bytes in 1 blocks
==91976==         suppressed: 20,431 bytes in 184 blocks
==91976== Reachable blocks (those to which a pointer was found) are not shown.
==91976== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==91976== 
==91976== For counts of detected and suppressed errors, rerun with: -v
==91976== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 17 from 17)

(I suppressed the possibly lost part as this is a separate Valgrind-Mac issue, nothing to do with Armadillo.)

from rcpparmadillo.

helske avatar helske commented on June 12, 2024

Can't remember the version of gcc on my work computer, have to check it next year.

I did manage to run the same RcppArmadillo case in old RHEL6.7 server which has gcc version 4.4.7 and R3.2.2 without any errors by valgrind.

I also tested with clang3.5 on rocker/r-devel-ubsan-clang (din't rebuild it to latest R-devel though), and I got following:

root@03d049423805:/mnt/Helske/armadillo_debug# Rdevel -d "valgrind --tool=memcheck --leak-check=full --track-origins=yes" --vanilla -e 'library(Rcpp); sourceCpp("rcpparma_check.cpp")'
==194== Memcheck, a memory error detector
==194== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==194== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==194== Command: /usr/local/lib/R/bin/exec/R --vanilla -e library(Rcpp);~+~sourceCpp("rcpparma_check.cpp")
==194==

R Under development (unstable) (2015-06-14 r68515) -- "Unsuffered Consequences"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-unknown-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(Rcpp); sourceCpp("rcpparma_check.cpp")

> set.seed(123)

> X <- crossprod(matrix(rnorm(25), 5, 5))

> arma_inv(X)
          [,1]       [,2]       [,3]       [,4]      [,5]
[1,] 166.59171  54.847240 -83.687938  69.901724 18.774028
[2,]  54.84724  19.031467 -28.314272  22.515022  5.733955
[3,] -83.68794 -28.314272  43.680000 -34.961842 -8.592805
[4,]  69.90172  22.515022 -34.961842  29.764602  8.004206
[5,]  18.77403   5.733955  -8.592805   8.004206  2.866702

> arma_inv_sympd(X)
==194== Conditional jump or move depends on uninitialised value(s)
==194==    at 0xE98D3E2: bool arma::auxlib::inv_sympd<double, arma::Mat<double>>(arma::Mat<double>&, arma::Base<double, arma::Mat<double> > const&, unsigned int)(auxlib_meat.hpp:421)
==194==    by 0xE98CC89: void arma::op_inv_sympd::apply<arma::Mat<double> >(arma::Mat<arma::Mat<double>::elem_type>&, arma::Op<arma::Mat<double>, arma::op_inv_sympd> const&) (op_inv_meat.hpp:146)
==194==    by 0xE987466: arma::Mat<double>::Mat<arma::Mat<double>, arma::op_inv_sympd>(arma::Op<arma::Mat<double>, arma::op_inv_sympd> const&) (Mat_meat.hpp:4549)
==194==    by 0xE982468: arma_inv_sympd(arma::Mat<double> const&) (rcpparma_check.cpp:17)
==194==    by 0xE983757: sourceCpp_0_arma_inv_sympd (rcpparma_check.cpp:53)
==194==    by 0x56256F0: R_doDotCall (dotcode.c:570)
==194==    by 0x566DB56: do_dotcall (dotcode.c:1251)
==194==    by 0x57D3BCF: Rf_eval (eval.c:655)
==194==    by 0x586EA14: Rf_applyClosure (eval.c:1039)
==194==    by 0x57D41AE: Rf_eval (eval.c:674)
==194==    by 0x588CDBC: do_eval (eval.c:2476)
==194==    by 0x57F80DC: bcEval (eval.c:5523)
==194==  Uninitialised value was created by a stack allocation
==194==    at 0xE982144: arma_inv_sympd(arma::Mat<double> const&) (rcpparma_check.cpp:15)
==194==
==194== Conditional jump or move depends on uninitialised value(s)
==194==    at 0xE98D729: bool arma::auxlib::inv_sympd<double, arma::Mat<double>>(arma::Mat<double>&, arma::Base<double, arma::Mat<double> > const&, unsigned int)(auxlib_meat.hpp:433)
==194==    by 0xE98CC89: void arma::op_inv_sympd::apply<arma::Mat<double>>(arma::Mat<arma::Mat<double>::elem_type>&, arma::Op<arma::Mat<double>, arma::op_inv_sympd>const&) (op_inv_meat.hpp:146)
==194==    by 0xE987466: arma::Mat<double>::Mat<arma::Mat<double>, arma::op_inv_sympd>(arma::Op<arma::Mat<double>, arma::op_inv_sympd> const&) (Mat_meat.hpp:4549)
==194==    by 0xE982468: arma_inv_sympd(arma::Mat<double> const&) (rcpparma_check.cpp:17)
==194==    by 0xE983757: sourceCpp_0_arma_inv_sympd (rcpparma_check.cpp:53)
==194==    by 0x56256F0: R_doDotCall (dotcode.c:570)
==194==    by 0x566DB56: do_dotcall (dotcode.c:1251)
==194==    by 0x57D3BCF: Rf_eval (eval.c:655)
==194==    by 0x586EA14: Rf_applyClosure (eval.c:1039)
==194==    by 0x57D41AE: Rf_eval (eval.c:674)
==194==    by 0x588CDBC: do_eval (eval.c:2476)
==194==    by 0x57F80DC: bcEval (eval.c:5523)
==194==  Uninitialised value was created by a stack allocation
==194==    at 0xE982144: arma_inv_sympd(arma::Mat<double> const&) (rcpparma_check.cpp:15)
==194==
          [,1]       [,2]       [,3]       [,4]      [,5]
[1,] 166.59171  54.847240 -83.687938  69.901724 18.774028
[2,]  54.84724  19.031467 -28.314272  22.515022  5.733955
[3,] -83.68794 -28.314272  43.680000 -34.961842 -8.592805
[4,]  69.90172  22.515022 -34.961842  29.764602  8.004206
[5,]  18.77403   5.733955  -8.592805   8.004206  2.866702
>
>
==194==
==194== HEAP SUMMARY:
==194==     in use at exit: 30,129,317 bytes in 14,168 blocks
==194==   total heap usage: 40,250 allocs, 26,082 frees, 65,093,656 bytes allocated
==194==
==194== LEAK SUMMARY:
==194==    definitely lost: 0 bytes in 0 blocks
==194==    indirectly lost: 0 bytes in 0 blocks
==194==      possibly lost: 0 bytes in 0 blocks
==194==    still reachable: 30,129,317 bytes in 14,168 blocks
==194==         suppressed: 0 bytes in 0 blocks
==194== Reachable blocks (those to which a pointer was found) are not shown.
==194== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==194==
==194== For counts of detected and suppressed errors, rerun with: -v
==194== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)

I guess these are nothing to worry about?

from rcpparmadillo.

eddelbuettel avatar eddelbuettel commented on June 12, 2024

The 'still reachable at end' is normal; R does not go around returning everything. I take comfort in the 'zero lost' leak summary. And that Conditional jump or move depends on uninitialised value(s) I am willing to chalk onto a compiler error. So ... are we ready to close this?

from rcpparmadillo.

eddelbuettel avatar eddelbuettel commented on June 12, 2024

That said, I do of course have access to some clang variants on my Ubuntu box, and there is the whole Rocker suite so I can try to help you if you think you need another answer for CRAN. But as best as I can tell there is no real reproducible error here...

from rcpparmadillo.

helske avatar helske commented on June 12, 2024

Yes I agree that we can close this. I'll stick to inv instead of inv_sympd to get rid of CRAN error. I think after holidays I will try to clean and upgrade all related tools on my computer, I'll let you know if I happen to find something relevant which could explain the issue.

from rcpparmadillo.

eddelbuettel avatar eddelbuettel commented on June 12, 2024

Really appreciate that -- and at the same time we need to make sure that the less obvious and less often-used functions in (Rcpp)Armadillo get a fair shake and proper tests.

Enjoy the break, and we will pick this next year.

from rcpparmadillo.

helske avatar helske commented on June 12, 2024

I just reinstalled BLAS, R etc, and I still got the same error, also by using the standalone C++ with newest Armadillo and OpenBLAS 2.14. I then updated gcc to 5.2.1 (from 4.8.5), and now the standalone C++ script runs without any errors. So yes it seems that this is a compiler error.

from rcpparmadillo.

eddelbuettel avatar eddelbuettel commented on June 12, 2024

Thanks a lot for the update, that is good to know.

from rcpparmadillo.

gvegayon avatar gvegayon commented on June 12, 2024

It was actually a bug and has been solved in #91

from rcpparmadillo.

eddelbuettel avatar eddelbuettel commented on June 12, 2024

Should we check / have you checked that is actually really fixed?

from rcpparmadillo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.