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
{{ message }}
Repository navigation
Incorrect calls to DLASET in TESTING/EIG/cchkhb2stg.f #429
cchkhb2stg.f contains a number of calls to DLASET, in the form:
CALL DLASET( 'Full', N, 1, ZERO, ZERO, SD, 1 )
CALL DLASET( 'Full', N, 1, ZERO, ZERO, SE, 1 )
These calls are wrong, for three reasons:
SD and SE are REAL variables of the default kind, while DLASET expects a DOUBLE PRECISION real kind. There is no guarantee that the underlying binary representation of zero is the same for both types, or how DLASET would interpret default real-kind ZERO, when it expects a DOUBLE PRECISION value.
The calling routine expects SD and SE to be (N) REAL elements in size. It is quite likely that DLASET will initialize more than the expected size, corrupting something else.
The LDA argument to DLASET (1) is potentially less than N, and can trigger a bounds violation in DLASET.
One might be tempted to replace the calls with:
CALL SLASET( 'Full', N, 1, ZERO, ZERO, SD, N )
CALL SLASET( 'Full', N, 1, ZERO, ZERO, SE, N )
... however, I have no clue whether this is what the author of the code really intended.
@h-vetinari that is entirely based on what serguei-patchkovskii suggested above (and currently just a dummy PR to test a new CI service for OpenBLAS). I try to keep an eye on Reference-LAPACK issues as OpenBLAS relies on it for most of its LAPACK but I do not want to steal credit for PRs (unless I have something substantial to add, or the original poster shows no interest in submitting a PR)
@martin-frbg If you can prepare a pull request with your version of the fix without too much work, it would be very helpful - I won't be able to allocate any time for this for a little while.
Activity
h-vetinari commentedon Aug 15, 2020
Potential fix from @martin-frbg in OpenMathLib/OpenBLAS#2778
martin-frbg commentedon Aug 15, 2020
@h-vetinari that is entirely based on what serguei-patchkovskii suggested above (and currently just a dummy PR to test a new CI service for OpenBLAS). I try to keep an eye on Reference-LAPACK issues as OpenBLAS relies on it for most of its LAPACK but I do not want to steal credit for PRs (unless I have something substantial to add, or the original poster shows no interest in submitting a PR)
serguei-patchkovskii commentedon Aug 16, 2020
@martin-frbg If you can prepare a pull request with your version of the fix without too much work, it would be very helpful - I won't be able to allocate any time for this for a little while.