bugGNU Octave - Bugs: bug #52111, meta.class.* does not work after...

 
 

bug #52111: meta.class.* does not work after after 'clear classes'

Submitter:  Piotr Held <jsoh425>
Submitted:  Mon 25 Sep 2017 06:31:57 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  In Progress Assigned to:  None
Originator Name:  Piotr Held Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 08 Jan 2018 05:46:12 PM UTC, comment #6: 

Unfortunately, I'm not sure it's really fixed.  Running with the address sanitizer, it looks like some symbol scope resources are not properly released.  It may be that this is preventing "clear all" from removing the meta objects.  If the resource issue is fixed and that causes the meta objects to be cleared by "clear all" or "clear classes", then we will still need a way to prevent these objects from being deleted.

John W. Eaton <jwe>
Group administrator
Mon 08 Jan 2018 05:27:09 PM UTC, comment #5: 

I agree that clearing and reinstalling is not the correct thing to do.

I compiled current tip: cd42d0f341db and tested it. As best I can tell there doesn't seem to be anything to fix.

Thanks for looking at my code! :)

Piotr Held <jsoh425>
Sat 06 Jan 2018 10:27:04 PM UTC, comment #4: 

I pushed the two small changesets:

http://hg.savannah.gnu.org/hgweb/octave/rev/3d1b40992075
http://hg.savannah.gnu.org/hgweb/octave/rev/d6f06eeb8917

I didn't push the other larger one because I'm still not sure whether clearing and reinstalling is the correct thing to do.

Also, I'm no longer seeing the problem that was originally reported.  Now I see this:


octave:1> meta.class.fromName ('inputParser')
ans =

<object meta.class>

octave:2> clear classes
octave:3> meta.class.fromName ('inputParser')
ans =

<object meta.class>


Is there anything left to fix here?

John W. Eaton <jwe>
Group administrator
Fri 29 Sep 2017 12:38:01 AM UTC, comment #3: 

As far as I can tell they don't change.

I dug aroung and found that only the 'meta' package itself needs to be not unregistered (the rest already stays). I am attaching a lot smaller patch with this fix. The patch is in file simple_bug_patch.diff.

I am also attaching a patch disabling 'meta.event' and 'meta.dynproperty' because they don't work and cause Octave to exit. This patch is called octave_panic_bug.diff.

(file #41956, file #41957)

Piotr Held <jsoh425>
Thu 28 Sep 2017 03:50:21 PM UTC, comment #2: 

Once installed, do the meta.* objects ever change?  If not, then instead of deleting and reinstalling them when doing "clear all", should we just avoid deleting them?

John W. Eaton <jwe>
Group administrator
Thu 28 Sep 2017 01:06:00 AM UTC, comment #1: 

I found out a new bug and solved it with this patch (which I don't think there is a need to submit a separate bug, it's all quite intertwined). Octave will close when calling:


meta.event
# or
meta.dynamicproperty


which the latter isn't even Matlab compatible.

The patch introduces two methods:
# cdef_manager::install_meta_classes_in_symtab which is a way of avoiding code duplication.
# cdef_manager::reinit which takes the classes and packages created in cdef_manager::initialize() and reloads them. I could call cdef_manager::initialize again but that increases memory leak from Bug #52123.

I removed tmp_meta* cdef objects from cdef_manager::intialize since they did not really serve any purpose and only cluttered the code. I also removed references to events and dynproperties as they are not implemented and only cause confusion/octave termination.

I also added some documentation to cdef_manager (in ov-classdef.h)



(file #41907)

Piotr Held <jsoh425>
Mon 25 Sep 2017 06:31:57 PM UTC, original submission:  

This problem extends to meta.package as well. The bug can be recreated in the following way:


> meta.class.fromName('inputParser')
ans =
   <object meta.class>
> clear classes
> meta.class.fromName('inputParser')
error: 'meta' undefined near line 1 column 1


I am using a build with the most current cset: 8f3db1ac7877 .

Piotr Held <jsoh425>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #41956:  octave_panic_bug.diff added by jsoh425 (1KiB - text/x-patch)
file #41957:  simple_bug_patch.diff added by jsoh425 (1KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by amro_octave
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by jsoh425 (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-01-06 jwe StatusNone In Progress
    2017-12-07 amro_octave Carbon-Copy- Added amro_octave
    2017-09-29 jsoh425 Attached File- Added octave_panic_bug.diff, #41956
        Attached File- Added simple_bug_patch.diff, #41957
    2017-09-28 jsoh425 Attached File- Added meta_class_clear_all_patch.diff, #41907

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code