bugGNU Octave - Bugs: bug #63545, [GUI] Errors shown repeatedly in...

 
 

bug #63545: [GUI] Errors shown repeatedly in Command Window when there is an error in a classdef size() method

Submitter:  Martynas <mpata>
Submitted:  Sun 18 Dec 2022 03:32:10 AM UTC
   
 
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Other
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * 7.3.0 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 19 Dec 2022 06:52:27 PM UTC, comment #2: 

The problem, as Dmitri noted, is only in the GUI.  Octave creates the object successfully in either the CLI or GUI.  But in the CLI an error is only issued when the function size() is called.  In the GUI, there is a Workspace Window which displays defined variables along with their class, size, value, and any attributes.  This is, essentially, the output of the whos() function.  It executes this function periodically, and regardless of whether the Workspace Window is displayed.

This is annoying, but I'm not sure there is a simple way to fix it.  I'm not that familiar with the GUI code so someone who does know more should comment.

Two workarounds for the moment:

1) Develop code in the CLI.
2) Use the menu option Edit->Clear Workspace to remove the problem variable containing the badly formed classdef object.


Rik <rik5>
Group administrator
Sun 18 Dec 2022 04:43:54 AM UTC, comment #1: 

I can reproduce this on linux (Fedora) with 7.3, 8.0.1 and 9.0
in GUI mode only. Seems to work fine in cli.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Sun 18 Dec 2022 03:32:10 AM UTC, original submission:  

Errors are shown repeatedly when there is an error in method size(). For example, let's have a class, where method size() runs into an error (referring to undefined variable A instead of property A; a relatively natural mistake if one wants to have the size of an object to be reported equal to the size of something else):


classdef TestObj
  properties
    A;
  endproperties
  methods
    function [obj] = TestObj()
      obj.A = 5;
    endfunction

    function [varargout] = size (obj, dimnr)
      [numofrows, numofvars] = size (A);
    endfunction
  endmethods
end


Let's run a script that creates such an object and displays it (not even calling size() explicitly):


[obj] = TestObj();

obj


The result (after actually showing an object) is an unending series of errors:


>> error: 'A' undefined near line 11, column 38
error: called from
    size at line 11 column 30
>> error: 'A' undefined near line 11, column 38
error: called from
    size at line 11 column 30


This series is not even stopped by Ctrl+C.

Now, reporting one error would have been fine (while it might not be obvious that method size() is going to be run when an object is merely being displayed, at least that becomes somewhat clearer after seeing an error message), but that should not result in such an infinite loop.

Martynas <mpata>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

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 dasergatskov (Posted a comment)
  • -email is unavailable- added by mpata (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
    2023-01-11 rik5 SummaryErrors shown repeatedly when there is an error in method size() [GUI] Errors shown repeatedly in Command Window when there is an error in a classdef size() method
    2022-12-19 rik5 CategoryNone GUI
        Item GroupNone Other
        StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code