From 17becf4610a238c990e874bfda2df71047f20b7d Mon Sep 17 00:00:00 2001 From: Sameer Agarwal Date: Wed, 11 Sep 2019 19:57:36 -0700 Subject: [PATCH] Remove a CHECK failure from covariance_impl.cc The CHECK was to see if SuiteSparseQR returns a non-null QR factorization. However this can cause problems in production, so its better to return false and let the user deal with the failure in factorization. Change-Id: I4e67f343e30547f4257d0315d507df9864c06dcc --- internal/ceres/covariance_impl.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/ceres/covariance_impl.cc b/internal/ceres/covariance_impl.cc index d24f5c9b1..299dda8fb 100644 --- a/internal/ceres/covariance_impl.cc +++ b/internal/ceres/covariance_impl.cc @@ -651,7 +651,12 @@ bool CovarianceImpl::ComputeCovarianceValuesUsingSuiteSparseQR() { &permutation, &cc); event_logger.AddEvent("Numeric Factorization"); - CHECK(R != nullptr); + if (R == nullptr) { + LOG(ERROR) << "Something is wrong. SuiteSparseQR returned R = nullptr."; + free(permutation); + cholmod_l_finish(&cc); + return false; + } if (rank < cholmod_jacobian.ncol) { LOG(ERROR) << "Jacobian matrix is rank deficient. "