LAPACK Archives

[Lapack] lapack-3.2.0 : a bug in 'dlaqr3.f'

[Bonjour Julie, encore un bug trouv? dans la derni?re version de Lapack]

I'm working with the SCHUR decomposition and I want to query the optimal size
for the allocatable WORK(:) array. So, I call the DGEES routine with LWORK=-1,
in order to get the required size in WORK(1).
I'm calling this routine with a matrix of shape (12,12) so that it is greater 
the threshold NTINY=11 seen in DGEES (or someelse routine).

When using lapack-3.1, it was sufficient to first allocate the WORK(:) array 
with size=1,
retrieve the optimal size in WORK(1), then reallocate it with the good size.

Indeed, the DGEES documentation says that WORK(:) must have its dimension equal
to MAX(1,LWORK)). So, when a query is done, a size of 1 should be ok; and 
it does.

With lapack-3.2, the same process leads sometimes to a seg. fault, which is 
when using valgrind :
==26256== Invalid write of size 8
==26256==    at 0x875A9B2: dormhr_ (dormhr.f:164)
==26256==    by 0x874A1BA: dlaqr3_ (dlaqr3.f:199)
==26256==    by 0x8748AAC: dlaqr0_ (dlaqr0.f:286)
==26256==    by 0x87419D3: dhseqr_ (dhseqr.f:315)
==26256==    by 0x872BF0E: dgees_ (dgees.f:206)

The problem occurs with three different compilers, so I have investigated it, 
and I found
that DLAQR3 calls now DORMHR (and not DORGHR as before). It is due to embedded
On line 199 of 'dormhr.f', there is a query for an optimal size, using 
WORK(JW+1), with
JW+1 = 4, so an invalid write occurs, which sometimes leads to the above 
seg. fault.
If the coding of DORMHR cannot be changed, then the documentation of DGEES 
be fixed, and must note that the size of WORK(:) must be greater than, ... hum, 
N ?

By the way, there are many files ('dhseqr.f', 'dlaqr0.f', 'dlaqr3.f' and 
perhaps others) which
have been modified : they are tagged with the correct version (lapack 3.2) but 
dated 'november 2006'; this should be changed to 'november 2008', isn't it ?

?douard CANOT

<Prev in Thread] Current Thread [Next in Thread>

For additional information you may use the LAPACK/ScaLAPACK Forum.
Or one of the mailing lists, or