Page 1 of 1

LAPACKE_dtr_nancheck called on trapezoidal matrix by LAPACKE

PostPosted: Mon Oct 05, 2015 4:40 pm
by kortschak
LAPACKE_dlantr works on a m by n triangular or trapezoidal matrix, but calls LAPACKE_dtr_nancheck with n. Under some circumstances (m < n), this can result in a segfault.

See for more details.

Re: LAPACKE_dtr_nancheck called on trapezoidal matrix by LAP

PostPosted: Mon Oct 05, 2015 10:13 pm
by Julien Langou

Thanks for the bug report, this is a bug in LAPACKE. Correct. The comments on the GITHUB website are correct as well.

The quickest way to remove the bug is to add a MIN indeed. But this is not a good fix. (As noted on the GITHUB website.)

I applied your quick bug fix (svn revision 1598). Better than nothing. But this needs some more work.

Either we fix the bug in LAPACKE_dlantr. This is without interface changes. This is fine. Ugly and not really functional, but that would work.

Or the cleanest way to fix this would be to change LAPACKE_dtr_nancheck so that the TR is not for TRIANGULAR but for TRAPEZOID, and so we would add an extra parameter so that the input matrix can be an M-by-N matrix, so a trapezoid. As opposed to an n-by-n matrix for now.

I think I will try to work on the cleanest fix.

Thanks for the bug report.