Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Match Octave/Numpy's minimum RWORK size for gesdd. Fixes #4016

gesdd's RWORK size was recently changed to match the netlib header.
However, the minimum size calculated results in a segfault.  Both
Octave and Numpy use a different minimum size, and testing verified
that anything smaller than this leads to a segfault.

Numpy: https://github.com/numpy/numpy/blob/master/numpy/linalg/umath_linalg.c.src#L2922
Octave: http://hg.savannah.gnu.org/hgweb/octave/file/2f1729cae08f/liboctave/numeric/CmplxSVD.cc#l184
  • Loading branch information...
commit 9f6058804ca2b7edd481a316b5fca7e13a743479 1 parent 3134f78
@kmsquire kmsquire authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  base/linalg/lapack.jl
View
2  base/linalg/lapack.jl
@@ -858,7 +858,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in
S = Array($relty, minmn)
cmplx = iseltype(A,Complex)
if cmplx
- rwork = Array($relty, job == 'N' ? 5*minmn :
+ rwork = Array($relty, job == 'N' ? 7*minmn :
minmn*max(5*minmn+7, 2*max(m,n)+2*minmn+1))
end
iwork = Array(BlasInt, 8*minmn)

5 comments on commit 9f60588

@ViralBShah
Owner

@kmsquire Thanks for tracking this down. I just committed patches to dlasd4 and slasd4 as well as part of #2430 - but you have rebuild openblas if you want these fixes. Hopefully with all of this will make our SVD bugfree.

@ViralBShah
Owner

Looking at the Numpy and octave wrappers, I feel that our wrappers are considerably simpler and easier to hack.

@kmsquire
Collaborator

Hmm. Looking at 484a9f0, matching Numpy and Octave was kind of irrelevant, because we used to have exactly what they have. Either way, the 7*minnm needs to be there.

@kmsquire
Collaborator

@ViralBShah, hopefully so! I think you meant #2340. Cheers!

Please sign in to comment.
Something went wrong with that request. Please try again.