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

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

[Octave-bug-tracker] [bug #53514] Memory leaks in 4.4 release


From: Rik
Subject: [Octave-bug-tracker] [bug #53514] Memory leaks in 4.4 release
Date: Fri, 30 Mar 2018 01:28:22 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Follow-up Comment #12, bug #53514 (project octave):

It seems that it maybe the type_info class needs a destructor which
unregisters all the registered types.

The backtrace for one of the 8 byte leaks is


Direct leak of 8 byte(s) in 1 object(s) allocated from:
    #0 0x7fe742baf532 in operator new(unsigned long)
(/usr/lib/x86_64-linux-gnu/libasan.so.2+0x99532)
    #1 0x7fe741196ed0 in
octave::type_info::register_type(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&,
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>
> const&, octave_value const&, bool)
libinterp/octave-value/ov-typeinfo.cc:152
    #2 0x7fe7410c4982 in octave_magic_colon::register_type(octave::type_info&)
libinterp/octave-value/ov-colon.cc:34
    #3 0x7fe7411d0b82 in install_types(octave::type_info&)
libinterp/octave-value/ov.cc:2932
    #4 0x7fe7411964c8 in octave::type_info::type_info(int)
libinterp/octave-value/ov-typeinfo.cc:80
    #5 0x7fe7417cd6d7 in
octave::interpreter::interpreter(octave::application*)
libinterp/corefcn/interpreter.cc:369
    #6 0x7fe740a9e78b in octave::application::create_interpreter()
libinterp/octave.cc:314


interpreter.cc:369 is the constructor for an interpreter object.  One of the
data members is m_type_info().  

The constructor for type_info is next at ov-typeinfo.cc:80 which calls


  install_types (*this);


install_types is in ov.cc and has 55 register_type calls 


void
install_types (octave::type_info& ti)
{
  octave_base_value::register_type (ti);
  octave_cell::register_type (ti);
  octave_scalar::register_type (ti);
  octave_complex::register_type (ti);
  octave_matrix::register_type (ti);
  octave_diag_matrix::register_type (ti);
  octave_complex_matrix::register_type (ti);
  octave_complex_diag_matrix::register_type (ti);
  octave_range::register_type (ti);
  octave_bool::register_type (ti);
  octave_bool_matrix::register_type (ti);
  octave_char_matrix_str::register_type (ti);
  octave_char_matrix_sq_str::register_type (ti);
  octave_int8_scalar::register_type (ti);
  octave_int16_scalar::register_type (ti);
  octave_int32_scalar::register_type (ti);
  octave_int64_scalar::register_type (ti);
  octave_uint8_scalar::register_type (ti);
  octave_uint16_scalar::register_type (ti);
  octave_uint32_scalar::register_type (ti);
  octave_uint64_scalar::register_type (ti);
  octave_int8_matrix::register_type (ti);
  octave_int16_matrix::register_type (ti);
  octave_int32_matrix::register_type (ti);
  octave_int64_matrix::register_type (ti);
  octave_uint8_matrix::register_type (ti);
  octave_uint16_matrix::register_type (ti);
  octave_uint32_matrix::register_type (ti);
  octave_uint64_matrix::register_type (ti);
  octave_sparse_bool_matrix::register_type (ti);
  octave_sparse_matrix::register_type (ti);
  octave_sparse_complex_matrix::register_type (ti);
  octave_struct::register_type (ti);
  octave_scalar_struct::register_type (ti);
  octave_class::register_type (ti);
  octave_cs_list::register_type (ti);
  octave_magic_colon::register_type (ti);
  octave_builtin::register_type (ti);
  octave_user_function::register_type (ti);
  octave_dld_function::register_type (ti);
  octave_fcn_handle::register_type (ti);
  octave_fcn_inline::register_type (ti);
  octave_float_scalar::register_type (ti);
  octave_float_complex::register_type (ti);
  octave_float_matrix::register_type (ti);
  octave_float_diag_matrix::register_type (ti);
  octave_float_complex_matrix::register_type (ti);
  octave_float_complex_diag_matrix::register_type (ti);
  octave_perm_matrix::register_type (ti);
  octave_null_matrix::register_type (ti);
  octave_null_str::register_type (ti);
  octave_null_sq_str::register_type (ti);
  octave_lazy_index::register_type (ti);
  octave_oncleanup::register_type (ti);
  octave_java::register_type (ti);
}


If you look at ov-typeinfo.h you find that there is no destructor.


    ~type_info (void) = default;


So, I think what has to happen is that a destructor gets written to call
delete for each of the types. 


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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