octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #53844] handle class: delete destructor method


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #53844] handle class: delete destructor method cannot access class properties
Date: Mon, 14 May 2018 22:15:15 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

Follow-up Comment #17, bug #53844 (project octave):

I see a stack trace that begins with:


Thread 1 "octave-cli" received signal SIGSEGV, Segmentation fault.
0x0000555555c675a8 in ?? ()
(gdb) where
#0  0x0000555555c675a8 in ?? ()
#1  0x00007ffff71cf688 in cdef_object_rep::release (this=0x555555936b50,
obj=...) at
/home/jwe/src/octave-stable/libinterp/octave-value/ov-classdef.cc:1227
#2  0x00007ffff6def0a1 in cdef_object::~cdef_object (this=0x555555949600,
__in_chrg=<optimized out>) at
/home/jwe/src/octave-stable/libinterp/octave-value/ov-classdef.h:219
#3  0x00007ffff71febc6 in octave_classdef::~octave_classdef
(this=0x5555559495f0, __in_chrg=<optimized out>) at
/home/jwe/src/octave-stable/libinterp/octave-value/ov-classdef.h:1456
#4  0x00007ffff71febee in octave_classdef::~octave_classdef
(this=0x5555559495f0, __in_chrg=<optimized out>) at
/home/jwe/src/octave-stable/libinterp/octave-value/ov-classdef.h:1456
#5  0x00007ffff6deead6 in octave_value::~octave_value (this=0x7fffffffcd28,
__in_chrg=<optimized out>) at
/home/jwe/src/octave-stable/libinterp/octave-value/ov.h:325
#6  0x00007ffff7378463 in
octave::tree_evaluator::deferred_delete_stack::pop_frame (this=0x5555557d7be0)
at /home/jwe/src/octave-stable/libinterp/parse-tree/pt-eval.h:96
#7  0x00007ffff738abda in
octave::action_container::method_elem<octave::tree_evaluator::deferred_delete_stack>::run
(this=0x555555bde4b0) at
/home/jwe/src/octave-stable/liboctave/util/action-container.h:150


Frames #3 and #4 are suspicious since there appears to be a recursive call to
the octave_classdef destructor for the same object.

I noticed that the classdef code has some member functions that do "delete
this".  That seems like bad form to me, or risky, or at the very least,
fragile.

At this point, I'm beginning to think that we should just revert the change
that started all of this
(http://hg.savannah.gnu.org/hgweb/octave/rev/b328ff3ce0f7) and I will
apologize profusely to everyone for my mistake in pushing it so close to the
release, and attempt to atone for that by doing what I can to make the
classdef code better for version 5.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?53844>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]