This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 1172 - GCC UBSAN error of sparse Cholesky decomposition
Summary: GCC UBSAN error of sparse Cholesky decomposition
Status: RESOLVED FIXED
Alias: None
Product: Eigen
Classification: Unclassified
Component: Sparse (show other bugs)
Version: 3.2
Hardware: x86 - 64-bit Linux
: Normal Crash
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-24 18:03 UTC by Yixuan Qiu
Modified: 2019-12-04 15:27 UTC (History)
2 users (show)



Attachments

Description Yixuan Qiu 2016-02-24 18:03:30 UTC
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)
Comment 1 Gael Guennebaud 2016-02-27 14:10:06 UTC
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.
Comment 2 Yixuan Qiu 2016-02-27 15:18:23 UTC
Thanks for the quick fix!
Comment 3 Nobody 2019-12-04 15:27:41 UTC
-- 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.

Note You need to log in before you can comment on or make changes to this bug.