bugGNU Octave - Bugs: bug #59735, classdef sub-classing another...

 
 

bug #59735: classdef sub-classing another class with the same name

Submitter:  None
Submitted:  Sun 20 Dec 2020 01:57:09 AM UTC
   
 
Category:  Classdef Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  None Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Open Release:  * 6.1.0
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 04 Feb 2021 12:23:21 PM UTC, comment #3: 

I modified the class definition like so to make it actual Matlab syntax:

classdef crashoctaveclass < crashoctaveclass
  methods
    function this = crashoctaveclass()
    end
  end
end


With that, I see the following in Matlab R2020b:

>> a = crashoctaveclass();
Error using crashoctaveclass
The class 'crashoctaveclass' is used in its own class definition as a base class, property value, or attribute value.  This is not allowed.


Markus Mützel <mmuetzel>
Group administrator
Thu 04 Feb 2021 08:47:36 AM UTC, comment #2: 

With that exact example matlab r2020b does this:

>> which crashoctaveclass
C:\tmp\crashoctaveclass.m  % crashoctaveclass constructor
>> crashoctaveclass
Error using crashoctaveclass
Error: File: crashoctaveclass.m Line: 2 Column: 3
At least one END is missing: the statement may begin here.
>>


Philip Nienhuis <philipnienhuis>
Group Member
Wed 03 Feb 2021 07:35:07 PM UTC, comment #1: 

What does Matlab do?  Does it really search for the next occurrence of the class with the same name in the load path?  I would expect inheriting from a class of the same name to be an error.

John W. Eaton <jwe>
Group administrator
Sun 20 Dec 2020 01:57:09 AM UTC, original submission:  

Problem description

A class which sub-classes another class with the same name crashes Octave.

To recreate the issue save the following into crashoctaveclass.m


classdef crashoctaveclass<crashoctaveclass
  methods
    function crashoctaveclass()
    endfunction
  endmethods
endclassdef


Octave will crash when the constructor is called:

crashoctaveclass()

What I expect should happen

If crashoctaveclass does not exist in the path I would expect an error message telling me that the class I'm trying to subclass does not exist. If it does exist I would expect my new class to be a subclass of the other class in the path.


Details from windows about the crash

Problem signature:
  Problem Event Name: APPCRASH
  Application Name: octave-gui.exe
  Application Version: 0.0.0.0
  Application Timestamp: 00000000
  Fault Module Name: liboctave-8.dll
  Fault Module Version: 0.0.0.0
  Fault Module Timestamp: 00000000
  Exception Code: c00000fd
  Exception Offset: 00000000007db026
  OS Version: 6.3.9600.2.0.0.768.101
  Locale ID: 3081
  Additional Information 1: 5bc3
  Additional Information 2: 5bc3f6900573deaf55f323776830a52e
  Additional Information 3: 92cc
  Additional Information 4: 92ccb3b39ea9198c5b9dd74ba93cf93d



Anonymous

 

(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 mmuetzel (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  •  

    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.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-01-23 mmuetzel CategoryOctave Function Classdef

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code