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: Sat, 12 Oct 2013 19:38:23 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0

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

Maybe not too painful.  Just running the tests for in sparse.tst are enough to
uncover one example.  Of course, sparse.tst has 1204 tests so bisecting that
will still take some time.

I ran Octave under valgrind and then


cd test
test sparse.tst
exit


The leak report is below, and there is a big distance from the Feval to the
actual leak which complicates debugging.


==12359== 56 (40 direct, 16 indirect) bytes in 1 blocks are definitely lost in
loss record 395 of 600
==12359==    at 0x4C2B1C7: operator new(unsigned long) (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12359==    by 0x6FA4E17: Sparse<double>::Sparse(Array<double> const&,
idx_vector const&, idx_vector const&, int, int, bool, int) (Sparse.cc:304)
==12359==    by 0x5F2CD84: MSparse<double>::MSparse(Array<double> const&,
idx_vector const&, idx_vector const&, int, int, bool, int) (MSparse.h:64)
==12359==    by 0x5F2CC78: SparseMatrix::SparseMatrix(Array<double> const&,
idx_vector const&, idx_vector const&, int, int, bool, int) (dSparse.h:81)
==12359==    by 0x601990D: Fsparse(octave_value_list const&, int)
(sparse.cc:200)
==12359==    by 0x5B3B630: octave_builtin::do_multi_index_op(int,
octave_value_list const&, std::list<octave_lvalue,
std::allocator<octave_lvalue> > const*) (ov-builtin.cc:131)
==12359==    by 0x5B3B2D7: 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)
==12359==    by 0x5B3B1C5: octave_builtin::subsref(std::string const&,
std::list<octave_value_list, std::allocator<octave_value_list> > const&, int)
(ov-builtin.cc:47)
==12359==    by 0x5BE1E47: octave_value::subsref(std::string const&,
std::list<octave_value_list, std::allocator<octave_value_list> > const&, int)
(ov.cc:1269)
==12359==    by 0x5BE1EEF: 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)
==12359==    by 0x5C4ABEE: tree_index_expression::rvalue(int,
std::list<octave_lvalue, std::allocator<octave_lvalue> > const*)
(pt-idx.cc:414)
==12359==    by 0x5C4A346: tree_index_expression::rvalue(int) (pt-idx.cc:284)
==12359==    by 0x5C4AE45: tree_index_expression::rvalue1(int)
(pt-idx.cc:425)
==12359==    by 0x5C443EA: tree_evaluator::visit_statement(tree_statement&)
(pt-eval.cc:747)
==12359==    by 0x5C64D53: tree_statement::accept(tree_walker&)
(pt-stmt.cc:178)
==12359==    by 0x5C44655:
tree_evaluator::visit_statement_list(tree_statement_list&) (pt-eval.cc:797)
==12359==    by 0x5C65373: tree_statement_list::accept(tree_walker&)
(pt-stmt.cc:291)
==12359==    by 0x5BD7636: 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)
==12359==    by 0x5BD6F25: octave_user_function::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-usr-fcn.cc:437)
==12359==    by 0x5BD6E13: octave_user_function::subsref(std::string const&,
std::list<octave_value_list, std::allocator<octave_value_list> > const&, int)
(ov-usr-fcn.cc:420)
==12359==    by 0x5BE1E47: octave_value::subsref(std::string const&,
std::list<octave_value_list, std::allocator<octave_value_list> > const&, int)
(ov.cc:1269)
==12359==    by 0x5BE1EEF: 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)
==12359==    by 0x5C4ABEE: tree_index_expression::rvalue(int,
std::list<octave_lvalue, std::allocator<octave_lvalue> > const*)
(pt-idx.cc:414)
==12359==    by 0x5C4A346: tree_index_expression::rvalue(int) (pt-idx.cc:284)
==12359==    by 0x5C8DDCC: eval_string(std::string const&, bool, int&, int)
(oct-parse.yy:4255)
==12359==    by 0x5C8E12C: eval_string(octave_value const&, bool, int&, int)
(oct-parse.yy:4308)
==12359==    by 0x5C8E28F: Feval(octave_value_list const&, int)
(oct-parse.yy:4372)
==12359==    by 0x5B3B630: octave_builtin::do_multi_index_op(int,
octave_value_list const&, std::list<octave_lvalue,
std::allocator<octave_lvalue> > const*) (ov-builtin.cc:131)
==12359==    by 0x5B3B2D7: 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)
==12359==    by 0x5B3B1C5: octave_builtin::subsref(std::string const&,
std::list<octave_value_list, std::allocator<octave_value_list> > const&, int)
(ov-builtin.cc:47)
==12359==    by 0x5BE1E47: octave_value::subsref(std::string const&,
std::list<octave_value_list, std::allocator<octave_value_list> > const&, int)
(ov.cc:1269)
==12359==    by 0x5BE1EEF: 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)
==12359==    by 0x5C4ABEE: tree_index_expression::rvalue(int,
std::list<octave_lvalue, std::allocator<octave_lvalue> > const*)
(pt-idx.cc:414)
==12359==    by 0x5C4A346: tree_index_expression::rvalue(int) (pt-idx.cc:284)
==12359==    by 0x5C4AE45: tree_index_expression::rvalue1(int)
(pt-idx.cc:425)
==12359==    by 0x5C443EA: tree_evaluator::visit_statement(tree_statement&)
(pt-eval.cc:747)
==12359==    by 0x5C64D53: tree_statement::accept(tree_walker&)
(pt-stmt.cc:178)
==12359==    by 0x5C44655:
tree_evaluator::visit_statement_list(tree_statement_list&) (pt-eval.cc:797)
==12359==    by 0x5C65373: tree_statement_list::accept(tree_walker&)
(pt-stmt.cc:291)
==12359==    by 0x5C44A41:
tree_evaluator::visit_try_catch_command(tree_try_catch_command&)
(pt-eval.cc:910)
==12359==    by 0x5C4649B: tree_try_catch_command::accept(tree_walker&)
(pt-except.cc:72)
==12359==    by 0x5C44303: tree_evaluator::visit_statement(tree_statement&)
(pt-eval.cc:721)
==12359==    by 0x5C64D53: tree_statement::accept(tree_walker&)
(pt-stmt.cc:178)
==12359==    by 0x5C44655:
tree_evaluator::visit_statement_list(tree_statement_list&) (pt-eval.cc:797)
==12359==    by 0x5C65373: tree_statement_list::accept(tree_walker&)
(pt-stmt.cc:291)
==12359==    by 0x5C43E64:
tree_evaluator::visit_if_command_list(tree_if_command_list&) (pt-eval.cc:588)
==12359==    by 0x5C62A8F: tree_if_command_list::accept(tree_walker&)
(pt-select.cc:83)
==12359==    by 0x5C43CF7: tree_evaluator::visit_if_command(tree_if_command&)
(pt-eval.cc:563)
==12359==    by 0x5C62CAB: tree_if_command::accept(tree_walker&)
(pt-select.cc:108)
==12359==    by 0x5C44303: tree_evaluator::visit_statement(tree_statement&)
(pt-eval.cc:721)




    _______________________________________________________

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]