bugGNU Octave - Bugs: bug #56272, The keyboard function and...

 
 

bug #56272: The keyboard function and debug_on_error handling of functions in a file is wrong

Submitter:  Robert Fries <rwf1>
Submitted:  Mon 06 May 2019 04:24:24 AM UTC
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  rwf1 Open/Closed:  * Closed
Release:  * 4.4.1 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       

 

Thu 28 Jan 2021 02:53:56 PM UTC, comment #3: 

Version 6.1 fixes it for me.  Thanks.

Robert Fries <rwf1>
Thu 28 Jan 2021 06:17:45 AM UTC, comment #2: 

This problem appears to be fixed in Octave 6.1.  I see the following behavior:

octave:1> source foofuns.m
octave:2> FuncOuter(1)
Calling keyboard
stopped in FuncInner at line 5 [.../foofuns.m]
5:     keyboard("Inner> ");
Inner> dbcont
ans = 1
octave:3> debug_on_error (1)
octave:4> FuncOuter(2)
Calling error
error: iIn is 2
error: called from
    FuncInner at line 9 column 5
    FuncOuter at line 14 column 7
stopped in FuncInner at line 9 [.../foofuns.m]
9:     error("iIn is 2");
debug> dbwhere
stopped in FuncInner at line 9 [.../foofuns.m]
debug> quit

If there is still a problem, please comment and we can re-open or  open a new bug report.

John W. Eaton <jwe>
Project Administrator
Thu 21 May 2020 04:19:29 PM UTC, comment #1: 

This is probably a duplicate of bug #54789.

Markus M├╝tzel <mmuetzel>
Project Member
Mon 06 May 2019 04:24:24 AM UTC, original submission:  

To see this problem put this code into a file

1;
function iOut=FuncInner(iIn)
  if (iIn==1)
    fprintf(stderr,"Calling keyboard\n");
    keyboard("Inner> ");
  end
  if (iIn==2)
    fprintf(stderr,"Calling error\n");
    error("iIn is 2");
  end
  iOut=iIn;
end
function jOut=FuncOuter(jIn)
  jOut=FuncInner(jIn);
end

Then source the file to load the functions.
Two problems can be seen.  First run

FuncOuter(1)

The expected result is to be put into the debugger

octave:2> FuncOuter(1)
Calling keyboard
stopped in FuncInner at line 5
Inner>

The behaviour with the problem is

octave:2> FuncOuter(1)
Calling keyboard
error: FuncInner: no such file, ''
error: called from
    FuncInner at line 5 column 5
    FuncOuter at line 14 column 7
octave:2>

The second problem is the handling of an error call when debug_on_error is set to 1.  The expected behaviour is to be put into the debugger.

octave:3> debug_on_error(1)
octave:4> FuncOuter(2)
Calling error
error: iIn is 2
error: called from
    FuncInner at line 9 column 5
    FuncOuter at line 14 column 7
stopped in FuncInner at line 9
debug>

The behaviour with the problem is

octave:2> debug_on_error(1)
octave:3> FuncOuter(2)
Calling error
error: iIn is 2
error: called from
    FuncInner at line 9 column 5
    FuncOuter at line 14 column 7
error: error: no such file, ''
error: called from
    FuncInner at line 9 column 5
    FuncOuter at line 14 column 7
octave:3>

The correct results are seen in Fedora 28 which has release 4-2-2.  The problem is present in Fedora 30 which has release 4-4-1.  A bisect shows that the problem starts with changeset
25034:6e4121c39957

Robert Fries <rwf1>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by rwf1 (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 project members can vote.

     

     

     

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-01-28 jwe StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2020-05-21 mmuetzel StatusNone Confirmed
        Operating SystemGNU/Linux Any
        Dependencies- Depends on bugs #54789

    Back to the top


    Powered by Savane 3.9