Bug report: out-of-bounds in ILADLC, ILADLR, ILAZLC, ILAZLR

Posted:
Sat Aug 14, 2010 5:15 am
by mat_cross
In these four routines the 'quick return' logical test, e.g.
- Code: Select all
IF( N.EQ.0 .OR. A(1, N).NE.ZERO .OR. A(M, N).NE.ZERO )
in ILADLC, needs to be split into two:
- Code: Select all
IF( N.EQ.0 )
and
- Code: Select all
IF( A(1, N).NE.ZERO .OR. A(M, N).NE.ZERO )
since logical expressions can be evaluated in any order in Fortran.
Re: Bug report: out-of-bounds in ILADLC, ILADLR, ILAZLC, ILAZLR

Posted:
Sun Aug 15, 2010 1:03 pm
by Julien Langou
Hi Mathew,
You are entirely right, the LAPACK codes were not correct, we corrected this in 3.2.1. (See:
http://www.netlib.org/lapack/lapack-3.2.1.html, bug 002, svn r610 and svn r614).
Cheers,
Julien.
Re: Bug report: out-of-bounds in ILADLC, ILADLR, ILAZLC, ILAZLR

Posted:
Tue Aug 17, 2010 12:58 am
by jteg68
Hi,
two comments:
shouldn't the test for N=0 be N<=0 instead?
shouldn't the code indicate an error in case N<=0? Now it returns the index of the last row/column and any buggy calling code will happily chug along instead of aborting.
/Jörgen
Re: Bug report: out-of-bounds in ILADLC, ILADLR, ILAZLC, ILAZLR

Posted:
Tue Aug 17, 2010 10:28 am
by Julien Langou
Thanks for the comment. These subroutines (ILACLC,ILACLR, ILADLC,ILADLR,ILASLC,ILASLR,ILAZLC and ILAZLR) are LAPACK auxiliary subroutines. Therefore, as LAPACK auxiliary subroutines, they do not have any check on their arguments. For ILADLC, (( M>=0 ) .AND. ( N >= 0 ) .AND. ( LDA >= MAX( 1, N) ) ) is required for the subroutine to work properly but we do not check it. Julien.
Re: Bug report: out-of-bounds in ILADLC, ILADLR, ILAZLC, ILAZLR

Posted:
Tue Aug 17, 2010 2:23 pm
by mat_cross
Thanks guys: sorry for the duplicate. I picked up my source from
http://www.netlib.org/lapack/lapack-3.2/SRC/ilazlc.f (via Google) and wrongly assumed that was the latest version.
I also see from the Google search that the third hit is the original discussion about the bug from a few years ago!