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

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

[Octave-bug-tracker] [bug #40231] Memory leaks when parser fails to pars


From: Rik
Subject: [Octave-bug-tracker] [bug #40231] Memory leaks when parser fails to parse
Date: Wed, 16 Oct 2013 18:45:39 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0

Follow-up Comment #15, bug #40231 (project octave):

I narrowed down the memory leak in Feval to this test


%!test
%! clear myerr;
%! try
%!   error ("user-defined error");
%! catch myerr
%!   assert (myerr.message, "user-defined error");
%! end_try_catch


The resulting valgrind output is


==7036== 48 bytes in 1 blocks are definitely lost in loss record 368 of 575
==7036==    at 0x4C2B1C7: operator new(unsigned long) (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7036==    by 0x5C901A4: tree_statement*
make_statement<tree_expression>(tree_expression*) (oct-parse.yy:115)
==7036==    by 0x5C809A8: octave_push_parse(octave_pstate*, int, YYSTYPE
const*, octave_base_parser&) (oct-parse.yy:399)
==7036==    by 0x5C7FD70: octave_pull_parse(octave_pstate*,
octave_base_parser&) (oct-parse.cc:3964)
==7036==    by 0x5C7FCED: octave_parse(octave_base_parser&)
(oct-parse.cc:3932)
==7036==    by 0x5C8B609: octave_parser::run() (oct-parse.yy:3412)
==7036==    by 0x5C8ECEE: eval_string(std::string const&, bool, int&, int)
(oct-parse.yy:4261)
==7036==    by 0x5C8F1CC: eval_string(octave_value const&, bool, int&, int)
(oct-parse.yy:4346)
==7036==    by 0x5C8F32F: Feval(octave_value_list const&, int)
(oct-parse.yy:4410)
==7036==    by 0x5B3C640: octave_builtin::do_multi_index_op(int,
octave_value_list const&, std::list<octave_lvalue,
std::allocator<octave_lvalue> > const*) (ov-builtin.cc:131)
==7036==    by 0x5B3C2E7: octave_builtin::subsref(std::string const&,
std::list<octave_value_list, std::allocator<octave_value_list> > const&, int,
std::list<octave_lvalue, std::allocator<octave_lvalue> > const*)
(ov-builtin.cc:64)
==7036==    by 0x5B3C1D5: octave_builtin::subsref(std::string const&,
std::list<octave_value_list, std::allocator<octave_value_list> > const&, int)
(ov-builtin.cc:47)
==7036==    by 0x5BE2EE7: octave_value::subsref(std::string const&,
std::list<octave_value_list, std::allocator<octave_value_list> > const&, int)
(ov.cc:1269)
==7036==    by 0x5BE2F8F: octave_value::subsref(std::string const&,
std::list<octave_value_list, std::allocator<octave_value_list> > const&, int,
std::list<octave_lvalue, std::allocator<octave_lvalue> > const*) (ov.cc:1280)
==7036==    by 0x5C4BC8E: tree_index_expression::rvalue(int,
std::list<octave_lvalue, std::allocator<octave_lvalue> > const*)
(pt-idx.cc:414)
==7036==    by 0x5C4B3E6: tree_index_expression::rvalue(int) (pt-idx.cc:284)
==7036==    by 0x5C4BEE5: tree_index_expression::rvalue1(int) (pt-idx.cc:425)
==7036==    by 0x5C4548A: tree_evaluator::visit_statement(tree_statement&)
(pt-eval.cc:747)
==7036==    by 0x5C65DF3: tree_statement::accept(tree_walker&)
(pt-stmt.cc:178)
==7036==    by 0x5C456F5:
tree_evaluator::visit_statement_list(tree_statement_list&) (pt-eval.cc:797)
==7036==    by 0x5C66413: tree_statement_list::accept(tree_walker&)
(pt-stmt.cc:291)
==7036==    by 0x5C44F04:
tree_evaluator::visit_if_command_list(tree_if_command_list&) (pt-eval.cc:588)
==7036==    by 0x5C63B2F: tree_if_command_list::accept(tree_walker&)
(pt-select.cc:83)
==7036==    by 0x5C44D97: tree_evaluator::visit_if_command(tree_if_command&)
(pt-eval.cc:563)
==7036==    by 0x5C63D4B: tree_if_command::accept(tree_walker&)
(pt-select.cc:108)
==7036==    by 0x5C453A3: tree_evaluator::visit_statement(tree_statement&)
(pt-eval.cc:721)
==7036==    by 0x5C65DF3: tree_statement::accept(tree_walker&)
(pt-stmt.cc:178)
==7036==    by 0x5C456F5:
tree_evaluator::visit_statement_list(tree_statement_list&) (pt-eval.cc:797)
==7036==    by 0x5C66413: tree_statement_list::accept(tree_walker&)
(pt-stmt.cc:291)
==7036==    by 0x5C45AE1:
tree_evaluator::visit_try_catch_command(tree_try_catch_command&)
(pt-eval.cc:910)
==7036==    by 0x5C4753B: tree_try_catch_command::accept(tree_walker&)
(pt-except.cc:72)
==7036==    by 0x5C453A3: tree_evaluator::visit_statement(tree_statement&)
(pt-eval.cc:721)
==7036==    by 0x5C65DF3: tree_statement::accept(tree_walker&)
(pt-stmt.cc:178)
==7036==    by 0x5C456F5:
tree_evaluator::visit_statement_list(tree_statement_list&) (pt-eval.cc:797)
==7036==    by 0x5C66413: tree_statement_list::accept(tree_walker&)
(pt-stmt.cc:291)
==7036==    by 0x5C44F04:
tree_evaluator::visit_if_command_list(tree_if_command_list&) (pt-eval.cc:588)
==7036==    by 0x5C63B2F: tree_if_command_list::accept(tree_walker&)
(pt-select.cc:83)
==7036==    by 0x5C44D97: tree_evaluator::visit_if_command(tree_if_command&)
(pt-eval.cc:563)
==7036==    by 0x5C63D4B: tree_if_command::accept(tree_walker&)
(pt-select.cc:108)
==7036==    by 0x5C453A3: tree_evaluator::visit_statement(tree_statement&)
(pt-eval.cc:721)
==7036==    by 0x5C65DF3: tree_statement::accept(tree_walker&)
(pt-stmt.cc:178)
==7036==    by 0x5C456F5:
tree_evaluator::visit_statement_list(tree_statement_list&) (pt-eval.cc:797)
==7036==    by 0x5C66413: tree_statement_list::accept(tree_walker&)
(pt-stmt.cc:291)
==7036==    by 0x5C44105:
tree_evaluator::visit_simple_for_command(tree_simple_for_command&)
(pt-eval.cc:369)
==7036==    by 0x5C4EF2B: tree_simple_for_command::accept(tree_walker&)
(pt-loop.cc:125)
==7036==    by 0x5C453A3: tree_evaluator::visit_statement(tree_statement&)
(pt-eval.cc:721)
==7036==    by 0x5C65DF3: tree_statement::accept(tree_walker&)
(pt-stmt.cc:178)
==7036==    by 0x5C456F5:
tree_evaluator::visit_statement_list(tree_statement_list&) (pt-eval.cc:797)
==7036==    by 0x5C66413: tree_statement_list::accept(tree_walker&)
(pt-stmt.cc:291)
==7036==    by 0x5BD86D6: octave_user_function::do_multi_index_op(int,
octave_value_list const&, std::list<octave_lvalue,
std::allocator<octave_lvalue> > const*) (ov-usr-fcn.cc:588)


For simplicity, I've attached the bad file as try.tst to this report.



(file #29389)
    _______________________________________________________

Additional Item Attachment:

File name: try.tst                        Size:0 KB


    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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