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: Rik
Subject: [Octave-bug-tracker] [bug #56232] Octave crash when inverting an empty sparse matrix.
Date: Mon, 6 May 2019 18:47:03 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

Follow-up Comment #12, bug #56232 (project octave):

After much time with gdb, I've found a significant difference.

For a newly created empty sparse matrix the underlying representation is


rep = {d = 0x0, r = 0x0, c = 0x7ff1a415c8f0, nzmx = 0, nrows = 4, ncols = 4,


For the case of C - C it is


rep = {d = 0x7ff1a41817d0, r = 0x7ff1a4315df0, c = 0x7ff1a415c8f0, nzmx = 0,
nrows = 4, ncols = 4,


What you'll notice is that the list of row indices is not a null pointer. 
When the matrix is empty, because there are no row indices, the call to
umfpack_qsymbolic correctly fails.  However, when using C - C, there is
apparently leftover garbage in the memory locations pointed to by r and d
which cause the symbolic factorization to succeed.

This could be fixed in sparse-lu.cc by checking for an empty matrix at the
very start before calling any routines from UMFPACK.

However, I think I might prefer to zero out the data (d) and row (r) pointers
when there are no entries.  This seems safer because I don't know where else
in the Octave code base we might be calling other libraries with empty
matrices.

Thoughts?



    _______________________________________________________

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]