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

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

[Octave-bug-tracker] [bug #40739] Attempt to allocate (size_t)-1 bytes w


From: Rik
Subject: [Octave-bug-tracker] [bug #40739] Attempt to allocate (size_t)-1 bytes when trying to length-INT_MAX create sparse vector
Date: Wed, 25 Aug 2021 11:01:21 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36

Update of bug #40739 (project octave):

                Priority:              5 - Normal => 3 - Low                
                  Status:                   Fixed => Confirmed              
             Open/Closed:                  Closed => Open                   

    _______________________________________________________

Follow-up Comment #7:

Re-opening bug report.  This bug is still present, but no longer encountered
frequently because Octave has switched to using a default octave_idx_type of
64 bits.  The logic in the code, however, is still wrong.

To test, configure Octave with '--disable-64'.  Running the second example I
get


octave:1> s = sparse(2^16,2^16,123)
s =

Compressed Column Sparse (rows = 65536, cols = 65536, nnz = 1 [2.3e-08%])

  (65536, 65536) -> 123

octave:2> find (s)
ans = 0


This is not right.  The smallest linear index in Octave is 1 corresponding to
the first element in an array.

Could discuss over on Discourse what we want to do.  As I said, almost no one
encounters this any more because the octave_idx_type is now huge.  Maybe the
decision, therefore, is to just leave this bug open but not spend developer
time on it.

Otherwise, there are ways to fix this including not allowing the creation of
matrices that exceed a certain size, or switching to using doubles for large
indexing (this would set the limit at flintmax [2^53]) for operations where we
know the capacity of octave_idx_type would be exceeded.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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