Possible memory leaks
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MySQL patches by Codership |
New
|
Undecided
|
Unassigned | ||
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Excerpt from what I noticed during a valgrind run: (valgrind --tool=memcheck --leak-check=full --show-
a)
==00:00:04:49.304 43673== 5 bytes in 1 blocks are definitely lost in loss record 2 of 18
==00:00:04:49.304 43673== at 0x4C2C04B: malloc (in /usr/lib/
==00:00:04:49.304 43673== by 0x8087AC: my_malloc (my_malloc.c:38)
==00:00:04:49.304 43673== by 0x808B3F: my_strdup (my_malloc.c:152)
==00:00:04:49.304 43673== by 0x685787: wsrep_init_vars() (wsrep_var.cc:48)
==00:00:04:49.304 43673== by 0x51E92D: mysqld_main(int, char**) (mysqld.cc:7927)
==00:00:04:49.304 43673== by 0x514628: main (main.cc:25)
--- the variables allotted in wsrep_init_vars are not freed.
b)
==00:00:04:49.304 43673== 7 bytes in 1 blocks are definitely lost in loss record 3 of 18
==00:00:04:49.304 43673== at 0x4C2C04B: malloc (in /usr/lib/
==00:00:04:49.304 43673== by 0x8087AC: my_malloc (my_malloc.c:38)
==00:00:04:49.304 43673== by 0x808B3F: my_strdup (my_malloc.c:152)
==00:00:04:49.304 43673== by 0x51EA9E: mysqld_main(int, char**) (mysqld.cc:3294)
==00:00:04:49.304 43673== by 0x514628: main (main.cc:25)
--- Again similar with wsrep_node_address
(Note a and b may be fine since variables are alive till the end)
c)
==00:00:04:49.304 43673== at 0x4C2C04B: malloc (in /usr/lib/
==00:00:04:49.304 43673== by 0x659A969: strdup (in /usr/lib/
==00:00:04:49.304 43673== by 0x680A7D: sst_auth_
==00:00:04:49.304 43673== by 0x6824C4: wsrep_sst_
==00:00:04:49.304 43673== by 0x516D1A: mysqld_
==00:00:04:49.304 43673== by 0x807035: handle_options (my_getopt.c:738)
==00:00:04:49.304 43673== by 0x51EBD5: mysqld_main(int, char**) (mysqld.cc:8302)
==00:00:04:49.304 43673== by 0x514628: main (main.cc:25)
---- Lot of strdups, may need to be checked.
d)
==00:00:04:49.304 43673== at 0x4C2C04B: malloc (in /usr/lib/
==00:00:04:49.304 43673== by 0x400ABC3: _dl_new_object (in /usr/lib/
==00:00:04:49.304 43673== by 0x4006443: _dl_map_
==00:00:04:49.304 43673== by 0x4008224: _dl_map_object (in /usr/lib/
==00:00:04:49.304 43673== by 0x400C3E1: openaux (in /usr/lib/
==00:00:04:49.304 43673== by 0x400E913: _dl_catch_error (in /usr/lib/
==00:00:04:49.304 43673== by 0x400C644: _dl_map_object_deps (in /usr/lib/
==00:00:04:49.304 43673== by 0x4012A12: dl_open_worker (in /usr/lib/
==00:00:04:49.304 43673== by 0x400E913: _dl_catch_error (in /usr/lib/
==00:00:04:49.304 43673== by 0x401244A: _dl_open (in /usr/lib/
==00:00:04:49.304 43673== by 0x569E02A: ??? (in /usr/lib/
==00:00:04:49.304 43673== by 0x400E913: _dl_catch_error (in /usr/lib/
---- a false positive IMO, will need to be added to suppressions.
e)
==00:00:04:49.308 43673== at 0x4C29E84: calloc (in /usr/lib/
==00:00:04:49.308 43673== by 0x569E63F: ??? (in /usr/lib/
==00:00:04:49.308 43673== by 0x569E0C0: dlopen (in /usr/lib/
==00:00:04:49.308 43673== by 0xAA99A1: wsrep_load (wsrep_
==00:00:04:49.308 43673== by 0x67D87D: wsrep_init() (wsrep_
==00:00:04:49.308 43673== by 0x67E90B: wsrep_init_
==00:00:04:49.308 43673== by 0x51AC3E: init_server_
==00:00:04:49.308 43673== by 0x520180: mysqld_main(int, char**) (mysqld.cc:5369)
==00:00:04:49.308 43673== by 0x514628: main (main.cc:25)
---- a false positive again, will need to be added to suppressions.
f)
==00:00:04:49.308 43673== at 0x4C2C04B: malloc (in /usr/lib/
==00:00:04:49.308 43673== by 0x5B72C5F: CRYPTO_malloc (in /usr/lib/
==00:00:04:49.308 43673== by 0x5C1A35E: sk_new (in /usr/lib/
==00:00:04:49.308 43673== by 0x58EA509: load_builtin_
==00:00:04:49.308 43673== by 0x58ECA58: SSL_COMP_
==00:00:04:49.308 43673== by 0x58F2845: SSL_library_init (in /usr/lib/
==00:00:04:49.308 43673== by 0x79FD8ED: asio::ssl:
==00:00:04:49.308 43673== by 0x79576EB: _GLOBAL_
==00:00:04:49.308 43673== by 0x400EA99: call_init (in /usr/lib/
==00:00:04:49.308 43673== by 0x400EB6B: _dl_init (in /usr/lib/
==00:00:04:49.308 43673== by 0x4012BD4: dl_open_worker (in /usr/lib/
==00:00:04:49.308 43673== by 0x400E913: _dl_catch_error (in /usr/lib/
I saw following in openssl_init.hpp:
~do_init()
{
if (Do_Init)
{
}
}
but it still shows the leak, may be a false positive or Do_Init is not true there?
This is handled elswhere.