bugGNU Octave - Bugs: bug #35148, Error Msg suppressed: tic;...

 
 

bug #35148: Error Msg suppressed: tic; sparse(1e5, 1e5, 0); toc

Submitted by:  Clem <clemwang>
Submitted on:  Wed 21 Dec 2011 08:10:33 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Regression
Status: FixedAssigned to: None
Originator Name: ClemOpen/Closed: Closed
Release: 3.4.0Operating System: Mac OS

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 16 Apr 2012 08:04:23 PM UTC, comment #5:

I checked in the following change which seems to avoid the problem for me so I'm closing this report.

http://hg.savannah.gnu.org/hgweb/octave/rev/aa491bd9e19b

This fix will appear in the upcoming 3.6.2 release.

John W. Eaton <jwe>
Project Administrator
Mon 16 Apr 2012 07:43:11 PM UTC, comment #4:

The error happens because in

dim_vector::safe_numel throws a std::bad_alloc exception. However, safe_numel is only called when Octave attempts to print the result, not when the sparse matrix object is constructed. So if you terminate the expression with a semicolon, you won't see the error.

I'm not sure why safe numel is called here. We should be able to create a sparse matrix object like this since it doesn't require much memory, and neither of the dimensions are larger than the max index size, only the product is, but that shouldn't matter since we aren't trying to store that number of elements.

John W. Eaton <jwe>
Project Administrator
Fri 13 Apr 2012 05:17:37 AM UTC, comment #3:

I'm marking this as a regression. 3.2.4 accepts 'sparse (1e5, 1e5, 0)' without problem. The issue first arose in 3.4.0.

Rik <rik5>
Project Administrator
Wed 04 Jan 2012 11:55:24 AM UTC, comment #2:

there is also an additional "ans" when sparse fails and no ";"
is used for line termination.

octave:1> zeros(1e5,1e5,0)
error: memory exhausted or requested size too large for range of Octave's index type -- trying to return to prompt
octave:1> sparse(1e5,1e5,0)
error: memory exhausted or requested size too large for range of Octave's index type -- trying to return to prompt
ans =

Compressed Column Sparse (rows = 100000, cols = 100000, nnz = 0octave:1>

octave:1> zeros(1e5,1e5,0);
error: memory exhausted or requested size too large for range of Octave's index type -- trying to return to prompt
octave:1> sparse(1e5,1e5,0);

Similar behaviour in spalloc

Also noted on other sparse functions

octave:4> sprandn(1e5,1e5,0.1)
panic: Aborted -- stopping myself...
attempting to save variables to `octave-core'...
save to `octave-core' complete

marco atzeri <matzeri>
Thu 22 Dec 2011 11:02:30 PM UTC, comment #1:

This is confirmed on a recent development tip (14097:4804ad4ce0de). The oddity is with the sparse matrix constructor in C++ and not with tic()/toc(). The equivalent for a non-sparse array behaves as expected.

Rik <rik5>
Project Administrator
Wed 21 Dec 2011 08:10:33 PM UTC, original submission:

This is a minor bug, but I wasted some time pointlessly trying to time a bad sparse matrix creation without realizing it was in error.

I did:

However, this is very missing leading since the sparse() call failed, but tic and toc seem to have suppressed the error message. Without tic and toc, I see:

(Note: a final LF is missing on this error, so the prompt follows the last 0 and there's a missing close paren too!)

At first, I thought this might be a generic STDERR problem, but no. It's specific to this particular error in sparse() and who knows what other errors. My guess is this error actually went to STDOUT instead of STDERR.

In these calls, tic and toc do not suppress errors:

Clem <clemwang>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by matzeri (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by clemwang (Submitted the item)
  • -unavailable- added by clemwang
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 16 Apr 2012 08:04:23 PM UTCjweStatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Fri 13 Apr 2012 05:17:37 AM UTCrik5Item GroupOther=>Regression
    Thu 22 Dec 2011 11:02:30 PM UTCrik5StatusNone=>Confirmed
    Wed 21 Dec 2011 08:10:33 PM UTCclemwangCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1