bugGNU Octave - Bugs: bug #47685, debug_on_error does not report...

 
 

bug #47685: debug_on_error does not report errors occurring within a "catch" block

Submitter:  Lachlan Andrew <lachlan>
Submitted:  Wed 13 Apr 2016 09:55:17 AM UTC
   
 
Category:  Interpreter Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  lachlan
Originator Name:  Lachlan Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 16 Jun 2016 04:32:57 PM UTC, comment #7: 

The parse tree isn't my area of expertise, but the patch seems to work fine.  I applied it here http://hg.savannah.gnu.org/hgweb/octave/rev/c34f9c182dcf.  For some reason it was checked in under my credentials rather than Lachlan's.  Sorry about that.  The glory of the bug fix should be all yours.


Anyways, I'm marking this as fixed and closing the report.

Rik <rik5>
Group administrator
Wed 15 Jun 2016 09:47:44 AM UTC, comment #6: 

Here is a patch against the current head.  Thanks for looking at this.

(file #37486)

Lachlan Andrew <lachlan>
Sat 11 Jun 2016 05:08:03 AM UTC, comment #5: 

@Lachlan: Could you refresh this patch?  I tried to import it for testing and it failed with rejects.

Rik <rik5>
Group administrator
Thu 02 Jun 2016 12:16:02 AM UTC, comment #4: 

Yes, Matlab does stop.  For the function


function c = foo (x)
a = 1
try
  b = a(2);
catch
  c = b(3);
end


it gives


>> foo

a =

     1

Undefined function or variable "b".

Error in foo (line 6)
  c = b(3);

6     c = b(3);
K>> a

a =

     1

K>>


Lachlan Andrew <lachlan>
Wed 01 Jun 2016 03:37:17 PM UTC, comment #3: 

Does Matlab's equivalent to debug_on_error also stop in the catch block of a try/catch statement?

Rik <rik5>
Group administrator
Wed 13 Apr 2016 11:50:32 AM UTC, comment #2: 

This problem can be avoided by deleting (unwinding) the unwind_protect frame before executing the catch block in tree_evaluator::visit_try_catch_command.

I'm not sure if this is the appropriate solution.  Please let me know.

(file #36917)

Lachlan Andrew <lachlan>
Wed 13 Apr 2016 11:12:21 AM UTC, comment #1: 

The problem appears to be that the error is thrown within a "catch" block.  This may be related to the "debug if caught error" code.  Still looking...

Lachlan Andrew <lachlan>
Wed 13 Apr 2016 09:55:17 AM UTC, original submission:  

When debug_on_error is 1, errors should cause debug mode to be entered, but this doesn't always happen.

In snapshot 32cd60419b61, the following script


function bad_line
  debug_on_error (1);
  line ([1 2 3; 4 5 6], [1 1], 'Color', 'm');
endfunction


throws the error


error: line: number of X, Y, and Z points must be equal
error: called from
    __line__ at line 53 column 7
    line at line 56 column 8
    bad_line at line 3 column 3


without entering debug mode.

(The error itself is solved by the patch for bug #47149.  This bug report is about the failure to enter debug mode.)

Lachlan Andrew <lachlan>

 

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

Attach Files:
   
   
Comment:
   

Attached Files

 

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 lachlan (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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-06-16 rik5 StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2016-06-15 lachlan Attached File- Added bug_47685_dbstop_catch.v1.cset, #37486
    2016-04-13 lachlan Attached File- Added bug_47685_dbstop_catch.cset, #36917
        StatusNone Patch Submitted
        Assigned toNone lachlan
    2016-04-13 lachlan Summarydebug_on_error fails in erroneous calls to line () debug_on_error does not report errors occurring within a "catch" block

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code