bugGNU Octave - Bugs: bug #45843, Feature Request: Special handling...

 
 

bug #45843: Feature Request: Special handling for max_recursion_depth error stack

Submitter:  Rik <rik5>
Submitted:  Sat 29 Aug 2015 02:14:48 PM UTC
   
 
Category:  Interpreter Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 23 Sep 2015 01:48:36 PM UTC, comment #2: 

@Stefan: Thanks for the patch.  I added spaces between the function name and the open parentheses to follow Octave coding conventions and committed it here (http://hg.savannah.gnu.org/hgweb/octave/rev/9502e0142c19).

Rik <rik5>
Group administrator
Fri 04 Sep 2015 11:02:09 PM UTC, comment #1: 

I attached a small changeset that removes consecutive identical error messages from the stack before writing the output.

(file #34814)

Stefan Miereis <stefanm>
Sat 29 Aug 2015 02:14:48 PM UTC, original submission:  

When max recursion depth is exceeded, Octave prints an error stack that is as long as the recursion depth all citing the same line number.  It is a small point, but it would be nicer if Octave would tell you just once that the recursion depth had been exceeded.

I've attached a script, tstrecurse.m, which shows the issue.  The script body is


## Set something far less than the default 256
max_recursion_depth (15);

## Subfunction to endlessly recurse
function recurse ()
   recurse ();
endfunction

## Invoke subfunction which will endlessly recurse
recurse ();


And the output is


octave:4> tstrecurse
error: max_recursion_depth exceeded
error: called from
    recurse at line 14 column 4
    recurse at line 14 column 4
    recurse at line 14 column 4
    recurse at line 14 column 4
    recurse at line 14 column 4
    recurse at line 14 column 4
    recurse at line 14 column 4
    recurse at line 14 column 4
    recurse at line 14 column 4
    recurse at line 14 column 4
    recurse at line 14 column 4
    recurse at line 14 column 4
    recurse at line 14 column 4
    recurse at line 14 column 4
    recurse at line 14 column 4
    tstrecurse at line 18 column 1


It would be nicer if duplicate error messages could be collapsed into a single message so the output was


error: max_recursion_depth exceeded
error: called from
    recurse at line 14 column 4
    tstrecurse at line 18 column 1


It's more of an issue when max_recursion_depth is set at its default of 256.  On the other hand, this doesn't happen very offen so I've made the severity of the report Minor.


Rik <rik5>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #34814:  bug_45843.cset added by stefanm (2KiB - application/octet-stream)
file #34766:  tstrecurse.m added by rik5 (591B - text/x-objcsrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by stefanm (Updated the item)
  • -email is unavailable- added by rik5 (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-09-23 rik5 StatusNone Fixed
        Open/ClosedOpen Closed
    2015-09-04 stefanm Attached File- Added bug_45843.cset, #34814
    2015-08-29 rik5 Attached File- Added tstrecurse.m, #34766

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code