bugGNU Octave - Bugs: bug #42116, "out of memory or dimension...

 
 

bug #42116: "out of memory or dimension too large" regression going from 3.6.3 to 3.8.1

Submitter:  Paul Jakma <paul>
Submitted:  Mon 14 Apr 2014 01:44:31 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 3.8.1 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 24 Apr 2014 04:34:06 PM UTC, comment #4: 

The error in 3.8.1 is actually a better result than silently overflowing and returning a negative number for the number of elements.  On the other hand, code that interacts with sparse matrices needs to be very sensitive to the fact that numel() may overflow.  In a lot of sparse code it is better to look at nnz rather than numel.  I made that change in spy.m on the stable branch in this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/3994a1c2b994).  It will be a parto of the 3.8.2 bug fix release, or you can just grab the spy.m from the Mercurial repository and replace your local version with the new one.

Rik <rik5>
Group administrator
Mon 14 Apr 2014 02:09:22 PM UTC, comment #3: 

oops that should have been 50e3 not 50e4 in the previous post.

Carlo de Falco <cdf>
Group Member
Mon 14 Apr 2014 02:08:22 PM UTC, comment #2: 

On the other hand I agree that


y = speye (50000); nnz (50000)


should return 50e4
and


y = speye (50000); numel (50000)


should return 50e4^4 = 2.5000e+11
rather than fail.

so this looks like a bug not a regression
because the current result may be wrong but
the older one was just as bad.

Carlo de Falco <cdf>
Group Member
Mon 14 Apr 2014 01:58:57 PM UTC, comment #1: 

I don't think getting an answer which is a negative real number as the answer to


numel(y)


is any better than getting an error message,
why do you think that behavior was better than the current one?


Carlo de Falco <cdf>
Group Member
Mon 14 Apr 2014 01:44:31 PM UTC, original submission:  

I'm working with 64k × 64k sparse matrices. In 3.6.3 I was able to manipulate and plot these in ways which now sometimes cause errors in 3.8.1. E.g.:

> spy(asgraphs{1}.adj)

error: out of memory or dimension too large for Octave's index type

If I run  numel(nonzeros(..)) on my smaller and larger graphs I get   83226 and 324616. Both these graphs I can 'spy' in 3.6.3. With 3.8.1 however, even the smaller gives the above error.

Further information, requested on #octave:

3.6.3:
octave 1> y=speye(50000); numel(y)
ans = -1.7950e+09
octave:2> octave_config_info.USE_64_BIT_IDX_T
ans = false

3.8.1:
octave:1> y=speye(50000); numel(y)
error: out of memory or dimension too large for Octave's index type
octave:1> octave_config_info.USE_64_BIT_IDX_T
ans = no



Paul Jakma <paul>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by cdf (Posted a comment)
  • -email is unavailable- added by paul (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-04-24 rik5 StatusNone Fixed
        Open/ClosedOpen Closed
    2014-04-14 cdf Item GroupRegression Incorrect Result

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code