mysqlbinlog does not free the existing connection before opening new remote one
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
MySQL Server |
Unknown
|
Unknown
|
||||
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.5 |
Fix Released
|
Medium
|
Laurynas Biveinis | |||
5.6 |
Fix Released
|
Medium
|
Laurynas Biveinis | |||
5.7 |
Fix Released
|
Medium
|
Laurynas Biveinis |
Bug Description
Copy of http://
[1 Jun 11:26] Laurynas Biveinis
Description:
"mysqlbinlog --read-
How to repeat:
On 5.7, with LeakSanitizer-
cmake ... -DWITH_ASAN=ON ...
...
$ ./mtr --debug-server binlog_
...
binlog.
Test ended at 2016-06-01 14:17:00
CURRENT_TEST: binlog.
=======
==5002==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 1336 byte(s) in 1 object(s) allocated from:
#0 0x7fd39899e6e9 in __interceptor_
#1 0x4e939f in my_raw_malloc /home/laurynas/
#2 0x4e939f in my_malloc /home/laurynas/
#3 0x46a62e in mysql_init /home/laurynas/
#4 0x448569 in safe_connect /home/laurynas/
#5 0x448569 in dump_remote_
#6 0x448569 in dump_single_log /home/laurynas/
#7 0x448569 in dump_multiple_logs /home/laurynas/
#8 0x44a6de in main /home/laurynas/
#9 0x7fd39789b82f in __libc_start_main (/lib/x86_
(...other connection and SSL-related leaks)
Suggested fix:
At the start of safe_connect(), if mysql != NULL, call mysql_close for it, before mysql_init
[1 Jun 11:35] Laurynas Biveinis
The same issue exists on 5.5 and 5.6, but there it's masked by other LSan/client Valgrind bugs: bug 80014, bug 81674, bug 78223
tags: | added: asan ci upstream |
https:/ /github. com/percona/ percona- server/ pull/566, https:/ /github. com/percona/ percona- server/ pull/567, https:/ /github. com/percona/ percona- server/ pull/568