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

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

[Octave-bug-tracker] [bug #52582] Dependent constant properties in class


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #52582] Dependent constant properties in classdef errors: no such file
Date: Wed, 24 Apr 2019 16:09:48 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

Follow-up Comment #16, bug #52582 (project octave):

With the example posted in comment #2, I see a segfault.  Gdb shows the
following stack trace for the Octave interpreter:


octave:1> x = testL ()

Thread 1 "octave-cli" received signal SIGSEGV, Segmentation fault.
0x00007ffff752cccf in std::__deque_buf_size (__size=<error reading variable:
Cannot access memory at address 0x7fffff7feff8>) at
/usr/include/c++/8/bits/stl_deque.h:93
93        { return (__size < _GLIBCXX_DEQUE_BUF_SIZE
(gdb) where
#0  0x00007ffff752cccf in std::__deque_buf_size (__size=<error reading
variable: Cannot access memory at address 0x7fffff7feff8>) at
/usr/include/c++/8/bits/stl_deque.h:93
#1  0x00007ffff756479a in std::_Deque_iterator<octave::stack_frame*,
octave::stack_frame*&, octave::stack_frame**>::_S_buffer_size () at
/usr/include/c++/8/bits/stl_deque.h:130
#2  0x00007ffff7564832 in std::_Deque_iterator<octave::stack_frame*,
octave::stack_frame*&, octave::stack_frame**>::operator+=
(this=0x7fffff7ff080, __n=0)
    at /usr/include/c++/8/bits/stl_deque.h:212
#3  0x00007ffff7564774 in std::_Deque_iterator<octave::stack_frame*,
octave::stack_frame*&, octave::stack_frame**>::operator+ (this=0x5555555d0af0,
__n=0)
    at /usr/include/c++/8/bits/stl_deque.h:231
#4  0x00007ffff75646cb in std::_Deque_iterator<octave::stack_frame*,
octave::stack_frame*&, octave::stack_frame**>::operator[]
(this=0x5555555d0af0, __n=0)
    at /usr/include/c++/8/bits/stl_deque.h:247
#5  0x00007ffff756467f in std::deque<octave::stack_frame*,
std::allocator<octave::stack_frame*> >::operator[] (this=0x5555555d0ae0,
__n=0)
    at /usr/include/c++/8/bits/stl_deque.h:1404
#6  0x00007ffff771d116 in octave::call_stack::current_scope
(this=0x5555555d0ad8) at
/home/jwe/src/octave/libinterp/corefcn/call-stack.h:114
#7  0x00007ffff77106c2 in octave::tree_evaluator::get_current_scope
(this=0x5555555d08d0) at
/home/jwe/src/octave/libinterp/parse-tree/pt-eval.cc:1868
#8  0x00007ffff7bd2c3e in octave::symbol_table::current_scope
(this=0x5555555d0838) at /home/jwe/src/octave/libinterp/corefcn/symtab.cc:72
#9  0x00007ffff7bd34b7 in octave::symbol_table::find_function
(this=0x5555555d0838, name="testL", search_scope_arg=...) at
/home/jwe/src/octave/libinterp/corefcn/symtab.cc:208

#10 0x00007ffff77138a1 in octave::tree_evaluator::visit_identifier
(this=0x5555555d08d0, expr=...) at
/home/jwe/src/octave/libinterp/parse-tree/pt-eval.cc:2659
#11 0x00007ffff77305f0 in octave::tree_identifier::accept
(this=0x555559ab4b60, tw=...) at
/home/jwe/src/octave/libinterp/parse-tree/pt-id.h:97
#12 0x00007ffff752fb34 in octave::tree_evaluator::evaluate
(this=0x5555555d08d0, expr=0x555559ab4b60, nargout=1) at
/home/jwe/src/octave/libinterp/parse-tree/pt-eval.h:337
#13 0x00007ffff77146ac in octave::tree_evaluator::visit_index_expression
(this=0x5555555d08d0, idx_expr=...) at
/home/jwe/src/octave/libinterp/parse-tree/pt-eval.cc:2947
#14 0x00007ffff77327a6 in octave::tree_index_expression::accept
(this=0x555559ab4c70, tw=...) at
/home/jwe/src/octave/libinterp/parse-tree/pt-idx.h:106
#15 0x00007ffff752fb34 in octave::tree_evaluator::evaluate
(this=0x5555555d08d0, expr=0x555559ab4c70, nargout=1) at
/home/jwe/src/octave/libinterp/parse-tree/pt-eval.h:337

#16 0x00007ffff752c011 in octave::cdef_class::make_meta_class (interp=...,
t=0x555559ab9ed0, is_at_folder=false) at
/home/jwe/src/octave/libinterp/octave-value/cdef-class.cc:1091
#17 0x00007ffff7708706 in octave::tree_classdef::make_meta_class
(this=0x555559ab9ed0, interp=..., is_at_folder=false)
    at /home/jwe/src/octave/libinterp/parse-tree/pt-classdef.cc:173
#18 0x00007ffff7a70827 in octave::interpreter::parse_fcn_file
(this=0x5555555cfcb0,
full_file="/net/devnull/scratch/jwe/build/octave/testL.m", file="testL",
dir_name=".", 
    dispatch_type="", package_name="", require_file=true, force_script=false,
autoload=false, relative_lookup=true, warn_for="")
    at /home/jwe/src/octave/libinterp/corefcn/interpreter.cc:1475
#19 0x00007ffff76e98ca in octave::load_fcn_from_file (file_name="./testL.m",
dir_name=".", dispatch_type="", package_name="", fcn_name="", autoload=false)
    at /home/jwe/src/octave/libinterp/parse-tree/oct-parse.yy:4654
#20 0x00007ffff78585e5 in octave::fcn_info::fcn_info_rep::find_user_function
(this=0x555559aac0a0) at
/home/jwe/src/octave/libinterp/corefcn/fcn-info.cc:759
#21 0x00007ffff7855adb in
octave::fcn_info::fcn_info_rep::load_class_constructor (this=0x555559aac0a0)
at /home/jwe/src/octave/libinterp/corefcn/fcn-info.cc:122
#22 0x00007ffff785721d in octave::fcn_info::fcn_info_rep::xfind
(this=0x555559aac0a0, search_scope=..., args=...) at
/home/jwe/src/octave/libinterp/corefcn/fcn-info.cc:472
#23 0x00007ffff7856b8f in octave::fcn_info::fcn_info_rep::find
(this=0x555559aac0a0, scope=..., args=...) at
/home/jwe/src/octave/libinterp/corefcn/fcn-info.cc:354
#24 0x00007ffff7bd7347 in octave::fcn_info::find (this=0x7fffff8012f0,
search_scope=..., args=...) at
/home/jwe/src/octave/libinterp/corefcn/fcn-info.h:247
#25 0x00007ffff7bd327e in octave::symbol_table::fcn_table_find
(this=0x5555555d0838, name="testL", args=..., search_scope_arg=...)
--Type <RET> for more, q to quit, c to continue without paging--
    at /home/jwe/src/octave/libinterp/corefcn/symtab.cc:175
#26 0x00007ffff7bd35cd in octave::symbol_table::find_function
(this=0x5555555d0838, name="testL", args=..., search_scope=...)
    at /home/jwe/src/octave/libinterp/corefcn/symtab.cc:222
#27 0x00007ffff7bd34eb in octave::symbol_table::find_function
(this=0x5555555d0838, name="testL", search_scope_arg=...) at
/home/jwe/src/octave/libinterp/corefcn/symtab.cc:210
#28 0x00007ffff77138a1 in octave::tree_evaluator::visit_identifier
(this=0x5555555d08d0, expr=...) at
/home/jwe/src/octave/libinterp/parse-tree/pt-eval.cc:2659
#29 0x00007ffff77305f0 in octave::tree_identifier::accept
(this=0x555559aa3740, tw=...) at
/home/jwe/src/octave/libinterp/parse-tree/pt-id.h:97
#30 0x00007ffff752fb34 in octave::tree_evaluator::evaluate
(this=0x5555555d08d0, expr=0x555559aa3740, nargout=1) at
/home/jwe/src/octave/libinterp/parse-tree/pt-eval.h:337
#31 0x00007ffff77146ac in octave::tree_evaluator::visit_index_expression
(this=0x5555555d08d0, idx_expr=...) at
/home/jwe/src/octave/libinterp/parse-tree/pt-eval.cc:2947
#32 0x00007ffff77327a6 in octave::tree_index_expression::accept
(this=0x555559aa3850, tw=...) at
/home/jwe/src/octave/libinterp/parse-tree/pt-idx.h:106
#33 0x00007ffff752fb34 in octave::tree_evaluator::evaluate
(this=0x5555555d08d0, expr=0x555559aa3850, nargout=1) at
/home/jwe/src/octave/libinterp/parse-tree/pt-eval.h:337
#34 0x00007ffff752c011 in octave::cdef_class::make_meta_class (interp=...,
t=0x555559aa8ab0, is_at_folder=false) at
/home/jwe/src/octave/libinterp/octave-value/cdef-class.cc:1091
#35 0x00007ffff7708706 in octave::tree_classdef::make_meta_class
(this=0x555559aa8ab0, interp=..., is_at_folder=false)
    at /home/jwe/src/octave/libinterp/parse-tree/pt-classdef.cc:173
#36 0x00007ffff7a70827 in octave::interpreter::parse_fcn_file
(this=0x5555555cfcb0,
full_file="/net/devnull/scratch/jwe/build/octave/testL.m", file="testL",
dir_name=".", 
    dispatch_type="", package_name="", require_file=true, force_script=false,
autoload=false, relative_lookup=true, warn_for="")
    at /home/jwe/src/octave/libinterp/corefcn/interpreter.cc:1475
#37 0x00007ffff76e98ca in octave::load_fcn_from_file (file_name="./testL.m",
dir_name=".", dispatch_type="", package_name="", fcn_name="", autoload=false)
    at /home/jwe/src/octave/libinterp/parse-tree/oct-parse.yy:4654
#38 0x00007ffff78585e5 in octave::fcn_info::fcn_info_rep::find_user_function
(this=0x555559a9ac80) at
/home/jwe/src/octave/libinterp/corefcn/fcn-info.cc:759
#39 0x00007ffff7855adb in
octave::fcn_info::fcn_info_rep::load_class_constructor (this=0x555559a9ac80)
at /home/jwe/src/octave/libinterp/corefcn/fcn-info.cc:122
#40 0x00007ffff785721d in octave::fcn_info::fcn_info_rep::xfind
(this=0x555559a9ac80, search_scope=..., args=...) at
/home/jwe/src/octave/libinterp/corefcn/fcn-info.cc:472
#41 0x00007ffff7856b8f in octave::fcn_info::fcn_info_rep::find
(this=0x555559a9ac80, scope=..., args=...) at
/home/jwe/src/octave/libinterp/corefcn/fcn-info.cc:354
#42 0x00007ffff7bd7347 in octave::fcn_info::find (this=0x7fffff8034d0,
search_scope=..., args=...) at
/home/jwe/src/octave/libinterp/corefcn/fcn-info.h:247
#43 0x00007ffff7bd327e in octave::symbol_table::fcn_table_find
(this=0x5555555d0838, name="testL", args=..., search_scope_arg=...)
    at /home/jwe/src/octave/libinterp/corefcn/symtab.cc:175
#44 0x00007ffff7bd35cd in octave::symbol_table::find_function
(this=0x5555555d0838, name="testL", args=..., search_scope=...)
    at /home/jwe/src/octave/libinterp/corefcn/symtab.cc:222
#45 0x00007ffff7bd34eb in octave::symbol_table::find_function
(this=0x5555555d0838, name="testL", search_scope_arg=...) at
/home/jwe/src/octave/libinterp/corefcn/symtab.cc:210
#46 0x00007ffff77138a1 in octave::tree_evaluator::visit_identifier
(this=0x5555555d08d0, expr=...) at
/home/jwe/src/octave/libinterp/parse-tree/pt-eval.cc:2659
#47 0x00007ffff77305f0 in octave::tree_identifier::accept
(this=0x555559a92320, tw=...) at
/home/jwe/src/octave/libinterp/parse-tree/pt-id.h:97
#48 0x00007ffff752fb34 in octave::tree_evaluator::evaluate
(this=0x5555555d08d0, expr=0x555559a92320, nargout=1) at
/home/jwe/src/octave/libinterp/parse-tree/pt-eval.h:337
#49 0x00007ffff77146ac in octave::tree_evaluator::visit_index_expression
(this=0x5555555d08d0, idx_expr=...) at
/home/jwe/src/octave/libinterp/parse-tree/pt-eval.cc:2947
#50 0x00007ffff77327a6 in octave::tree_index_expression::accept
(this=0x555559a92430, tw=...) at
/home/jwe/src/octave/libinterp/parse-tree/pt-idx.h:106
#51 0x00007ffff752fb34 in octave::tree_evaluator::evaluate
(this=0x5555555d08d0, expr=0x555559a92430, nargout=1) at
/home/jwe/src/octave/libinterp/parse-tree/pt-eval.h:337
--Type <RET> for more, q to quit, c to continue without paging--
#52 0x00007ffff752c011 in octave::cdef_class::make_meta_class (interp=...,
t=0x555559a97690, is_at_folder=false) at
/home/jwe/src/octave/libinterp/octave-value/cdef-class.cc:1091
#53 0x00007ffff7708706 in octave::tree_classdef::make_meta_class
(this=0x555559a97690, interp=..., is_at_folder=false)
    at /home/jwe/src/octave/libinterp/parse-tree/pt-classdef.cc:173
#54 0x00007ffff7a70827 in octave::interpreter::parse_fcn_file
(this=0x5555555cfcb0,
full_file="/net/devnull/scratch/jwe/build/octave/testL.m", file="testL",
dir_name=".", 
    dispatch_type="", package_name="", require_file=true, force_script=false,
autoload=false, relative_lookup=true, warn_for="")
    at /home/jwe/src/octave/libinterp/corefcn/interpreter.cc:1475
#55 0x00007ffff76e98ca in octave::load_fcn_from_file (file_name="./testL.m",
dir_name=".", dispatch_type="", package_name="", fcn_name="", autoload=false)
    at /home/jwe/src/octave/libinterp/parse-tree/oct-parse.yy:4654
#56 0x00007ffff78585e5 in octave::fcn_info::fcn_info_rep::find_user_function
(this=0x555559a89860) at
/home/jwe/src/octave/libinterp/corefcn/fcn-info.cc:759
#57 0x00007ffff7855adb in
octave::fcn_info::fcn_info_rep::load_class_constructor (this=0x555559a89860)
at /home/jwe/src/octave/libinterp/corefcn/fcn-info.cc:122
#58 0x00007ffff785721d in octave::fcn_info::fcn_info_rep::xfind
(this=0x555559a89860, search_scope=..., args=...) at
/home/jwe/src/octave/libinterp/corefcn/fcn-info.cc:472
#59 0x00007ffff7856b8f in octave::fcn_info::fcn_info_rep::find
(this=0x555559a89860, scope=..., args=...) at
/home/jwe/src/octave/libinterp/corefcn/fcn-info.cc:354
#60 0x00007ffff7bd7347 in octave::fcn_info::find (this=0x7fffff8056b0,
search_scope=..., args=...) at
/home/jwe/src/octave/libinterp/corefcn/fcn-info.h:247
#61 0x00007ffff7bd327e in octave::symbol_table::fcn_table_find
(this=0x5555555d0838, name="testL", args=..., search_scope_arg=...)
    at /home/jwe/src/octave/libinterp/corefcn/symtab.cc:175
#62 0x00007ffff7bd35cd in octave::symbol_table::find_function
(this=0x5555555d0838, name="testL", args=..., search_scope=...)
    at /home/jwe/src/octave/libinterp/corefcn/symtab.cc:222
#63 0x00007ffff7bd34eb in octave::symbol_table::find_function
(this=0x5555555d0838, name="testL", search_scope_arg=...) at
/home/jwe/src/octave/libinterp/corefcn/symtab.cc:210
#64 0x00007ffff77138a1 in octave::tree_evaluator::visit_identifier
(this=0x5555555d08d0, expr=...) at
/home/jwe/src/octave/libinterp/parse-tree/pt-eval.cc:2659
#65 0x00007ffff77305f0 in octave::tree_identifier::accept
(this=0x555559a80f00, tw=...) at
/home/jwe/src/octave/libinterp/parse-tree/pt-id.h:97
#66 0x00007ffff752fb34 in octave::tree_evaluator::evaluate
(this=0x5555555d08d0, expr=0x555559a80f00, nargout=1) at
/home/jwe/src/octave/libinterp/parse-tree/pt-eval.h:337
#67 0x00007ffff77146ac in octave::tree_evaluator::visit_index_expression
(this=0x5555555d08d0, idx_expr=...) at
/home/jwe/src/octave/libinterp/parse-tree/pt-eval.cc:2947
#68 0x00007ffff77327a6 in octave::tree_index_expression::accept
(this=0x555559a81010, tw=...) at
/home/jwe/src/octave/libinterp/parse-tree/pt-idx.h:106
#69 0x00007ffff752fb34 in octave::tree_evaluator::evaluate
(this=0x5555555d08d0, expr=0x555559a81010, nargout=1) at
/home/jwe/src/octave/libinterp/parse-tree/pt-eval.h:337
#70 0x00007ffff752c011 in octave::cdef_class::make_meta_class (interp=...,
t=0x555559a86270, is_at_folder=false) at
/home/jwe/src/octave/libinterp/octave-value/cdef-class.cc:1091
#71 0x00007ffff7708706 in octave::tree_classdef::make_meta_class
(this=0x555559a86270, interp=..., is_at_folder=false)
    at /home/jwe/src/octave/libinterp/parse-tree/pt-classdef.cc:173
#72 0x00007ffff7a70827 in octave::interpreter::parse_fcn_file
(this=0x5555555cfcb0,
full_file="/net/devnull/scratch/jwe/build/octave/testL.m", file="testL",
dir_name=".", 
    dispatch_type="", package_name="", require_file=true, force_script=false,
autoload=false, relative_lookup=true, warn_for="")
    at /home/jwe/src/octave/libinterp/corefcn/interpreter.cc:1475
#73 0x00007ffff76e98ca in octave::load_fcn_from_file (file_name="./testL.m",
dir_name=".", dispatch_type="", package_name="", fcn_name="", autoload=false)
    at /home/jwe/src/octave/libinterp/parse-tree/oct-parse.yy:4654
#74 0x00007ffff78585e5 in octave::fcn_info::fcn_info_rep::find_user_function
(this=0x555559a78440) at
/home/jwe/src/octave/libinterp/corefcn/fcn-info.cc:759
#75 0x00007ffff7855adb in
octave::fcn_info::fcn_info_rep::load_class_constructor (this=0x555559a78440)
at /home/jwe/src/octave/libinterp/corefcn/fcn-info.cc:122
--Type <RET> for more, q to quit, c to continue without paging--
#76 0x00007ffff785721d in octave::fcn_info::fcn_info_rep::xfind
(this=0x555559a78440, search_scope=..., args=...) at
/home/jwe/src/octave/libinterp/corefcn/fcn-info.cc:472
#77 0x00007ffff7856b8f in octave::fcn_info::fcn_info_rep::find
(this=0x555559a78440, scope=..., args=...) at
/home/jwe/src/octave/libinterp/corefcn/fcn-info.cc:354
#78 0x00007ffff7bd7347 in octave::fcn_info::find (this=0x7fffff807890,
search_scope=..., args=...) at
/home/jwe/src/octave/libinterp/corefcn/fcn-info.h:247
#79 0x00007ffff7bd327e in octave::symbol_table::fcn_table_find
(this=0x5555555d0838, name="testL", args=..., search_scope_arg=...)
    at /home/jwe/src/octave/libinterp/corefcn/symtab.cc:175
#80 0x00007ffff7bd35cd in octave::symbol_table::find_function
(this=0x5555555d0838, name="testL", args=..., search_scope=...)
    at /home/jwe/src/octave/libinterp/corefcn/symtab.cc:222
#81 0x00007ffff7bd34eb in octave::symbol_table::find_function
(this=0x5555555d0838, name="testL", search_scope_arg=...) at
/home/jwe/src/octave/libinterp/corefcn/symtab.cc:210


It looks like an infinite recursion problem to me.

If I move the f_isMatlab function outside of the class and change the rest of
the class to be


classdef testL
    properties
      engine
    end
    properties(Constant=true, Hidden=true, Access=private)
        isMatlab = f_isMatlab()
    end
    methods
        function obj = testL()
            if testL.isMatlab
                obj.engine = 'matlab';
            else
                obj.engine = 'octave';
            end
        end
    end
end


then it appears to work.  So the infinite recursion problem might be due to
calling the static method while constructing the class?


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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