bugGNU Octave - Bugs: bug #59775, "error: mark_as_constructed:...


bug #59775: "error: mark_as_constructed: invalid object" when constructor returns classdef array

Submitter:  None
Submitted:  Tue 29 Dec 2020 11:42:25 AM UTC
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Confirmed Assigned to:  None
Originator Name:  Marc Pfetsch Originator Email:  -email is unavailable-
Open/Closed:  * Open Release:  * dev
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Tue 09 Aug 2022 03:20:24 PM UTC, comment #3: 

I am running into this error with Octave 5.2, the original workaround provided here has not worked in my case. 

The header file cdef-object.h was not found but I did have ov-classdef.h which contained the class

class cdef_object_array : public cdef_object_base

I added the two suggested functions and unfortunately kept on having the same error when running my script. I have also attempted to run the MAC.m script provided in this discussion.

Any help or update about this issue is appreciated.

Fouad Matari <fmatari>
Fri 29 Jul 2022 11:18:49 AM UTC, comment #2: 

Are there any news on this issue?

Sun 17 Jan 2021 05:29:27 PM UTC, comment #1: 

I can confirm this error in Octave 5.2, 6.1, a current stable (hg id 8b65dc1fd34d), and default (hg id 1ece396fe3df).

The same class constructs without error with Matlab R2020b.

Markus M├╝tzel <mmuetzel>
Group administrator
Tue 29 Dec 2020 11:42:25 AM UTC, original submission:  

The attached class produces the error

error: mark_as_constructed: invalid object

e.g. for the call M=MAC(2).

To fix the problem one can do the following, although I am not sure whether the solution is correct:

In libinterp/octave-value/cdef-object.h and in

  class cdef_object_array : public cdef_object_base

one can add

  void mark_as_constructed (void) { }
  void mark_as_constructed (const cdef_class& cls) { }

In any case, the original virtual functions do not seem to be overloaded correctly for "arrays of classes".



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

Attach Files:

Attached Files
file #50584:  MAC.m added by None (321B - text/x-objcsrc - Mark As Constructed error example)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by fmatari (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by None (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-01-17 mmuetzel CategoryOctave Function Interpreter
        StatusNone Confirmed
        Release6.1.0 dev
        Operating SystemGNU/Linux Any
        Summaryerror: mark_as_constructed: invalid object "error: mark_as_constructed: invalid object" when constructor returns classdef array
    2020-12-29 None Attached File- Added MAC.m, #50584

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code