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

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

[Octave-bug-tracker] [bug #36656] deleting rows from sparse matrices lea


From: Jordi Gutiérrez Hermoso
Subject: [Octave-bug-tracker] [bug #36656] deleting rows from sparse matrices leads to failed assertion sometimes
Date: Thu, 14 Jun 2012 17:10:59 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20110109 Tundracanine/3.6.13

Update of bug #36656 (project octave):

                 Release:                   3.6.2 => 3.6.1                  

    _______________________________________________________

Follow-up Comment #5:

The failed assertion turns out to be just one case of UB. The second example I
posted distilled from the first exhibits UB in other ways.

At any rate, I attempted your suggested fix:


diff --git a/liboctave/Sparse.h b/liboctave/Sparse.h
--- a/liboctave/Sparse.h
+++ b/liboctave/Sparse.h
@@ -81,15 +81,9 @@
           c[i] = 0;
       }
 
-    SparseRep (octave_idx_type nr, octave_idx_type nc) : d (0), r (0), c (new
octave_idx_type [nc+1]), nzmx (0),
-      nrows (nr), ncols (nc), count (1)
-      {
-        for (octave_idx_type i = 0; i < nc + 1; i++)
-          c[i] = 0;
-      }
-
-    SparseRep (octave_idx_type nr, octave_idx_type nc, octave_idx_type nz) :
d (new T [nz]),
-      r (new octave_idx_type [nz]), c (new octave_idx_type [nc+1]), nzmx
(nz), nrows (nr),
+    SparseRep (octave_idx_type nr, octave_idx_type nc, octave_idx_type nz=0)
+      : d (new T [nz]), r (new octave_idx_type [nz]),
+      c (new octave_idx_type [nc+1]), nzmx (nz), nrows (nr),
       ncols (nc), count (1)
       {
         for (octave_idx_type i = 0; i < nc + 1; i++)



but even with this change, the UB and valgrind's unhappiness persists.

I am very suspicious of cset fdccd69d26bd. There have been some pretty deep
modifications to the sparse code since your initial implementation, David.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?36656>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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