Hi All, GCC UBSAN reports runtime errors on sparse Cholesky decomposition. Below is a minimal example: ======================================== #include <Eigen/Sparse> int main() { Eigen::SparseMatrix<double> mat(10, 10); for(int i = 0; i < mat.rows(); i++) mat.insert(i, i) = 1.0; Eigen::SimplicialLDLT< Eigen::SparseMatrix<double> > ll(mat); return 0; } ======================================== Compiling this code with "g++ -g -fsanitize=undefined,address -I. test.cpp" and running it gives Eigen/src/SparseCore/CompressedStorage.h:108:55: runtime error: reference binding to null pointer of type 'Index' Eigen/src/SparseCore/CompressedStorage.h:105:55: runtime error: reference binding to null pointer of type 'Scalar' Thanks. OS: Fedora 23 64-bit Eigen: most recent 3.2 branch (also occurs in 3.3 branch) GCC: g++ (GCC) 5.3.1 20151207 (Red Hat 5.3.1-2)
Thank you for the report. https://bitbucket.org/eigen/eigen/commits/cb84354748ba/ https://bitbucket.org/eigen/eigen/commits/d1c22058362b/ (3.2) Summary: Bug 1172: make valuePtr and innderIndexPtr properly return null for empty matrices.
Thanks for the quick fix!
-- GitLab Migration Automatic Message -- This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/1172.