bugGNU Octave - Bugs: bug #47620, segfault when using eval and...

 
 

bug #47620: segfault when using eval and anoymous function

Submitted by:  None
Submitted on:  Mon 04 Apr 2016 03:13:40 PM UTC  
 
Category:  Interpreter Severity:  4 - Important
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  None
Originator Name:  Alex Vong Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  4.0.0
Operating System:  GNU/Linux

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 09 Mar 2018 10:34:42 PM UTC, comment #4: 

Is this code supposed to do something useful, or is the correct interpretation that it generates an infinite recursion?

Octave can detect and prevent an infinite recursion if it sees the same function executed recursively many times.  But it doesn't have a protection on an arbitrarily deep call stack.  Maybe it should be doing that instead.

I pushed the following changeset to prevent deeply nested function calls from crashing Octave:

http://hg.savannah.gnu.org/hgweb/octave/rev/41f80b9af274

Now the original example doesn't cause a crash for me, but reports an error about max_stack_depth is exceeded and returns to the command prompt.

Closing as fixed since Octave no longer crashes.

If the real problem is that Octave is interpreting the expression incorrectly, then please open a new bug report and clearly explain WTF this is supposed to do.

John W. Eaton <jwe>
Project Administrator
  Spam posted by anonymous
Mon 04 Apr 2016 04:17:22 PM UTC, comment #3: 

Also noted, this produces a segfault through versions back to 3.2.4 so this issue has been hidden in Octave for a while.

Rik <rik5>
Project Administrator
Mon 04 Apr 2016 04:12:03 PM UTC, comment #2: 

Confirmed.  It takes a few seconds because Octave seems to be caught in an infinite loop.  I ran the development branch under the debugger and used Ctrl+C to stop it after a second or so to get a backtrace.  Here it is:

#0  std::_Rb_tree_insert_and_rebalance (__insert_left=true, __x=0x6080015571a0, __p=0x6080015589a0,
    __header=...) at ../../../../../src/libstdc++-v3/src/c++98/tree.cc:216
216     ../../../../../src/libstdc++-v3/src/c++98/tree.cc: No such file or directory.
(gdb) bt
#0  std::_Rb_tree_insert_and_rebalance (__insert_left=true, __x=0x6080015571a0, __p=0x6080015589a0,
    __header=...) at ../../../../../src/libstdc++-v3/src/c++98/tree.cc:216
#1  0x00007ffff580e8cf in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::list<load_path::file_info, std::allocator<load_path::file_info> > >, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::list<load_path::file_info, std::allocator<load_path::file_info> > > >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::list<load_path::file_info, std::allocator<load_path::file_info> > > > >::_M_insert_node (this=0x6120000186a8,
    __x=0x6080015589a0, __p=0x6080015589a0, __z=0x6080015571a0)
    at /usr/include/c++/5/bits/stl_tree.h:2076
#2  0x00007ffff58085c5 in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::list<load_path::file_info, std::allocator<load_path::file_info> > >, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::list<load_path::file_info, std::allocator<load_path::file_info> > > >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::list<load_path::file_info, std::allocator<load_path::file_info> > > > >::_M_emplace_hint_unique<std::piecewise_construct_t---Type <return> to continue, or q <return> to quit---
const&, std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>, std::tuple<> >(std::_Rb_tree_const_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::list<load_path::file_info, std::allocator<load_path::file_info> > > >, std::piecewise_construct_t const&, std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>&&, std::tuple<>&&) (this=0x6120000186a8, __pos=...)
    at /usr/include/c++/5/bits/stl_tree.h:2177
#3  0x00007ffff58030e7 in std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::list<load_path::file_info, std::allocator<load_path::file_info> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::list<load_path::file_info, std::allocator<load_path::file_info> > > > >::operator[] (this=0x6120000186a8,
    __k=...) at /usr/include/c++/5/bits/stl_map.h:483
#4  0x00007ffff57fc02c in load_path::loader::add_to_fcn_map (this=0x612000018670, di=..., at_end=true,
    updating=true) at libinterp/corefcn/load-path.cc:1908
#5  0x00007ffff58019ec in load_path::loader::add (this=0x612000018670, di=..., at_end=true,
    updating=true) at libinterp/corefcn/load-path.h:531
#6  0x00007ffff57fba4e in load_path::add (this=0x612000018640, di=..., at_end=true, pname=...,
    updating=true) at libinterp/corefcn/load-path.cc:1867
#7  0x00007ffff57f4fa1 in load_path::do_update (this=0x612000018640)
    at libinterp/corefcn/load-path.cc:982
#8  0x00007ffff5213b0f in load_path::update () at libinterp/corefcn/load-path.h:90

#9  0x00007ffff59f896e in symbol_table::fcn_info::fcn_info_rep::find (this=0x6140001d6640, args=...,
    local_funcs=true) at libinterp/corefcn/symtab.cc:711
#10 0x00007ffff5a01e12 in symbol_table::fcn_info::find (this=0x7fffd3258510, args=..., local_funcs=true)
    at libinterp/corefcn/symtab.h:1020
#11 0x00007ffff59fdf56 in symbol_table::do_find (this=0x610000010d40, name=..., args=...,
    skip_variables=true, local_funcs=true) at libinterp/corefcn/symtab.cc:1502
#12 0x00007ffff59fc105 in symbol_table::find (name=..., args=..., skip_variables=true, local_funcs=true)
    at libinterp/corefcn/symtab.cc:1264
#13 0x00007ffff59fc538 in symbol_table::find_function (name=..., args=..., local_funcs=true)
    at libinterp/corefcn/symtab.cc:1300
#14 0x00007ffff520c3a4 in make_fcn_handle (nm=..., local_funcs=true)
    at libinterp/octave-value/ov-fcn-handle.cc:1550
#15 0x00007ffff520ff1d in octave_fcn_binder::maybe_binder (f=...)
    at libinterp/octave-value/ov-fcn-handle.cc:2036
#16 0x00007ffff53e7413 in tree_anon_fcn_handle::rvalue1 (this=0x6070003d6160)
    at libinterp/parse-tree/pt-fcn-handle.cc:138
#17 0x00007ffff53c48ca in tree_argument_list::convert_to_const_vector (this=0x603000257f50, object=0x0)
    at libinterp/parse-tree/pt-arg-list.cc:241
#18 0x00007ffff53ed82a in tree_index_expression::rvalue (this=0x60d000057280, nargout=0,
    lvalue_list=0x0) at libinterp/parse-tree/pt-idx.cc:313
---Type <return> to continue, or q <return> to quit---
#19 0x00007ffff53ecfde in tree_index_expression::rvalue (this=0x60d000057280, nargout=0)
    at libinterp/parse-tree/pt-idx.cc:269
#20 0x00007ffff529d809 in octave_user_function::do_multi_index_op (this=0x6140000fde40, nargout=0,
    _args=..., lvalue_list=0x0) at libinterp/octave-value/ov-usr-fcn.cc:591
#21 0x00007ffff52b2540 in octave_value::do_multi_index_op (this=0x6140000fdc50, nargout=0, idx=...,
    lvalue_list=0x0) at libinterp/octave-value/ov.cc:1293
#22 0x00007ffff5206f30 in octave_fcn_handle::do_multi_index_op (this=0x6140000fdc40, nargout=0,
    args=..., lvalue_list=0x0) at libinterp/octave-value/ov-fcn-handle.cc:221
#23 0x00007ffff5206527 in octave_fcn_handle::subsref (this=0x6140000fdc40, type=..., idx=...,
    nargout=0, lvalue_list=0x0) at libinterp/octave-value/ov-fcn-handle.cc:110
#24 0x00007ffff52062f1 in octave_fcn_handle::subsref (this=0x6140000fdc40, type=..., idx=..., nargout=0)
    at libinterp/octave-value/ov-fcn-handle.cc:93
#25 0x00007ffff52b1771 in octave_value::subsref (this=0x7fffd325af60, type=..., idx=..., nargout=0)
    at libinterp/octave-value/ov.cc:1204
#26 0x00007ffff52b189b in octave_value::subsref (this=0x7fffd325af60, type=..., idx=..., nargout=0,
    lvalue_list=0x0) at libinterp/octave-value/ov.cc:1215
#27 0x00007ffff53ee24d in tree_index_expression::rvalue (this=0x60d000056cd0, nargout=0,
    lvalue_list=0x0) at libinterp/parse-tree/pt-idx.cc:428
#28 0x00007ffff53ecfde in tree_index_expression::rvalue (this=0x60d000056cd0, nargout=0)
    at libinterp/parse-tree/pt-idx.cc:269
#29 0x00007ffff529d809 in octave_user_function::do_multi_index_op (this=0x6140000fbe40, nargout=0,
    _args=..., lvalue_list=0x0) at libinterp/octave-value/ov-usr-fcn.cc:591
#30 0x00007ffff52b2540 in octave_value::do_multi_index_op (this=0x6140000fbc50, nargout=0, idx=...,
    lvalue_list=0x0) at libinterp/octave-value/ov.cc:1293
#31 0x00007ffff5206f30 in octave_fcn_handle::do_multi_index_op (this=0x6140000fbc40, nargout=0,
    args=..., lvalue_list=0x0) at libinterp/octave-value/ov-fcn-handle.cc:221
#32 0x00007ffff5206527 in octave_fcn_handle::subsref (this=0x6140000fbc40, type=..., idx=...,
    nargout=0, lvalue_list=0x0) at libinterp/octave-value/ov-fcn-handle.cc:110
#33 0x00007ffff52062f1 in octave_fcn_handle::subsref (this=0x6140000fbc40, type=..., idx=..., nargout=0)
    at libinterp/octave-value/ov-fcn-handle.cc:93
#34 0x00007ffff52b1771 in octave_value::subsref (this=0x7fffd325c460, type=..., idx=..., nargout=0)
    at libinterp/octave-value/ov.cc:1204
#35 0x00007ffff53edbfd in tree_index_expression::rvalue (this=0x60d00008c390, nargout=0,
    lvalue_list=0x0) at libinterp/parse-tree/pt-idx.cc:363
#36 0x00007ffff53ecfde in tree_index_expression::rvalue (this=0x60d00008c390, nargout=0)
    at libinterp/parse-tree/pt-idx.cc:269
#37 0x00007ffff529d809 in octave_user_function::do_multi_index_op (this=0x6140001d7240, nargout=0,
    _args=..., lvalue_list=0x0) at libinterp/octave-value/ov-usr-fcn.cc:591
#38 0x00007ffff52b2540 in octave_value::do_multi_index_op (this=0x6140001d7050, nargout=0, idx=...,
    lvalue_list=0x0) at libinterp/octave-value/ov.cc:1293
#39 0x00007ffff5206f30 in octave_fcn_handle::do_multi_index_op (this=0x6140001d7040, nargout=0,
---Type <return> to continue, or q <return> to quit---
    args=..., lvalue_list=0x0) at libinterp/octave-value/ov-fcn-handle.cc:221
#40 0x00007ffff5206527 in octave_fcn_handle::subsref (this=0x6140001d7040, type=..., idx=...,
    nargout=0, lvalue_list=0x0) at libinterp/octave-value/ov-fcn-handle.cc:110
#41 0x00007ffff52062f1 in octave_fcn_handle::subsref (this=0x6140001d7040, type=..., idx=..., nargout=0)
    at libinterp/octave-value/ov-fcn-handle.cc:93
#42 0x00007ffff52b1771 in octave_value::subsref (this=0x7fffd325d9b0, type=..., idx=..., nargout=0)
    at libinterp/octave-value/ov.cc:1204
#43 0x00007ffff52b189b in octave_value::subsref (this=0x7fffd325d9b0, type=..., idx=..., nargout=0,
    lvalue_list=0x0) at libinterp/octave-value/ov.cc:1215
#44 0x00007ffff53ee24d in tree_index_expression::rvalue (this=0x60d00008cbb0, nargout=0,
    lvalue_list=0x0) at libinterp/parse-tree/pt-idx.cc:428
#45 0x00007ffff53ecfde in tree_index_expression::rvalue (this=0x60d00008cbb0, nargout=0)
    at libinterp/parse-tree/pt-idx.cc:269
#46 0x00007ffff529d809 in octave_user_function::do_multi_index_op (this=0x6140001d9c40, nargout=0,
    _args=..., lvalue_list=0x0) at libinterp/octave-value/ov-usr-fcn.cc:591
#47 0x00007ffff52b2540 in octave_value::do_multi_index_op (this=0x6140001d9a50, nargout=0, idx=...,
    lvalue_list=0x0) at libinterp/octave-value/ov.cc:1293
#48 0x00007ffff5206f30 in octave_fcn_handle::do_multi_index_op (this=0x6140001d9a40, nargout=0,
    args=..., lvalue_list=0x0) at libinterp/octave-value/ov-fcn-handle.cc:221
#49 0x00007ffff5206527 in octave_fcn_handle::subsref (this=0x6140001d9a40, type=..., idx=...,
    nargout=0, lvalue_list=0x0) at libinterp/octave-value/ov-fcn-handle.cc:110
#50 0x00007ffff52062f1 in octave_fcn_handle::subsref (this=0x6140001d9a40, type=..., idx=..., nargout=0)
    at libinterp/octave-value/ov-fcn-handle.cc:93
#51 0x00007ffff52b1771 in octave_value::subsref (this=0x7fffd325ef00, type=..., idx=..., nargout=0)
    at libinterp/octave-value/ov.cc:1204
#52 0x00007ffff52b189b in octave_value::subsref (this=0x7fffd325ef00, type=..., idx=..., nargout=0,
    lvalue_list=0x0) at libinterp/octave-value/ov.cc:1215
#53 0x00007ffff53ee24d in tree_index_expression::rvalue (this=0x60d00008d3d0, nargout=0,
    lvalue_list=0x0) at libinterp/parse-tree/pt-idx.cc:428
#54 0x00007ffff53ecfde in tree_index_expression::rvalue (this=0x60d00008d3d0, nargout=0)
    at libinterp/parse-tree/pt-idx.cc:269
#55 0x00007ffff529d809 in octave_user_function::do_multi_index_op (this=0x6140001dc640, nargout=0,
    _args=..., lvalue_list=0x0) at libinterp/octave-value/ov-usr-fcn.cc:591
#56 0x00007ffff52b2540 in octave_value::do_multi_index_op (this=0x6140001dc450, nargout=0, idx=...,
    lvalue_list=0x0) at libinterp/octave-value/ov.cc:1293
#57 0x00007ffff5206f30 in octave_fcn_handle::do_multi_index_op (this=0x6140001dc440, nargout=0,
    args=..., lvalue_list=0x0) at libinterp/octave-value/ov-fcn-handle.cc:221
#58 0x00007ffff5206527 in octave_fcn_handle::subsref (this=0x6140001dc440, type=..., idx=...,
    nargout=0, lvalue_list=0x0) at libinterp/octave-value/ov-fcn-handle.cc:110
#59 0x00007ffff52062f1 in octave_fcn_handle::subsref (this=0x6140001dc440, type=..., idx=..., nargout=0)
    at libinterp/octave-value/ov-fcn-handle.cc:93
---Type <return> to continue, or q <return> to quit---
#60 0x00007ffff52b1771 in octave_value::subsref (this=0x7fffd3260450, type=..., idx=..., nargout=0)
    at libinterp/octave-value/ov.cc:1204
#61 0x00007ffff52b189b in octave_value::subsref (this=0x7fffd3260450, type=..., idx=..., nargout=0,
    lvalue_list=0x0) at libinterp/octave-value/ov.cc:1215
#62 0x00007ffff53ee24d in tree_index_expression::rvalue (this=0x60d00008dbf0, nargout=0,
    lvalue_list=0x0) at libinterp/parse-tree/pt-idx.cc:428
#63 0x00007ffff53ecfde in tree_index_expression::rvalue (this=0x60d00008dbf0, nargout=0)
    at libinterp/parse-tree/pt-idx.cc:269
#64 0x00007ffff529d809 in octave_user_function::do_multi_index_op (this=0x6140001df040, nargout=0,
    _args=..., lvalue_list=0x0) at libinterp/octave-value/ov-usr-fcn.cc:591
#65 0x00007ffff52b2540 in octave_value::do_multi_index_op (this=0x6140001dee50, nargout=0, idx=...,
    lvalue_list=0x0) at libinterp/octave-value/ov.cc:1293
#66 0x00007ffff5206f30 in octave_fcn_handle::do_multi_index_op (this=0x6140001dee40, nargout=0,
    args=..., lvalue_list=0x0) at libinterp/octave-value/ov-fcn-handle.cc:221
#67 0x00007ffff5206527 in octave_fcn_handle::subsref (this=0x6140001dee40, type=..., idx=...,
    nargout=0, lvalue_list=0x0) at libinterp/octave-value/ov-fcn-handle.cc:110
#68 0x00007ffff52062f1 in octave_fcn_handle::subsref (this=0x6140001dee40, type=..., idx=..., nargout=0)
    at libinterp/octave-value/ov-fcn-handle.cc:93
#69 0x00007ffff52b1771 in octave_value::subsref (this=0x7fffd32619a0, type=..., idx=..., nargout=0)
    at libinterp/octave-value/ov.cc:1204
#70 0x00007ffff52b189b in octave_value::subsref (this=0x7fffd32619a0, type=..., idx=..., nargout=0,
    lvalue_list=0x0) at libinterp/octave-value/ov.cc:1215
#71 0x00007ffff53ee24d in tree_index_expression::rvalue (this=0x60d00008e410, nargout=0,
    lvalue_list=0x0) at libinterp/parse-tree/pt-idx.cc:428
#72 0x00007ffff53ecfde in tree_index_expression::rvalue (this=0x60d00008e410, nargout=0)
    at libinterp/parse-tree/pt-idx.cc:269
#73 0x00007ffff529d809 in octave_user_function::do_multi_index_op (this=0x6140001c1a40, nargout=0,
    _args=..., lvalue_list=0x0) at libinterp/octave-value/ov-usr-fcn.cc:591
#74 0x00007ffff52b2540 in octave_value::do_multi_index_op (this=0x6140001c1850, nargout=0, idx=...,
    lvalue_list=0x0) at libinterp/octave-value/ov.cc:1293
#75 0x00007ffff5206f30 in octave_fcn_handle::do_multi_index_op (this=0x6140001c1840, nargout=0,
    args=..., lvalue_list=0x0) at libinterp/octave-value/ov-fcn-handle.cc:221
#76 0x00007ffff5206527 in octave_fcn_handle::subsref (this=0x6140001c1840, type=..., idx=...,
    nargout=0, lvalue_list=0x0) at libinterp/octave-value/ov-fcn-handle.cc:110
#77 0x00007ffff52062f1 in octave_fcn_handle::subsref (this=0x6140001c1840, type=..., idx=..., nargout=0)
    at libinterp/octave-value/ov-fcn-handle.cc:93
#78 0x00007ffff52b1771 in octave_value::subsref (this=0x7fffd3262ef0, type=..., idx=..., nargout=0)
    at libinterp/octave-value/ov.cc:1204
#79 0x00007ffff52b189b in octave_value::subsref (this=0x7fffd3262ef0, type=..., idx=..., nargout=0,
    lvalue_list=0x0) at libinterp/octave-value/ov.cc:1215
#80 0x00007ffff53ee24d in tree_index_expression::rvalue (this=0x60d00008ec30, nargout=0,
---Type <return> to continue, or q <return> to quit---
    lvalue_list=0x0) at libinterp/parse-tree/pt-idx.cc:428
#81 0x00007ffff53ecfde in tree_index_expression::rvalue (this=0x60d00008ec30, nargout=0)
    at libinterp/parse-tree/pt-idx.cc:269
#82 0x00007ffff529d809 in octave_user_function::do_multi_index_op (this=0x6140001c4440, nargout=0,
    _args=..., lvalue_list=0x0) at libinterp/octave-value/ov-usr-fcn.cc:591
#83 0x00007ffff52b2540 in octave_value::do_multi_index_op (this=0x6140001c4250, nargout=0, idx=...,
    lvalue_list=0x0) at libinterp/octave-value/ov.cc:1293
#84 0x00007ffff5206f30 in octave_fcn_handle::do_multi_index_op (this=0x6140001c4240, nargout=0,
    args=..., lvalue_list=0x0) at libinterp/octave-value/ov-fcn-handle.cc:221
#85 0x00007ffff5206527 in octave_fcn_handle::subsref (this=0x6140001c4240, type=..., idx=...,
    nargout=0, lvalue_list=0x0) at libinterp/octave-value/ov-fcn-handle.cc:110
#86 0x00007ffff52062f1 in octave_fcn_handle::subsref (this=0x6140001c4240, type=..., idx=..., nargout=0)
    at libinterp/octave-value/ov-fcn-handle.cc:93
#87 0x00007ffff52b1771 in octave_value::subsref (this=0x7fffd3264440, type=..., idx=..., nargout=0)
    at libinterp/octave-value/ov.cc:1204
#88 0x00007ffff52b189b in octave_value::subsref (this=0x7fffd3264440, type=..., idx=..., nargout=0,
    lvalue_list=0x0) at libinterp/octave-value/ov.cc:1215
#89 0x00007ffff53ee24d in tree_index_expression::rvalue (this=0x60d00006ec50, nargout=0,
    lvalue_list=0x0) at libinterp/parse-tree/pt-idx.cc:428
#90 0x00007ffff53ecfde in tree_index_expression::rvalue (this=0x60d00006ec50, nargout=0)
    at libinterp/parse-tree/pt-idx.cc:269
#91 0x00007ffff529d809 in octave_user_function::do_multi_index_op (this=0x6140001c6e40, nargout=0,
    _args=..., lvalue_list=0x0) at libinterp/octave-value/ov-usr-fcn.cc:591
#92 0x00007ffff52b2540 in octave_value::do_multi_index_op (this=0x6140001c6c50, nargout=0, idx=...,
    lvalue_list=0x0) at libinterp/octave-value/ov.cc:1293
#93 0x00007ffff5206f30 in octave_fcn_handle::do_multi_index_op (this=0x6140001c6c40, nargout=0,
    args=..., lvalue_list=0x0) at libinterp/octave-value/ov-fcn-handle.cc:221
#94 0x00007ffff5206527 in octave_fcn_handle::subsref (this=0x6140001c6c40, type=..., idx=...,
    nargout=0, lvalue_list=0x0) at libinterp/octave-value/ov-fcn-handle.cc:110
#95 0x00007ffff52062f1 in octave_fcn_handle::subsref (this=0x6140001c6c40, type=..., idx=..., nargout=0)
    at libinterp/octave-value/ov-fcn-handle.cc:93
#96 0x00007ffff52b1771 in octave_value::subsref (this=0x7fffd3265990, type=..., idx=..., nargout=0)
    at libinterp/octave-value/ov.cc:1204
#97 0x00007ffff52b189b in octave_value::subsref (this=0x7fffd3265990, type=..., idx=..., nargout=0,
    lvalue_list=0x0) at libinterp/octave-value/ov.cc:1215
#98 0x00007ffff53ee24d in tree_index_expression::rvalue (this=0x60d00006f470, nargout=0,
    lvalue_list=0x0) at libinterp/parse-tree/pt-idx.cc:428
#99 0x00007ffff53ecfde in tree_index_expression::rvalue (this=0x60d00006f470, nargout=0)
    at libinterp/parse-tree/pt-idx.cc:269
#100 0x00007ffff529d809 in octave_user_function::do_multi_index_op (this=0x6140001c9840, nargout=0,
    _args=..., lvalue_list=0x0) at libinterp/octave-value/ov-usr-fcn.cc:591
---Type <return> to continue, or q <return> to quit---
#101 0x00007ffff52b2540 in octave_value::do_multi_index_op (this=0x6140001c9650, nargout=0, idx=...,
    lvalue_list=0x0) at libinterp/octave-value/ov.cc:1293
#102 0x00007ffff5206f30 in octave_fcn_handle::do_multi_index_op (this=0x6140001c9640, nargout=0,
    args=..., lvalue_list=0x0) at libinterp/octave-value/ov-fcn-handle.cc:221
#103 0x00007ffff5206527 in octave_fcn_handle::subsref (this=0x6140001c9640, type=..., idx=...,
    nargout=0, lvalue_list=0x0) at libinterp/octave-value/ov-fcn-handle.cc:110
#104 0x00007ffff52062f1 in octave_fcn_handle::subsref (this=0x6140001c9640, type=..., idx=...,
    nargout=0) at libinterp/octave-value/ov-fcn-handle.cc:93
#105 0x00007ffff52b1771 in octave_value::subsref (this=0x7fffd3266ee0, type=..., idx=..., nargout=0)
    at libinterp/octave-value/ov.cc:1204
#106 0x00007ffff52b189b in octave_value::subsref (this=0x7fffd3266ee0, type=..., idx=..., nargout=0,
    lvalue_list=0x0) at libinterp/octave-value/ov.cc:1215
#107 0x00007ffff53ee24d in tree_index_expression::rvalue (this=0x60d00006fc90, nargout=0,
    lvalue_list=0x0) at libinterp/parse-tree/pt-idx.cc:428
#108 0x00007ffff53ecfde in tree_index_expression::rvalue (this=0x60d00006fc90, nargout=0)
    at libinterp/parse-tree/pt-idx.cc:269
#109 0x00007ffff529d809 in octave_user_function::do_multi_index_op (this=0x6140001cc240, nargout=0,
    _args=..., lvalue_list=0x0) at libinterp/octave-value/ov-usr-fcn.cc:591
#110 0x00007ffff52b2540 in octave_value::do_multi_index_op (this=0x6140001cc050, nargout=0, idx=...,
    lvalue_list=0x0) at libinterp/octave-value/ov.cc:1293
#111 0x00007ffff5206f30 in octave_fcn_handle::do_multi_index_op (this=0x6140001cc040, nargout=0,
    args=..., lvalue_list=0x0) at libinterp/octave-value/ov-fcn-handle.cc:221
#112 0x00007ffff5206527 in octave_fcn_handle::subsref (this=0x6140001cc040, type=..., idx=...,
    nargout=0, lvalue_list=0x0) at libinterp/octave-value/ov-fcn-handle.cc:110
#113 0x00007ffff52062f1 in octave_fcn_handle::subsref (this=0x6140001cc040, type=..., idx=...,
    nargout=0) at libinterp/octave-value/ov-fcn-handle.cc:93
#114 0x00007ffff52b1771 in octave_value::subsref (this=0x7fffd3268430, type=..., idx=..., nargout=0)
    at libinterp/octave-value/ov.cc:1204
#115 0x00007ffff52b189b in octave_value::subsref (this=0x7fffd3268430, type=..., idx=..., nargout=0,
    lvalue_list=0x0) at libinterp/octave-value/ov.cc:1215
#116 0x00007ffff53ee24d in tree_index_expression::rvalue (this=0x60d0000704b0, nargout=0,
    lvalue_list=0x0) at libinterp/parse-tree/pt-idx.cc:428
#117 0x00007ffff53ecfde in tree_index_expression::rvalue (this=0x60d0000704b0, nargout=0)
    at libinterp/parse-tree/pt-idx.cc:269
#118 0x00007ffff529d809 in octave_user_function::do_multi_index_op (this=0x6140001cec40, nargout=0,
    _args=..., lvalue_list=0x0) at libinterp/octave-value/ov-usr-fcn.cc:591
#119 0x00007ffff52b2540 in octave_value::do_multi_index_op (this=0x6140001cea50, nargout=0, idx=...,
    lvalue_list=0x0) at libinterp/octave-value/ov.cc:1293
#120 0x00007ffff5206f30 in octave_fcn_handle::do_multi_index_op (this=0x6140001cea40, nargout=0,
    args=..., lvalue_list=0x0) at libinterp/octave-value/ov-fcn-handle.cc:221
#121 0x00007ffff5206527 in octave_fcn_handle::subsref (this=0x6140001cea40, type=..., idx=...,
---Type <return> to continue, or q <return> to quit---
    nargout=0, lvalue_list=0x0) at libinterp/octave-value/ov-fcn-handle.cc:110
#122 0x00007ffff52062f1 in octave_fcn_handle::subsref (this=0x6140001cea40, type=..., idx=...,
    nargout=0) at libinterp/octave-value/ov-fcn-handle.cc:93
#123 0x00007ffff52b1771 in octave_value::subsref (this=0x7fffd3269980, type=..., idx=..., nargout=0)
    at libinterp/octave-value/ov.cc:1204
#124 0x00007ffff52b189b in octave_value::subsref (this=0x7fffd3269980, type=..., idx=..., nargout=0,
    lvalue_list=0x0) at libinterp/octave-value/ov.cc:1215
#125 0x00007ffff53ee24d in tree_index_expression::rvalue (this=0x60d000070cd0, nargout=0,
    lvalue_list=0x0) at libinterp/parse-tree/pt-idx.cc:428
#126 0x00007ffff53ecfde in tree_index_expression::rvalue (this=0x60d000070cd0, nargout=0)
    at libinterp/parse-tree/pt-idx.cc:269
#127 0x00007ffff529d809 in octave_user_function::do_multi_index_op (this=0x6140001b1640, nargout=0,
    _args=..., lvalue_list=0x0) at libinterp/octave-value/ov-usr-fcn.cc:591
#128 0x00007ffff52b2540 in octave_value::do_multi_index_op (this=0x6140001b1450, nargout=0, idx=...,
    lvalue_list=0x0) at libinterp/octave-value/ov.cc:1293
#129 0x00007ffff5206f30 in octave_fcn_handle::do_multi_index_op (this=0x6140001b1440, nargout=0,
    args=..., lvalue_list=0x0) at libinterp/octave-value/ov-fcn-handle.cc:221
#130 0x00007ffff5206527 in octave_fcn_handle::subsref (this=0x6140001b1440, type=..., idx=...,
    nargout=0, lvalue_list=0x0) at libinterp/octave-value/ov-fcn-handle.cc:110
#131 0x00007ffff52062f1 in octave_fcn_handle::subsref (this=0x6140001b1440, type=..., idx=...,
    nargout=0) at libinterp/octave-value/ov-fcn-handle.cc:93
#132 0x00007ffff52b1771 in octave_value::subsref (this=0x7fffd326aed0, type=..., idx=..., nargout=0)
    at libinterp/octave-value/ov.cc:1204
#133 0x00007ffff52b189b in octave_value::subsref (this=0x7fffd326aed0, type=..., idx=..., nargout=0,
    lvalue_list=0x0) at libinterp/octave-value/ov.cc:1215
#134 0x00007ffff53ee24d in tree_index_expression::rvalue (this=0x60d0000714f0, nargout=0,
    lvalue_list=0x0) at libinterp/parse-tree/pt-idx.cc:428
#135 0x00007ffff53ecfde in tree_index_expression::rvalue (this=0x60d0000714f0, nargout=0)
    at libinterp/parse-tree/pt-idx.cc:269
#136 0x00007ffff529d809 in octave_user_function::do_multi_index_op (this=0x6140001b4040, nargout=0,
    _args=..., lvalue_list=0x0) at libinterp/octave-value/ov-usr-fcn.cc:591
#137 0x00007ffff52b2540 in octave_value::do_multi_index_op (this=0x6140001b3e50, nargout=0, idx=...,
    lvalue_list=0x0) at libinterp/octave-value/ov.cc:1293
#138 0x00007ffff5206f30 in octave_fcn_handle::do_multi_index_op (this=0x6140001b3e40, nargout=0,
    args=..., lvalue_list=0x0) at libinterp/octave-value/ov-fcn-handle.cc:221
#139 0x00007ffff5206527 in octave_fcn_handle::subsref (this=0x6140001b3e40, type=..., idx=...,
    nargout=0, lvalue_list=0x0) at libinterp/octave-value/ov-fcn-handle.cc:110
#140 0x00007ffff52062f1 in octave_fcn_handle::subsref (this=0x6140001b3e40, type=..., idx=...,
    nargout=0) at libinterp/octave-value/ov-fcn-handle.cc:93
#141 0x00007ffff52b1771 in octave_value::subsref (this=0x7fffd326c420, type=..., idx=..., nargout=0)
    at libinterp/octave-value/ov.cc:1204
---Type <return> to continue, or q <return> to quit---
#142 0x00007ffff52b189b in octave_value::subsref (this=0x7fffd326c420, type=..., idx=..., nargout=0,
    lvalue_list=0x0) at libinterp/octave-value/ov.cc:1215
#143 0x00007ffff53ee24d in tree_index_expression::rvalue (this=0x60d000071d10, nargout=0,
    lvalue_list=0x0) at libinterp/parse-tree/pt-idx.cc:428
#144 0x00007ffff53ecfde in tree_index_expression::rvalue (this=0x60d000071d10, nargout=0)
    at libinterp/parse-tree/pt-idx.cc:269
#145 0x00007ffff529d809 in octave_user_function::do_multi_index_op (this=0x6140001b6a40, nargout=0,
    _args=..., lvalue_list=0x0) at libinterp/octave-value/ov-usr-fcn.cc:591

The backtrace keeps going out past 1000 function calls but they seem to be the same subsref, do_multi_index_op sequence.

Rik <rik5>
Project Administrator
Mon 04 Apr 2016 03:19:52 PM UTC, comment #1: 

On current dev system (fedora 23):

[godfrey@pbdsl4 P150914]$ oct
>> Y2_ = eval("@(h)feval(@(x)x(x),@(g)h(@(varargin)@()g(g)(varargin{:})))")
Y2_ =

@(h) feval (@(x) x (x), @(g) h (@() @() g (g) (varargin {:})))

>>   Y2_(Y2_)(Y2_)

Segmentation fault (core dumped)
[godfrey@pbdsl4 P150914]$

It took a few seconds of waiting before seg fault.

Michael Godfrey <godfrey>
Project Member
Mon 04 Apr 2016 03:13:40 PM UTC, original submission:  

Hi,

I get a segfault when entering the following into the interpreter:

  Y2_ = eval("@(h)feval(@(x)x(x),@(g)h(@(varargin)@()g(g)(varargin{:})))")
  Y2_(Y2_)(Y2_)

Can anyone reproduce this?

Anonymous

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by godfrey (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-03-09 jwe StatusConfirmed => Fixed
        Open/ClosedOpen => Closed
    2016-07-01 rik5 Severity3 - Normal => 4 - Important
    2016-04-04 rik5 StatusNone => Confirmed

    Back to the top


    Powered by Savane 3.5