dlarfb - uninitialized reference possible

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

dlarfb - uninitialized reference possible

Postby lawrence mulholland » Mon Jun 11, 2012 6:43 am

Line 256 of DLARFB.f
LASTV = MAX( K, ILADLR( M, K, V, LDV ) )
should be
lastv = k + ILADLR(m-k,k,v(k+1,1),ldv)

the former can access unititialized elements of V when this has column of zeros.
lawrence mulholland
 
Posts: 17
Joined: Mon Jun 11, 2012 6:33 am
Location: NAG Ltd, Oxford, UK

Re: dlarfb - uninitialized reference possible

Postby admin » Tue Jun 12, 2012 1:33 pm

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.
admin
Site Admin
 
Posts: 474
Joined: Wed Dec 08, 2004 7:07 pm

Re: dlarfb - uninitialized reference possible

Postby lawrence mulholland » Fri Aug 02, 2013 5:29 am

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 = k
else
...
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: 17
Joined: Mon Jun 11, 2012 6:33 am
Location: NAG Ltd, Oxford, UK


Return to Bug report

Who is online

Users browsing this forum: No registered users and 1 guest