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

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

[Octave-bug-tracker] [bug #59937] eval("global b") in m-file segfaults


From: Rik
Subject: [Octave-bug-tracker] [bug #59937] eval("global b") in m-file segfaults
Date: Sun, 24 Jan 2021 18:53:34 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36

Update of bug #59937 (project octave):

                  Status:                    None => Confirmed              
                 Summary: eval("global b") in m-file sigfaults => eval("global
b") in m-file segfaults

    _______________________________________________________

Follow-up Comment #1:

Confirmed.  It is also present on the development branch.

Here is a backtrace from the development branch


#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007f118bd71921 in __GI_abort () at abort.c:79
#2  0x00007f118c3c6957 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007f118c3ccae6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007f118c3ccb21 in std::terminate() ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007f118c3ccd54 in __cxa_throw ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00007f118c3c885d in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#7  0x00007f118e6d64a0 in std::vector<unsigned long, std::allocator<unsigned
long> >::_M_range_check (this=0x7f11584e16a0, __n=2)
    at /usr/include/c++/7/bits/stl_vector.h:825
#8  0x00007f118e6d4821 in std::vector<unsigned long, std::allocator<unsigned
long> >::at (this=0x7f11584e16a0, __n=2)
    at /usr/include/c++/7/bits/stl_vector.h:846
#9  0x00007f118e6cd771 in octave::script_stack_frame::mark_scope (
    this=0x7f11584e1620, sym=..., flag=octave::stack_frame::GLOBAL)
    at libinterp/corefcn/stack-frame.cc:1998
#10 0x00007f118e6d05fc in octave::compiled_fcn_stack_frame::mark_scope (
    this=0x7f11581e7020, sym=..., flag=octave::stack_frame::GLOBAL)
    at libinterp/corefcn/stack-frame.cc:138
#11 0x00007f118e2310aa in octave::stack_frame::mark_global (
    this=0x7f11581e7020, sym=...) at libinterp/corefcn/stack-frame.h:323
#12 0x00007f118e6cadfe in octave::stack_frame::install_variable (
    this=0x7f11581e7020, sym=..., value=..., global=true)
#13 0x00007f118e230fab in octave::stack_frame::make_global
(this=0x7f11581e7020, sym=...)
    at libinterp/corefcn/stack-frame.h:303                                    
   
#14 0x00007f118e22e38f in octave::call_stack::make_global
(this=0x7f1158005960, sym=...)
    at libinterp/corefcn/call-stack.cc:877                                    
    
#15 0x00007f118e16e745 in octave::tree_evaluator::visit_decl_elt
(this=0x7f1158005838, elt=...)
    at libinterp/parse-tree/pt-eval.cc:2812                                   
        
#16 0x00007f118e1a04d6 in octave::tree_decl_elt::accept (this=0x7f1158344390,
tw=...)     
    at libinterp/parse-tree/pt-decl.h:98                                      
            
#17 0x00007f118e1b4de9 in octave::tree_walker::visit_decl_init_list
(this=0x7f1158005838, lst=...)
    at libinterp/parse-tree/pt-walk.cc:132                                    
              
#18 0x00007f118e17b2c8 in octave::tree_decl_init_list::accept
(this=0x7f1158415f00, tw=...)   
    at libinterp/parse-tree/pt-decl.h:165                                     
                 
#19 0x00007f118e16e6a8 in octave::tree_evaluator::visit_decl_command
(this=0x7f1158005838, cmd=...)
    at libinterp/parse-tree/pt-eval.cc:2801                                   
                    
#20 0x00007f118e164568 in octave::tree_decl_command::accept
(this=0x7f115840efb0, tw=...)           
    at libinterp/parse-tree/pt-decl.h:207                                     
                       
#21 0x00007f118e1715dd in octave::tree_evaluator::visit_statement
(this=0x7f1158005838, stmt=...)
    at libinterp/parse-tree/pt-eval.cc:3559
#22 0x00007f118e1a28b4 in octave::tree_statement::accept (this=0x7f11581fe700,
tw=...)
    at libinterp/parse-tree/pt-stmt.h:124
#23 0x00007f118e171bcd in octave::tree_evaluator::visit_statement_list
(this=0x7f1158005838, lst=...)
    at libinterp/parse-tree/pt-eval.cc:3667
#24 0x00007f118df099de in octave::tree_statement_list::accept
(this=0x7f11585163c0, tw=...)
    at libinterp/parse-tree/pt-stmt.h:201
#25 0x00007f118e1670e3 in octave::tree_evaluator::eval_string
(this=0x7f1158005838, 
    eval_str="global b", silent=false, parse_status=@0x7f115fff66e4: 0,
nargout=0)
    at libinterp/parse-tree/pt-eval.cc:946
#26 0x00007f118e167445 in octave::tree_evaluator::eval (this=0x7f1158005838,
try_code="global b", 
    nargout=0) at libinterp/parse-tree/pt-eval.cc:989
#27 0x00007f118e54c9f8 in octave::interpreter::eval (this=0x7f1158004a60,
try_code="global b", 
    nargout=0) at libinterp/corefcn/interpreter.cc:1382
#28 0x00007f118e13cfe2 in Feval (interp=..., args=..., nargout=0)
    at libinterp/parse-tree/oct-parse.yy:5633
#29 0x00007f118df5e868 in octave_builtin::execute (this=0x7f1158024fb0,
tw=..., nargout=0, args=...)
    at libinterp/octave-value/ov-builtin.cc:65
#30 0x00007f118dfc6074 in octave_function::call (this=0x7f1158024fb0, tw=...,
nargout=0, args=...)
    at libinterp/octave-value/ov-fcn.cc:57
#31 0x00007f118e19472b in octave::tree_index_expression::evaluate_n
(this=0x7f115851b400, tw=..., 
    nargout=0) at libinterp/parse-tree/pt-idx.cc:402
#32 0x00007f118e197356 in octave::tree_index_expression::evaluate
(this=0x7f115851b400, tw=..., 
    nargout=0) at libinterp/parse-tree/pt-idx.h:107
#33 0x00007f118e1716c8 in octave::tree_evaluator::visit_statement
(this=0x7f1158005838, stmt=...)
    at libinterp/parse-tree/pt-eval.cc:3582
#34 0x00007f118e1a28b4 in octave::tree_statement::accept (this=0x7f115840ef70,
tw=...)
    at libinterp/parse-tree/pt-stmt.h:124
#35 0x00007f118e171bcd in octave::tree_evaluator::visit_statement_list
(this=0x7f1158005838, lst=...)
    at libinterp/parse-tree/pt-eval.cc:3667
#36 0x00007f118df099de in octave::tree_statement_list::accept
(this=0x7f115821f4b0, tw=...)
    at libinterp/parse-tree/pt-stmt.h:201
#37 0x00007f118e16fe46 in octave::tree_evaluator::execute_user_script
(this=0x7f1158005838, 
    user_script=..., nargout=0, args=...) at
libinterp/parse-tree/pt-eval.cc:3172
#38 0x00007f118e08c970 in octave_user_script::execute (this=0x7f11581f5960,
tw=..., nargout=0, 
    args=...) at libinterp/octave-value/ov-usr-fcn.cc:196
#39 0x00007f118e08c8de in octave_user_script::call (this=0x7f11581f5960,
tw=..., nargout=0, args=...)
    at libinterp/octave-value/ov-usr-fcn.cc:189
#40 0x00007f118e191f9a in octave::tree_identifier::evaluate_n
(this=0x7f1158003260, tw=..., 
    nargout=0) at libinterp/parse-tree/pt-id.cc:130
#41 0x00007f118e192786 in octave::tree_identifier::evaluate
(this=0x7f1158003260, tw=..., nargout=0)
    at libinterp/parse-tree/pt-id.h:98
#42 0x00007f118e1716c8 in octave::tree_evaluator::visit_statement
(this=0x7f1158005838, stmt=...)
    at libinterp/parse-tree/pt-eval.cc:3582
#43 0x00007f118e1a28b4 in octave::tree_statement::accept (this=0x7f11580032a0,
tw=...)
    at libinterp/parse-tree/pt-stmt.h:124
#44 0x00007f118e171bcd in octave::tree_evaluator::visit_statement_list
(this=0x7f1158005838, lst=...)
    at libinterp/parse-tree/pt-eval.cc:3667
#45 0x00007f118df099de in octave::tree_statement_list::accept
(this=0x7f115848f930, tw=...)
    at libinterp/parse-tree/pt-stmt.h:201
#46 0x00007f118e166c52 in octave::tree_evaluator::eval (this=0x7f1158005838, 
    stmt_list=std::shared_ptr<octave::tree_statement_list> (use count 2, weak
count 0) = {...}, 
    interactive=true) at libinterp/parse-tree/pt-eval.cc:862
#47 0x00007f118e166332 in octave::tree_evaluator::repl (this=0x7f1158005838)
    at libinterp/parse-tree/pt-eval.cc:703
#48 0x00007f118e54c000 in octave::interpreter::main_loop
(this=0x7f1158004a60)
    at libinterp/corefcn/interpreter.cc:1220
#49 0x00007f118e547082 in octave::interpreter::execute (this=0x7f1158004a60)
    at libinterp/corefcn/interpreter.cc:814
#50 0x00007f118eedf9a9 in octave::interpreter_qobject::execute
(this=0x559dcbe7ea50)
    at libgui/src/interpreter-qobject.cc:90
#51 0x00007f118f0052ab in octave::interpreter_qobject::qt_static_metacall
(_o=0x559dcbe7ea50, 
    _c=QMetaObject::InvokeMetaMethod, _id=3, _a=0x559dcbef8250)
    at libgui/src/moc-interpreter-qobject.cc:95
#52 0x00007f11899cf0c2 in QObject::event(QEvent*) () from
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#53 0x00007f118a71d83c in QApplicationPrivate::notify_helper(QObject*,
QEvent*) ()
#54 0x00007f118a725104 in QApplication::notify(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#55 0x00007f118ef54dfe in octave::octave_qapplication::notify
(this=0x559dcbddd1a0, 
    receiver=0x559dcbe7ea50, ev=0x559dcbe88700) at
libgui/src/octave-qobject.cc:132
#56 0x00007f118999f8d8 in QCoreApplication::notifyInternal2(QObject*, QEvent*)
()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#57 0x00007f11899a204d in QCoreApplicationPrivate::sendPostedEvents(QObject*,
int, QThreadData*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#58 0x00007f11899f9263 in ?? () from
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#59 0x00007f1181fc2417 in g_main_context_dispatch () from
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#60 0x00007f1181fc2650 in ?? () from
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#61 0x00007f1181fc26dc in g_main_context_iteration () from
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#62 0x00007f11899f888f in
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
    () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#63 0x00007f118999d90a in
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#64 0x00007f11897bc23a in QThread::exec() () from
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#65 0x00007f11897c117d in ?? () from
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#66 0x00007f1188f5c6db in start_thread (arg=0x7f115ffff700) at
pthread_create.c:463
#67 0x00007f118be5271f in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:95


I included everything, but the proximate cause is line 1998 in
stack_frame.cc:


    size_t frame_offset = m_lexical_frame_offsets.at (data_offset);


Since we are indexing, my guess is that data_offset is somehow just out of
range.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59937>

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




reply via email to

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