Bug #78224 memory leak in mysqlpump

Submitted: 26 Aug 2015 13:03 Modified: 1 Jul 2016 10:45
Reporter: Tor Didriksen Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: mysqlpump Command-line Client Severity:S2 (Serious)
Version:5.7.9 OS:Any
Assigned to: CPU Architecture:Any

[26 Aug 2015 13:03] Tor Didriksen
Description:
The patch for
    Bug#21672747 ADD MTR OPTION TO RUN ALL CLIENT APPLICATIONS WITH VALGRIND
introduced a new --valgrind-clients option for mtr.
It shows huge memory leaks in mysqlpump.

==19877== 1,138,656 (4,368 direct, 1,134,288 indirect) bytes in 91 blocks are definitely lost in loss record 328 of 328
==19877==    at 0x4C27965: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==19877==    by 0x44814B: Mysql::Tools::Dump::Abstract_chain_element::task_to_be_processed_in_child(Mysql::Tools::Dump::Item_processing_data*, Mysql::Tools::Dump::I_chain_element*, Mysql::Tools::Dump::I_dump_task*, Mysql::Instance_callback<void, Mysql::Tools::Dump::Item_processing_data*, Mysql::Tools::Dump::Abstract_chain_element>*) (abstract_chain_element.cc:164)
==19877==    by 0x447D6C: Mysql::Tools::Dump::Abstract_chain_element::object_to_be_processed_in_child(Mysql::Tools::Dump::Item_processing_data*, Mysql::Tools::Dump::I_chain_element*) (abstract_chain_element.cc:58)
==19877==    by 0x45AA34: Mysql::Tools::Dump::Abstract_data_formatter_wrapper::format_object(Mysql::Tools::Dump::Item_processing_data*) (abstract_data_formatter_wrapper.cc:29)
==19877==    by 0x4575FA: Mysql::Tools::Dump::Mysql_object_reader::read_object(Mysql::Tools::Dump::Item_processing_data*) (mysql_object_reader.cc:110)
==19877==    by 0x44EF25: Mysql::Tools::Dump::Abstract_object_reader_wrapper::format_object(Mysql::Tools::Dump::Item_processing_data*) (abstract_object_reader_wrapper.cc:29)
==19877==    by 0x436025: Mysql::Tools::Dump::Object_queue::queue_thread() (object_queue.cc:70)
==19877==    by 0x43BD74: boost::_mfi::mf0<void, Mysql::Tools::Dump::Object_queue>::operator()(Mysql::Tools::Dump::Object_queue*) const (mem_fn_template.hpp:49)
==19877==    by 0x43B97D: void boost::_bi::list1<boost::_bi::value<Mysql::Tools::Dump::Object_queue*> >::operator()<boost::_mfi::mf0<void, Mysql::Tools::Dump::Object_queue>, boost::_bi::list0>(boost::_bi::type<void>, boost::_mfi::mf0<void, Mysql::Tools::Dump::Object_queue>&, boost::_bi::list0&, int) (bind.hpp:253)
==19877==    by 0x43B306: boost::_bi::bind_t<void, boost::_mfi::mf0<void, Mysql::Tools::Dump::Object_queue>, boost::_bi::list1<boost::_bi::value<Mysql::Tools::Dump::Object_queue*> > >::operator()() (bind_template.hpp:20)
==19877==    by 0x43A816: my_boost::thread::context<boost::_bi::bind_t<void, boost::_mfi::mf0<void, Mysql::Tools::Dump::Object_queue>, boost::_bi::list1<boost::_bi::value<Mysql::Tools::Dump::Object_queue*> > > >::entry_point(void*) (thread.h:55)
==19877==    by 0x4E38F32: start_thread (in /usr/lib64/libpthread-2.18.so)
==19877==    by 0x5D73DEC: clone (in /usr/lib64/libc-2.18.so)
==19877== 
mysqltest: At line 13: command "$MYSQL_PUMP --default-parallelism=1 --parallel-schemas=3:db1,db2 --parallel-schemas=5:db3,bd1_1gb --databases db1 db2 db3 db1_1gb > $MYSQLTEST_VARDIR/tmp/full_bkp.sql" failed

How to repeat:
In current trunk:
./mtr --mem --valgrind-clients main.mysqlpump --big-test
[26 Oct 2015 16:29] Erlend Dahl
Bug#78965 was marked as a duplicate.
[13 Nov 2015 9:48] Laurynas Biveinis
There is not only a memory leak, but other errors too, please see my comments on bug 78965.
[1 Jul 2016 10:45] Erlend Dahl
Fixed in the upcoming 5.7.13/8.0.0 releases.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.055 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.