octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #56232] Octave crash when inverting an empty s


From: Kai Torben Ohlhus
Subject: [Octave-bug-tracker] [bug #56232] Octave crash when inverting an empty sparse matrix.
Date: Sun, 28 Apr 2019 14:38:52 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.108 Safari/537.36

URL:
  <https://savannah.gnu.org/bugs/?56232>

                 Summary: Octave crash when inverting an empty sparse matrix.
                 Project: GNU Octave
            Submitted by: siko1056
            Submitted on: Sun 28 Apr 2019 08:38:51 PM CEST
                Category: Octave Function
                Severity: 4 - Important
                Priority: 5 - Normal
              Item Group: Segfault, Bus Error, etc.
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 5.1.0
        Operating System: Any

    _______________________________________________________

Details:

I was pointed to an Octave crash, when entering the following line into Octave
4.4.1, 5.1.0, or the 6.0 (hg id: 726d945f23de):


C = sparse (ones (2)); C = C - C; inv (C)


The point is, that by computation the 2x2 sparse matrix becomes empty and
calling `inv` crashes Octave.  On the other hand, when creating an empty
matrix, only an error is thrown:


C = sparse (2, 2, 0); inv (C)
error: inv: sparse_lu: symbolic factorization failed


Matlab R2019a warns in both cases only:


Warning: Matrix is singular to working precision.


Using GDB debugging, I got the following:


Thread 7 "QThread" received signal SIGSEGV, Segmentation fault.
0x00007ffff58f344e in SparseMatrix::tinverse (address@hidden,
mattype=..., address@hidden: 0, 
    address@hidden: 0, calccond=false) at
liboctave/array/dSparse.cc:734
734               retval.xridx (cx) = i;


Somehow octave::math::sparse_lu<SparseMatrix>

https://hg.savannah.gnu.org/hgweb/octave/file/ad77f3204eda/liboctave/array/dSparse.cc#l976

seems not to catch this case of an empty matrix and does not prevent the
following computation.  Maybe I can add a check for this case?




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?56232>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]