Sat 10 Oct 2015 11:48:52 PM UTC, comment #3:
The problem seems not to be in Octave, but rather in the ZGETRF function from lapack. The code which calls ZGETRF is in liboctave/array/CMatrix.cc. In Octave we use the exact same code sequence for double matrices, single matrices, single complex matrices, and double complex matrices. There are only slight changes to reflect the different inputs. Thus, for single complex matrices the routine is CGETRF and for regular double matrices it is DGETRF. None of the other routines produce segfaults if the input matrix has a row or column of NaN values--it is only double complex matrices which call ZGETRF.
Because it is only one routine, I have worked around the issue in Octave. The norm of the matrix is calculated before the LU decomposition and if the norm is NaN that is an indication not to call lapack and, instead, issue a warning.
Interestingly, in searching through CMatrix.cc for calls to ZGETRF I found three other instances: finverse, determinant, rcond. Sure enough, trying to calculate the determinant or rcond of the problem matrix in this bug report produces a segfault. So I patched those too.
Since this is a serious crash of the interpreter I fixed the problem on the stable branch. See this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/ffc6cdcd02c5).
Closing report.
|
Sat 12 Sep 2015 09:59:57 PM UTC, comment #2:
This is not quite the same as bug #45484, that bug is about BLAS errors that are caught correctly on Linux. This error causes a crash even on Linux, probably a different error. It looks like a memory double-free error in a destructor:
|