[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: |
Philipp Kutin |
Subject: |
[Octave-bug-tracker] [bug #40739] Attempt to allocate (size_t)-1 bytes when trying to length-INT_MAX create sparse vector |
Date: |
Thu, 28 Nov 2013 19:54:16 +0000 |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0 |
Follow-up Comment #2, bug #40739 (project octave):
More sparse badness...
octave-cli:3> s = sparse(2^16,2^16,123)
s =
Compressed Column Sparse (rows = 65536, cols = 65536, nnz = 1 [2.3e-08%])
(65536, 65536) -> 123
octave-cli:4> find(s)
../../libinterp/corefcn/find.cc:178:25: runtime error: signed integer
overflow: 65535 * 65536 cannot be represented in type 'int'
ans = 0
Need to sort my thoughts to write a larger rant about these (or rather, reply
to bug #40712), but for now it seems that linear indices should be avoided for
sparse arrays whose #cols*#rows product overflows an int.
On the positive side, it sure is nice that stuff works even for say,
300k-by-300k sparse matrices, as long as you take care not to deal with linear
indices.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?40739>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/