← Back to team overview

enterprise-support team mailing list archive

[Bug 1582761] [NEW] memory leak in mysqlbinlog

 

Public bug reported:

This is a copy of https://bugs.mysql.com/bug.php?id=78223:

rpl.rpl_row_mysqlbinlog 'row'            [ fail ]
...
=================================================================
==3018==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 88 byte(s) in 1 object(s) allocated from:
    #0 0x7f573942c54a in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x9854a)
    #1 0x4b63a8 in my_malloc /home/laurynas/mysql-server/mysys/my_malloc.c:38
    #2 0x426229 in Log_event::operator new(unsigned long) /home/laurynas/mysql-server/sql/log_event.h:1071
    #3 0x426229 in Log_event::read_log_event(char const*, unsigned int, char const**, Format_description_log_event const*) /home/laurynas/mysql-server/sql/log_event.cc:1300
    #4 0x42d855 in dump_remote_log_entries /home/laurynas/mysql-server/client/mysqlbinlog.cc:1844
    #5 0x42d855 in dump_log_entries /home/laurynas/mysql-server/client/mysqlbinlog.cc:1685
    #6 0x42e8aa in main /home/laurynas/mysql-server/client/mysqlbinlog.cc:2354
    #7 0x7f573853f82f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)

Indirect leak of 18 byte(s) in 1 object(s) allocated from:
    #0 0x7f573942c54a in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x9854a)
    #1 0x4b63a8 in my_malloc /home/laurynas/mysql-server/mysys/my_malloc.c:38
    #2 0x4b6aa8 in my_strndup /home/laurynas/mysql-server/mysys/my_malloc.c:161
    #3 0x41dd7e in Rotate_log_event::Rotate_log_event(char const*, unsigned int, Format_description_log_event const*) /home/laurynas/mysql-server/sql/log_event.cc:5299
    #4 0x426240 in Log_event::read_log_event(char const*, unsigned int, char const**, Format_description_log_event const*) /home/laurynas/mysql-server/sql/log_event.cc:1300
    #5 0x42d855 in dump_remote_log_entries /home/laurynas/mysql-server/client/mysqlbinlog.cc:1844
    #6 0x42d855 in dump_log_entries /home/laurynas/mysql-server/client/mysqlbinlog.cc:1685
    #7 0x42e8aa in main /home/laurynas/mysql-server/client/mysqlbinlog.cc:2354
    #8 0x7f573853f82f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)

Fixed in 5.7 by

commit 6772eb52d666bfc11b52b1c99e27bd7d96874f01
Author: Andrei Elkin <andrei.elkin@xxxxxxxxxx>
Date:   Fri Dec 11 17:14:06 2015 +0200

    Bug#21697461 MEMORY LEAK IN MYSQLBINLOG
    
    **Problem description**
    
    At running mtr with a recently introduced --valgrind-clients
    instances of not deallocated memory were revealed along the following
    execution path:
    
    Rotate_log_event::Rotate_log_event() -> ...
        inary_log::Rotate_event::Rotate_event() ->
           bapi_strndup() -> ... my_raw_malloc
    
    The reason is turned down to be missed 'delete' for fake
    (as defined by ev->when == 0) Rotate event
    in case binlog is read from a running server (remote dumping).
    
    **Fixed**
    
    with calling the delete operator in proper places where
    the fake Rotate event becomes out of interest at once after its reading,
    that is its handling skips process_event().
    
    That's done with care to clear the event's temp_buf.

** Affects: mysql-server
     Importance: Unknown
         Status: Unknown

** Affects: percona-server
     Importance: Undecided
         Status: Invalid

** Affects: percona-server/5.5
     Importance: Low
     Assignee: Laurynas Biveinis (laurynas-biveinis)
         Status: In Progress

** Affects: percona-server/5.6
     Importance: Low
     Assignee: Laurynas Biveinis (laurynas-biveinis)
         Status: Triaged

** Affects: percona-server/5.7
     Importance: Undecided
         Status: Invalid


** Tags: asan ci upstream

** Also affects: percona-server/5.5
   Importance: Undecided
       Status: New

** Also affects: percona-server/5.6
   Importance: Undecided
       Status: New

** Also affects: percona-server/5.7
   Importance: Undecided
       Status: New

** Changed in: percona-server/5.5
       Status: New => In Progress

** Changed in: percona-server/5.5
   Importance: Undecided => Low

** Changed in: percona-server/5.6
       Status: New => Triaged

** Changed in: percona-server/5.6
   Importance: Undecided => Low

** Changed in: percona-server/5.7
       Status: New => Invalid

** Changed in: percona-server/5.5
     Assignee: (unassigned) => Laurynas Biveinis (laurynas-biveinis)

** Changed in: percona-server/5.6
     Assignee: (unassigned) => Laurynas Biveinis (laurynas-biveinis)

** Tags added: asan ci upstream

** Bug watch added: MySQL Bug System #78223
   http://bugs.mysql.com/bug.php?id=78223

** Also affects: mysql-server via
   http://bugs.mysql.com/bug.php?id=78223
   Importance: Unknown
       Status: Unknown

-- 
You received this bug notification because you are a member of Ubuntu
Server/Client Support Team, which is subscribed to MySQL.
Matching subscriptions: Ubuntu Server/Client Support Team
https://bugs.launchpad.net/bugs/1582761

Title:
  memory leak in mysqlbinlog

To manage notifications about this bug go to:
https://bugs.launchpad.net/mysql-server/+bug/1582761/+subscriptions


Follow ups