panic: Bus error -- stopping myself...

John W. Eaton jwe at bevo.che.wisc.edu
Mon Feb 4 21:22:22 CST 2008


On  5-Feb-2008, David Bateman wrote:

| John W. Eaton wrote:
| > First, see:
| > 
| >   https://www.cae.wisc.edu/pipermail/bug-octave/2008-January/004634.html
| > 
| > I think the problem is that the size of the workspace returned from
| > the query call to Lapack is wrong.  There is no clear statement of
| > what the workspace requirement is for the function we are using.  So
| > someone needs to dig that information out of the code so we can
| > calculate the size instead of asking Lapack to give us the value.  I
| > have no patience for doing that, so I'm waiting for a patch.
| >
| Then what about the attached based on the suggestion from Jason in
| 
| https://www.cae.wisc.edu/pipermail/bug-octave/2008-January/004651.html
| 
| It seems to fix both the case here and the case in the thread you
| pointed to.
| 
| D.
| Index: liboctave/CMatrix.cc
| ===================================================================
| RCS file: /usr/local/cvsroot/octave/liboctave/CMatrix.cc,v
| retrieving revision 1.145
| diff -u -r1.145 CMatrix.cc
| --- liboctave/CMatrix.cc	24 Jan 2008 08:31:36 -0000	1.145
| +++ liboctave/CMatrix.cc	5 Feb 2008 00:57:28 -0000
| @@ -2532,6 +2532,12 @@
|        else
|  	{
|  	  lwork = static_cast<octave_idx_type> (std::real (work(0)));
| +	  // Workaround issue in current lapack calculation of lwork
| +	  octave_idx_type path2a = 4*m + m*m +(m < 2*m-4 ? 2*m-4 : 
| +					       (m < nrhs ? nrhs : 
| +						(m < n-3*m ? n-3*m : m)));
| +	  if (lwork < path2a)
| +	    lwork = path2a;
|  	  work.resize (lwork);
|  
|  	  F77_XFCN (zgelsd, ZGELSD, (m, n, nrhs, tmp_data, m, pretval,

I suppose this would work, but could it also end up allocating a lot
more space than is really necessary?  For example, we are not actually
going to take path2a and the required workspace is really much smaller
than what is computed for path2a.  I admit I haven't checked to see if
this is even a possibility; maybe all other paths require more workspace
than path2a?

jwe


More information about the Bug-octave mailing list