bugGNU Octave - Bugs: bug #45651, Crash when inverting matrices...

 
 

bug #45651: Crash when inverting matrices sized 10x10 or bigger

Submitter:  None
Submitted:  Wed 29 Jul 2015 06:58:17 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Need Info Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.8.2
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 17 Aug 2015 02:26:45 PM UTC, comment #6: 

Another solutions seems to be to use apt-pinning to upgrade octave to debian "testing" (I really begin to hate 'stable'). Meaning octave 4.0.0.

ukuvbu oibws <xyzdragon>
Wed 29 Jul 2015 10:20:44 PM UTC, comment #5: 

Good that it was sorted out.  Maybe Yade is easy to build from source and you can rebuild it against your installed libblas3.

Rik <rik5>
Group administrator
Wed 29 Jul 2015 08:54:04 PM UTC, comment #4: 

Thanks to your suggestions I tested
dpkg -l '*blas*'
ii libblas-common     1.2.20110419-10 amd64
ii libblas-dev        1.2.20110419-10 amd64
ii libblas3           1.2.20110419-10 amd64
ii libopenblas-base   0.2.12-1        amd64
ii libopenblas-dev    0.2.12-1        amd64

After
  sudo apt-get purge libopenblas-base
it seems to work now.
The problem is, that purging openblas also purged Yade (because it is a dependency of libyade) which I need, but I guess this is a problem for the openblas or yade bug list :(

ukuvbu oibws <xyzdragon>
Wed 29 Jul 2015 08:19:18 PM UTC, comment #3: 

Version 3.8.2 is unsupported.  Unless the behavior can be reproduced in 4.0.0 we will need to close this bug.  The symptoms, however, point away from Octave and towards whatever BLAS or LAPACK library is installed.

Rik <rik5>
Group administrator
Wed 29 Jul 2015 07:53:44 PM UTC, comment #2: 

It appears that you should move up to the current release,
which is 4.0

After minor corrections all the operations with A and B size 12x12
work as expected.

However, they also work under 3.8.2, so there could
be a problem with your installation.


Michael Godfrey <godfrey>
Group Member
Wed 29 Jul 2015 07:36:08 PM UTC, comment #1: 

I can not confirm this, neither with 3.8.2 nor with 4.0.0


21:46 $ /usr/bin/octave
GNU Octave, version 3.8.2
Copyright (C) 2014 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "x86_64-unknown-linux-gnu".

Additional information about Octave is available at http://www.octave.org.

Please contribute if you find this software useful.
For more information, visit http://www.octave.org/get-involved.html

Read http://www.octave.org/bugs.html to learn how to submit bug reports.
For information about changes from previous versions, type 'news'.

octave:1> N=12;
octave:2> A=zeros(N);
octave:3> for n=2:N-1
> A(n,n-1)= 1;
> A(n,n )=-2;
> A(n,n+1)= 1;
> end
octave:4> A=A(2:end-1,2:end-1);
octave:5> disp(A);
                    -2                     1                     0                     0                     0                     0                     0                     0                     0                     0
                     1                    -2                     1                     0                     0                     0                     0                     0                     0                     0
                     0                     1                    -2                     1                     0                     0                     0                     0                     0                     0
                     0                     0                     1                    -2                     1                     0                     0                     0                     0                     0
                     0                     0                     0                     1                    -2                     1                     0                     0                     0                     0
                     0                     0                     0                     0                     1                    -2                     1                     0                     0                     0
                     0                     0                     0                     0                     0                     1                    -2                     1                     0                     0
                     0                     0                     0                     0                     0                     0                     1                    -2                     1                     0
                     0                     0                     0                     0                     0                     0                     0                     1                    -2                     1
                     0                     0                     0                     0                     0                     0                     0                     0                     1                    -2
octave:6> inv(A);
octave:7>



21:49 $ octave-cli
GNU Octave, version 4.0.0
Copyright (C) 2015 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "x86_64-unknown-linux-gnu".

Additional information about Octave is available at http://www.octave.org.

Please contribute if you find this software useful.
For more information, visit http://www.octave.org/get-involved.html

Read http://www.octave.org/bugs.html to learn how to submit bug reports.
For information about changes from previous versions, type 'news'.

octave:1> N=12;
octave:2> A=zeros(N);
octave:3> for n=2:N-1
> A(n,n-1)= 1;
> A(n,n )=-2;
> A(n,n+1)= 1;
> end
octave:4> A=A(2:end-1,2:end-1);
octave:5> disp(A);
                    -2                     1                     0                     0                     0                     0                     0                     0                     0                     0
                     1                    -2                     1                     0                     0                     0                     0                     0                     0                     0
                     0                     1                    -2                     1                     0                     0                     0                     0                     0                     0
                     0                     0                     1                    -2                     1                     0                     0                     0                     0                     0
                     0                     0                     0                     1                    -2                     1                     0                     0                     0                     0
                     0                     0                     0                     0                     1                    -2                     1                     0                     0                     0
                     0                     0                     0                     0                     0                     1                    -2                     1                     0                     0
                     0                     0                     0                     0                     0                     0                     1                    -2                     1                     0
                     0                     0                     0                     0                     0                     0                     0                     1                    -2                     1
                     0                     0                     0                     0                     0                     0                     0                     0                     1                    -2
octave:6> inv(A);
octave:7>


Markus Bergholz <markuman>
Wed 29 Jul 2015 06:58:17 PM UTC, original submission:  

octave --version
  GNU Octave, version 3.8.2
  [...]
   Octave was configured for "x86_64-pc-linux-gnu"
 
%N=11;
N=12;
A=zeros(N);
for n=2:N-1
  A(n,n-1)= 1;
  A(n,n  )=-2;
  A(n,n+1)= 1;
end
A=A(2:end-1,2:end-1);
disp(A);
inv(A);

"Segmentation fault"

This only happens for N=12, not N=11 or less (I cut off the first and last row and column therefore the actual matrix is N-2xN-2 big). I guess it switches to some other method of calculation.

The same happens if I use backslash:
B=zeros(N);
for n=1:N
  B(n,n)=1
end
AB

"Segmentation fault"

It doesn't happen for inv(B) though... Or in general it doesn't seem to hapen for diagonal matrices.


Temporary measure: implement a function mat_inv using a Gauss-Jordan algorithm myself. (very slow!)

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by xyzdragon (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by godfrey (Posted a comment)
  • -email is unavailable- added by markuman (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-07-29 rik5 Open/ClosedOpen Closed
    2015-07-29 rik5 StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code