dlarfb - uninitialized reference possible

Post here if you want to report a bug to the LAPACK team

dlarfb - uninitialized reference possible

Line 256 of DLARFB.f
LASTV = MAX( K, ILADLR( M, K, V, LDV ) )
should be

the former can access unititialized elements of V when this has column of zeros.
lawrence mulholland

Posts: 25
Joined: Mon Jun 11, 2012 6:33 am
Location: NAG Ltd, Oxford, UK

Re: dlarfb - uninitialized reference possible

We found that your solution would break if m=n=k, for example, since v(k+1,1) could be out of bounds.
Could you be more explicit on "the former can access unititialized elements of V when this has column of zeros"? do you mean when V is the zero matrix? If so, that's not a problem as long as you have a valid value of k.

Posts: 586
Joined: Wed Dec 08, 2004 7:07 pm

Re: dlarfb - uninitialized reference possible

Yes the problem comes with a zero V.
You are correct that the case m=k needs to be protected:

Code: Select all
`If (k==m) then    lastv = kelse ...end if`

In the case
DIRECT = 'F' and STOREV = 'C'
V is lower trapezoidal and the upper triangular part of V may be unset.
Further, the '1's on the diagonal are not stored and may also be unset.
Consider, in ILADLR, the pass up the third column, with the leading
lower triangular part of V contains zeros up to V(4,3);
V(3,3) is then accessed, and if this is zero then V(2,3) is referenced.
What we are really interested of course is lastv>k so we needn't be looking
up as far as the leading lower triangle part anyway.
Lawrence
lawrence mulholland

Posts: 25
Joined: Mon Jun 11, 2012 6:33 am
Location: NAG Ltd, Oxford, UK

Who is online

Users browsing this forum: No registered users and 1 guest