You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
See OpenMathLib/OpenBLAS#5250 for full context and reproducer
Calling ?GEEV with non-finite input will fail in ?HSEQR. ?GEEV will then invoke ?LASCAL to undo any previous scaling of the input data, using INFO as a reference - with the existing guard for INFO.GT.0 covering only half the invocations.
The trivial fix would be to move the existing check for INFO.GT.0 into the outer if (?CALEA) THEN conditional - or add a check for INFO.GE.0 there. The same problem appears to be present in ?GEEVX, though I have not checked in detail. Checklist
I've included a minimal example to reproduce the issue
I'd be willing to make a PR to solve this issue
The text was updated successfully, but these errors were encountered:
martin-frbg
changed the title
Calling ?GEEV with non-finite input leads to memory corruption from array underruns in ?LASCAL
Calling ?GEEV with non-finite input leads to memory corruption in ?LASCAL
May 17, 2025
Does the reproducer you linked in the issue work for reference-LAPACK on your side? When I execute the reproducer, GEBAL triggers XERBLA ( ** On entry to DGEBAL parameter number 3 had an illegal value), which immediately calls STOP. So everything is fine, no memory corruption, HSEQR is never reached.
Irrespective of the exact cause, I think that the best way of handling Inf and/or NaN in GEEV (and likely quite a few other routines) is to just return if the input matrix does not contains only valid floating point numbers. A natural point to check for Inf/NaN is
Since problems with Inf/NaN will likely pop up every now and then, should there be a function DISFINITE, inspired by the existing DISNAN, to check for Inf or NaN? Then a possibility is to continue the above code snippet like this:
ELSE IF( DISFINITE( ANRM) ) THEN
INFO = ... <new info flag for GEEV that signals that Inf/NaN is encountered>
CALL XERBLA( 'DGEEV', -INFO)
RETURN
END
Uh oh!
There was an error while loading. Please reload this page.
Description
See OpenMathLib/OpenBLAS#5250 for full context and reproducer
Calling ?GEEV with non-finite input will fail in ?HSEQR. ?GEEV will then invoke ?LASCAL to undo any previous scaling of the input data, using INFO as a reference - with the existing guard for INFO.GT.0 covering only half the invocations.
The trivial fix would be to move the existing check for INFO.GT.0 into the outer
if (?CALEA) THEN
conditional - or add a check for INFO.GE.0 there. The same problem appears to be present in ?GEEVX, though I have not checked in detail.Checklist
The text was updated successfully, but these errors were encountered: