bugGNU Octave - Bugs: bug #56878, Gui segfaults on close, after...

 
 

bug #56878: Gui segfaults on close, after calling classdef constructor from static method

Submitter:  Markus Ebner <seijikun>
Submitted:  Mon 09 Sep 2019 11:57:14 PM UTC
   
 
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 5.1.0 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 10 Sep 2019 05:00:13 PM UTC, comment #1: 

Confirmed in Octave 5, but this seems to have been fixed on the development branch that will become Octave 6, there is no segfault.

For reference, the stack trace at the time of the segfault in Octave 5.1.0 looks like


#0  0x00007fa3e42448d0 in  ()
#1  0x00007fa43a9a4bb7 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (this=0x7fa3e401b6a0) at /usr/include/c++/8/bits/shared_ptr_base.h:148
#2  0x00007fa43a9a4bb7 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (this=0x7fa3e401b6a0) at /usr/include/c++/8/bits/shared_ptr_base.h:148
#3  0x00007fa43a11d666 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() (this=<optimized out>, __in_chrg=<optimized out>) at /usr/include/c++/8/bits/shared_ptr_base.h:1167
#4  0x00007fa43a11d666 in std::__shared_ptr<octave::symbol_scope_rep, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() (this=<optimized out>, __in_chrg=<optimized out>) at /usr/include/c++/8/bits/shared_ptr_base.h:1167
#5  0x00007fa43a11d666 in std::shared_ptr<octave::symbol_scope_rep>::~shared_ptr() (this=<optimized out>, __in_chrg=<optimized out>) at /usr/include/c++/8/bits/shared_ptr.h:103
#6  0x00007fa43a11d666 in octave::symbol_scope::~symbol_scope() (this=<optimized out>, __in_chrg=<optimized out>) at ../libinterp/corefcn/symscope.h:637
#7  0x00007fa43a11d666 in octave::call_stack::stack_frame::~stack_frame() (this=<optimized out>, __in_chrg=<optimized out>) at ../libinterp/corefcn/call-stack.h:52
#8  0x00007fa43a11d666 in __gnu_cxx::new_allocator<octave::call_stack::stack_frame>::destroy<octave::call_stack::stack_frame>(octave::call_stack::stack_frame*) (this=<optimized out>, __p=<optimized out>)
    at /usr/include/c++/8/ext/new_allocator.h:140
#9  0x00007fa43a11d666 in std::allocator_traits<std::allocator<octave::call_stack::stack_frame> >::destroy<octave::call_stack::stack_frame>(std::allocator<octave::call_stack::stack_frame>&, octave::call_stack::stack_frame*)
    (__a=..., __p=<optimized out>) at /usr/include/c++/8/bits/alloc_traits.h:487
#10 0x00007fa43a11d666 in std::deque<octave::call_stack::stack_frame, std::allocator<octave::call_stack::stack_frame> >::_M_pop_back_aux() (this=<optimized out>) at /usr/include/c++/8/bits/deque.tcc:553
#11 0x00007fa43a11d666 in std::deque<octave::call_stack::stack_frame, std::allocator<octave::call_stack::stack_frame> >::pop_back() (this=<optimized out>) at /usr/include/c++/8/bits/stl_deque.h:1622
#12 0x00007fa43a11d666 in octave::call_stack::pop() (this=0x7fa3e4002770) at ../libinterp/corefcn/call-stack.cc:692
#13 0x00007fa439ee827a in octave::unwind_protect::run_first() (this=0x7ffdb1cc5b60) at ../liboctave/util/unwind-prot.h:67
#14 0x00007fa439ee827a in octave::action_container::run(unsigned long) (num=1, this=0x7ffdb1cc5b60) at ../liboctave/util/action-container.h:200
#15 0x00007fa439ee827a in octave::action_container::run() (this=0x7ffdb1cc5b60) at ../liboctave/util/action-container.h:203
#16 0x00007fa439ee827a in octave::unwind_protect::~unwind_protect() (this=0x7ffdb1cc5b60, __in_chrg=<optimized out>) at ../liboctave/util/unwind-prot.h:56
#17 0x00007fa439ee827a in octave_builtin::call(octave::tree_evaluator&, int, octave_value_list const&) (this=<optimized out>, tw=..., nargout=0, args=...) at ../libinterp/octave-value/ov-builtin.cc:52
#18 0x00007fa43a05a9c7 in octave::feval(octave_function*, octave_value_list const&, int) (fcn=0x7fa3e423a870, args=..., nargout=0) at /home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy:5216
#19 0x00007fa43a05ae2b in octave::feval(octave_value&, octave_value_list const&, int) (val=..., args=..., nargout=nargout@entry=0) at /home/jwe/src/octave-stable/libinterp/parse-tree/oct-parse.yy:5227
#20 0x00007fa439f0bc88 in cdef_method::cdef_method_rep::execute(cdef_object const&, octave_value_list const&, int, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
    (this=0x7fa3e423a9a0, obj=..., args=..., nargout=0, do_check_access=<optimized out>, who="destructor") at ../libinterp/octave-value/ov-classdef.cc:3199
#21 0x00007fa439f0beb4 in cdef_method::execute(cdef_object const&, octave_value_list const&, int, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
    (who="destructor", do_check_access=true, nargout=0, args=..., obj=..., this=0x7ffdb1cc5f70) at ../libinterp/octave-value/ov-classdef.h:321
#22 0x00007fa439f0beb4 in cdef_class::cdef_class_rep::delete_object(cdef_object const&) (this=0x7fa3e4827110, obj=...) at ../libinterp/octave-value/ov-classdef.cc:2375
#23 0x00007fa439f0c425 in cdef_class::delete_object(cdef_object const&) (obj=..., this=0x7ffdb1cc60c0) at ../libinterp/octave-value/ov-classdef.h:321
#24 0x00007fa439f0c425 in cdef_object_rep::release(cdef_object const&) (this=0x7fa3e45b7f10, obj=...) at ../libinterp/octave-value/ov-classdef.cc:1295
#25 0x00007fa439f2c02e in cdef_object::~cdef_object() (this=0x7fa3e480b480, __in_chrg=<optimized out>) at ../libinterp/octave-value/ov-classdef.h:219
#26 0x00007fa439f2c02e in octave_classdef::~octave_classdef() (this=0x7fa3e480b470, __in_chrg=<optimized out>) at ../libinterp/octave-value/ov-classdef.h:1486
#27 0x00007fa439f2c02e in octave_classdef::~octave_classdef() (this=0x7fa3e480b470, __in_chrg=<optimized out>) at ../libinterp/octave-value/ov-classdef.h:1486
#28 0x00007fa43a9ca9dc in octave::symbol_info::~symbol_info() (this=0x55929d47dca0, __in_chrg=<optimized out>) at ../libinterp/corefcn/syminfo.h:50
#29 0x00007fa43a9ca9dc in __gnu_cxx::new_allocator<std::_List_node<octave::symbol_info> >::destroy<octave::symbol_info>(octave::symbol_info*) (this=0x55929d644400, __p=0x55929d47dca0) at /usr/include/c++/8/ext/new_allocator.h:140
#30 0x00007fa43a9ca9dc in std::allocator_traits<std::allocator<std::_List_node<octave::symbol_info> > >::destroy<octave::symbol_info>(std::allocator<std::_List_node<octave::symbol_info> >&, octave::symbol_info*)
    (__a=..., __p=0x55929d47dca0) at /usr/include/c++/8/bits/alloc_traits.h:487
#31 0x00007fa43a9ca9dc in std::__cxx11::_List_base<octave::symbol_info, std::allocator<octave::symbol_info> >::_M_clear() (this=this@entry=0x55929d644400) at /usr/include/c++/8/bits/list.tcc:77
#32 0x00007fa43a9c91e8 in std::__cxx11::_List_base<octave::symbol_info, std::allocator<octave::symbol_info> >::~_List_base() (this=0x55929d644400, __in_chrg=<optimized out>) at /usr/include/c++/8/bits/stl_list.h:835
#33 0x00007fa43a9c91e8 in std::__cxx11::list<octave::symbol_info, std::allocator<octave::symbol_info> >::~list() (this=0x55929d644400, __in_chrg=<optimized out>) at /usr/include/c++/8/bits/stl_list.h:835
#34 0x00007fa43a9c91e8 in octave::base_list<octave::symbol_info>::~base_list() (this=0x55929d6443f8, __in_chrg=<optimized out>) at ../liboctave/util/base-list.h:99
#35 0x00007fa43a9c91e8 in octave::symbol_info_list::~symbol_info_list() (this=0x55929d6443f8, __in_chrg=<optimized out>) at ../libinterp/corefcn/syminfo.h:99
#36 0x00007fa43a9c91e8 in octave::workspace_model::~workspace_model() (this=0x55929d6443e0, __in_chrg=<optimized out>) at ../libgui/src/workspace-model.h:52
#37 0x00007fa43a9c91e8 in octave::workspace_model::~workspace_model() (this=0x55929d6443e0, __in_chrg=<optimized out>) at ../libgui/src/workspace-model.h:52
#38 0x00007fa43a9c91e8 in octave::main_window::~main_window() (this=0x55929d59d140, __in_chrg=<optimized out>) at ../libgui/src/main-window.cc:297
#39 0x00007fa43a9c9509 in octave::main_window::~main_window() (this=0x55929d59d140, __in_chrg=<optimized out>) at ../libgui/src/main-window.cc:280
#40 0x00007fa43a9bf6b6 in octave::octave_qt_app::~octave_qt_app() (this=0x7ffdb1cc6220, __in_chrg=<optimized out>) at ../libgui/src/main-window.cc:2900
#41 0x00007fa43a9d6e76 in octave::gui_application::execute() (this=this@entry=0x7ffdb1cc6340) at ../libgui/src/octave-gui.cc:64
#42 0x000055929c7453ac in main(int, char**) (argc=3, argv=0x7ffdb1cc6678) at ../src/main-gui.cc:103



Mike Miller <mtmiller>
Group Member
Mon 09 Sep 2019 11:57:14 PM UTC, original submission:  

I found a reproducible SIGSEV of Octave's GUI.

Steps to reproduce:
1) Creating class TestClass in file TestClass.m with the following code:

classdef TestClass < handle

        methods(Static)
                function self = create()
                        self = TestClass();
                end
        end

end


2) Call the classes' static method to create an instance:

testInstance = TestClass.create();


3) Close the GUI


I attached a backtrace I acquired with gdb from when the SIGSEV happened.
For now, I was only able to reproduce it when closing the GUI, but I had occassional crashes in complexer scripts. But those could also have been caused by my MEX-file.

System information:
2 different systems running openSUSE Tumbleweed
How octave is built: https://build.opensuse.org/package/show/openSUSE:Factory/octave
Resulting octave binary can be downloaded from: https://build.opensuse.org/package/binaries/openSUSE:Factory/octave/standard

Maybe interesting:
Octave is built with -pie, and afaik also with -flto.

Markus Ebner <seijikun>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #47472:  backtrace.txt added by seijikun (6KiB - text/plain)

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -email is unavailable- added by seijikun (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
    2019-11-05 mtmiller Dependencies- bugs #57155 is dependent
    2019-09-10 mtmiller StatusNone Fixed
        Open/ClosedOpen Closed
    2019-09-09 seijikun Attached File- Added backtrace.txt, #47472

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code