bugGNU Octave - Bugs: bug #38414, Unhelpful error message when...

 
 

bug #38414: Unhelpful error message when loading an invalid sparse matrix

Submitted by:  None
Submitted on:  Tue Feb 26 18:16:50 2013  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 3 - LowItem Group: Other
Status: FixedAssigned to: Lachlan Andrew <lachlan>
Originator Name: Michael EkstrandOriginator Email: -unavailable-
Open/Closed: ClosedRelease: dev
Operating System: GNU/Linux

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

(Jump to the original submission Jump to the original submission)

Mon May 16 04:01:12 2016, comment #7:

I went ahead and changed the cset to use 1-based indexing for the elements and checked it in here (http://hg.savannah.gnu.org/hgweb/octave/rev/ac59b72712fd).

I'm trying to reduce the backlog of patches you have submitted :)

Rik <rik5>
Project Administrator
Sat May 14 18:01:34 2016, comment #6:

This seems like a relatively small and useful change. One question, would it not be better to number the elements from 1 (natural language first element) rather than 0 (C-style array)?

Octave's own matrices have 1,1 as their first element, not 0.

Rik <rik5>
Project Administrator
Fri Apr 29 01:53:20 2016, comment #5:

For the attached file "a", the command "load a" gives the problem with a recent default build.

For me, having 1e+05 in column 1 gives

and having 1e+05 in column 2 gives

while having 1e+05 in column 3 gives no error since it isn't an index column

(file #37017)

Lachlan Andrew <lachlan>
Project MemberIn charge of this item.
Fri Apr 29 01:08:18 2016, comment #4:

Is there an example (bad!) data file that can be used to check the patch works as intended? I tried to manually edit a simple sparse matrix saved in the text file to change one of the columns to 1e+05 but I can't reproduce the original error.

Rik <rik5>
Project Administrator
Fri Feb 26 09:27:47 2016, comment #3:

The attached patch gives clearer error messages. It lists the element number at which the error occurs, and if an index fails to lead as an integer, it prints the offending value as a string.

This patch also moves load_sparse_matrix into Sparse.cc from Sparse.h.

(file #36468)

Lachlan Andrew <lachlan>
Project MemberIn charge of this item.
Thu Feb 25 22:01:23 2016, comment #2:

I assume by "inadvertently", the original poster was suggesting that this file was created outside of Octave.

Nevertheless, 1e+05 is mathematically an integer. Would there be value in reading the indices as doubles and explicitly checking for integrality?

Separately from that, if an error is detected, it would be nice to say where in the file it occurs, and what the offending field contained. I'll add that to my to-do list.

Lachlan Andrew <lachlan>
Project MemberIn charge of this item.
Sat Apr 20 00:16:01 2013, comment #1:

Confirmed; the rows and columns fields for all data types must be integers, and sparse indices must be integers. And just to clarify, was this a text file you formatted yourself to be read into Octave, or one created in Octave using the save function?

Mike Miller <mtmiller>
Project Administrator
Tue Feb 26 18:16:50 2013, original submission:

I have an Octave-format text file that (inadvertently) contained a column index of '1e+05' in a sparse matrix. This confused Octave, of course, but the resulting error messages was quite unhelpful:

In particular, there was no indication of where in the (1.6MB compressed) input file the error occurred. Fortunately, JordiGH helped me track it down on IRC, but more helpful error reporting for corrupt input would be very appreciated.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #37017:  a added by lachlan (162B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by lachlan (Posted a comment)
  • -unavailable- added by rik5 (Updated the item)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    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 10 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon May 16 04:01:12 2016rik5StatusPatch Submitted=>Fixed
      Open/ClosedOpen=>Closed
    Fri Apr 29 01:53:20 2016lachlanAttached File-=>Added a, #37017
    Fri Feb 26 09:27:47 2016lachlanAttached File-=>Added bug_38414_sparse_load.cset, #36468
      StatusConfirmed=>Patch Submitted
      Assigned toNone=>lachlan
      Release3.4.2=>dev
    Thu Oct 17 21:36:30 2013rik5Priority5 - Normal=>3 - Low
    Sat Apr 20 00:16:01 2013mtmillerCategoryNone=>Interpreter
      StatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup