Created attachment 615 [details] Source code to reproduce the segfault (minimal working example). This code segfaults for me: Eigen::BiCGSTAB<SparseMatrix<double>> BCGST2(ID - dt * shape_laplace); V2 = BCGST2.solve(V1); //< this crashes where ID and shape_laplace are n by n matrices and dt is a double. However this: SparseMatrix<double> tmp = ID - dt * shape_laplace; Eigen::BiCGSTAB<SparseMatrix<double>> BCGST2(tmp); V2 = BCGST2.solve(V1); //< this crashes works fine. I read the common pitfalls page and did not find anything to explain such behaviour. Am I missing something trivial or is this a bug? Before I translated my code to the minimal working example, it sometimes crashed with EIGEN assert: ./../include/Eigen/src/Core/ProductBase.h:102: Eigen::ProductBase<Derived, Lhs, Rhs>::ProductBase(const Lhs&, const Rhs&) [with Derived = Eigen::SparseTimeDenseProduct<Eigen::SparseMatrix<double, 0, int>, Eigen::Block<Eigen::Matrix<double, -1, 1>, -1, 1, true> >; Lhs = Eigen::SparseMatrix<double, 0, int>; Rhs = Eigen::Block<Eigen::Matrix<double, -1, 1>, -1, 1, true>]: Assertion `a_lhs.cols() == a_rhs.rows() && "invalid matrix product" && "if you wanted a coeff-wise or a dot product use the respective explicit functions"' failed.
Thank you for the report. Fixed in devel branch (c2aef7f3278b), and 3.2 branch (dd9b4efbd852)
-- 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/1092.