This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 785 - Cholesky segfaults on a zero-by-zero matrix
Summary: Cholesky segfaults on a zero-by-zero matrix
Status: RESOLVED FIXED
Alias: None
Product: Eigen
Classification: Unclassified
Component: Cholesky (show other bugs)
Version: 3.2
Hardware: All All
: Normal Crash
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-04 17:38 UTC by Jitse Niesen
Modified: 2019-12-04 13:11 UTC (History)
3 users (show)



Attachments

Description Jitse Niesen 2014-04-04 17:38:41 UTC
Test code:

  MatrixXd m1;
  LDLT<MatrixXd> ldlt(m1);


Back trace (slightly cleaned up):

#0  0x0000000000403407 in internal::real_default_impl<double, false>::run (x=@0x0)
    at [...]/Eigen/src/Core/MathFunctions.h:68
#1  0x000000000040222a in numext::real<double> (x=@0x0)
    at [...]/Eigen/src/Core/MathFunctions.h:583
#2  0x000000000040160b in internal::ldlt_inplace<1>::unblocked<MatrixXd, Transpositions<-1, -1, int>, Matrix<double, -1, 1, 0, -1, 1> > (mat=..., transpositions=..., temp=..., sign=@0x7fffffffd818)
    at [...]/Eigen/src/Cholesky/LDLT.h:271
#3  0x00000000004012db in LDLT<MatrixXd, 1>::compute (this=0x7fffffffd7e0, a=...)
    at [...]/Eigen/src/Cholesky/LDLT.h:452
#4  0x0000000000400fcb in LDLT<MatrixXd, 1>::LDLT (this=0x7fffffffd7e0, matrix=...)
    at [...]/Eigen/src/Cholesky/LDLT.h:108
#5  0x00000000004009de in main () at forum.cc:9
Comment 1 Christoph Hertzberg 2018-12-04 11:18:33 UTC
Fix for this was very simple. However, I had to change the value of rcond for 0x0 matrices (from 1 to inf) to avoid introducing a lot of extra logic into the unit test. At least octave agrees on that (I don't have a running Matlab version at the moment). I hope this does not break anything.

Pushed to devel and 3.3:
https://bitbucket.org/eigen/eigen/commits/ec89c48d5693c6f0d7
https://bitbucket.org/eigen/eigen/commits/f7bf19488c92e913df
Comment 2 Nobody 2019-12-04 13:11:51 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/785.

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