Bug #12381 row-based replication leaks memory in rpl_row_loaddata
Submitted: 4 Aug 2005 13:26 Modified: 5 Aug 2005 14:31
Reporter: Guilhem Bichot Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.0 OS:Linux (linux)
Assigned to: CPU Architecture:Any

[4 Aug 2005 13:26] Guilhem Bichot
Description:
in our mysql-5.0-wl1012 tree, run
./mysql-test-run --valgrind t/rpl_row_loaddata.test
(Xeon EM64T, BUILD/compile-pentium64-valgrind-max):
==6635== 4096 bytes in 1 blocks are definitely lost in loss record 7 of 7
==6635==    at 0x11B1FE96: malloc (vg_replace_malloc.c:149)
==6635==    by 0x9C2951: operator new[](unsigned long) (my_new.cc:33)
==6635==    by 0x6BB69B: table_mapping::expand() (rpl_tblmap.cc:65)
==6635==    by 0x6BB7ED: table_mapping::set_table(unsigned long, st_table*) (rpl_tblmap.cc:89)
==6635==    by 0x67AB07: Table_map_log_event::exec_event(st_relay_log_info*) (log_event.cc:5455)
==6635==    by 0x733614: exec_relay_log_event(THD*, st_relay_log_info*) (slave.cc:2959)
==6635==    by 0x733EB9: handle_slave_sql (slave.cc:3507)
==6635==    by 0x122DB97B: start_thread (in /lib64/libpthread-2.3.5.so)
==6635==    by 0x12884C2D: clone (in /lib64/libc-2.3.5.so)

How to repeat:
see above
[5 Aug 2005 12:44] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/27917
[5 Aug 2005 14:24] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/27921
[5 Aug 2005 14:31] Guilhem Bichot
Fixed in
ChangeSet@1.1904, 2005-08-05 16:24:09+02:00, guilhem@mysql.com
  Fix for BUG#12381 "row-based replication leaks memory in rpl_row_loaddata":
  I replace m_chunks with a MEM_ROOT in table_mapping (achieves the same functionality),
  and add a free_root() which closes the leak. Added comments.
in our internal mysql-5.0-wl1012 (nothing to document).