I think I've found a problem with the LAPACK routine zherfsx
where INFO values are not set correctly. The problem showed
up when running test program zchkaa.exe < ztest.in, during the
tests of ZHE drivers (with LAPACK built to use xblas). I was using
gfortran 4.6 on 64-bit Linux. The symptom was that I got messages
like this in the output:
Messages:
*** Error code from ZHESVXX = 2
==> FACT='F', UPLO='U', N = 1, NRHS = 1, type 1
*** Error code from ZHESVXX = 2
==> FACT='N', UPLO='U', N = 1, NRHS = 1, type 1
Using source code and line numbers from LAPACK 3.4.0, here's what
I think is wrong.
At zherfsx.f line 634, INFO can be set non-zero:
*
* Threshold the error (see LAWN).
*
IF (RCOND_TMP .LT. ILLRCOND_THRESH) THEN
ERR_BNDS_NORM( J, LA_LINRX_ERR_I ) = 1.0D+0
ERR_BNDS_NORM( J, LA_LINRX_TRUST_I ) = 0.0D+0
IF ( INFO .LE. N ) INFO = N + J
Then at line 663, INFO is used as an argument to
ZLA_HERCOND_X and so overwritten (probably set back to 0):
RCOND_TMP = ZLA_HERCOND_X( UPLO, N, A, LDA, AF, LDAF,
$ IPIV, X( 1, J ), INFO, WORK, RWORK )
Then at line 682 the array PARAMS is used to decide whether
to set INFO again, but PARAMS may be uninitialized so the result
is not deterministic:
IF ( PARAMS( LA_LINRX_CWISE_I ) .EQ. 1.0D+0
$ .AND. INFO.LT.N + J ) INFO = N + J
Fixing the uninitialized array reference would be easy by
making sure that IGNORE_CWISE is set near the start of
the routine, and use that instead of PARAMS( LA_LINRX_CWISE_I ).
That still leaves the problem of INFO being overwritten
at line 663.
Mick Pont
NAG, Oxford

