Closed collares closed 2 years ago
Yep, this seems like a probable cause of the bug. MatrixHom::map
uses ZeroOne<GF2>::augment
, which obtains an iterator by calling A.indexBegin():
https://github.com/linbox-team/linbox/blob/d0d4b9b1eb72a0b9d80af573888a72955670352c/linbox/blackbox/zo-gf2.inl#L401
However, indexBegin() calls IndexedIterator like this:
https://github.com/linbox-team/linbox/blob/d0d4b9b1eb72a0b9d80af573888a72955670352c/linbox/blackbox/zo-gf2.inl#L378
This has two problems:
this->front().front()
could point to uninitialized memory in cases where the matrix is sparse and the first row is empty.IndexedIterator
constructor at does take care of finding the first valid entry...
https://github.com/linbox-team/linbox/blob/d0d4b9b1eb72a0b9d80af573888a72955670352c/linbox/blackbox/zo-gf2.inl#L304 ...but it does not update the indices at _row
and _col
, so it looks like to the consumer that the iterator is pointing at cell (0, this->front().front())
even if the first non-empty cell is not at row 0.This code was introduced in dc14020d1ff2fc0606b09365ea2b1610fcd76080.
Fixed by #286
I am getting the following stack trace intermittently (on 1.6.3) when running test-local-smith-form-sparseelim:
Full logs (compiled with
--enable-debug
): test.log, stdout.log.I don't know anything about this code, but it looks like
MatrixHom::map
is copying the sparseZeroOne<GF2>
matrix incorrectly, at least when the first row is all zeros. The gdb session below is from a different run: