Bug #70238 | Memory leak in embedded server when executing prepared statements | ||
---|---|---|---|
Submitted: | 4 Sep 2013 6:42 | Modified: | 6 Sep 2017 9:03 |
Reporter: | Guangpu Feng | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | MySQL Server: Prepared statements | Severity: | S2 (Serious) |
Version: | 5.6.11, 5.6.15 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | embedded, libmysqld, memory leak |
[4 Sep 2013 6:42]
Guangpu Feng
[4 Sep 2013 6:54]
Guangpu Feng
libmysqld_prepare_statement.c
Attachment: libmysqld_prepared_statement.c (application/octet-stream, text), 3.20 KiB.
[4 Sep 2013 6:55]
Guangpu Feng
contents of my_embedded.cnf: [client] socket = /u01/mysql5611/run/mysql.sock [embedded] sort_buffer_size=1M core-file #### Baes dir #### basedir = /u01/mysql5611 datadir = /u01/mysql5611/data_embedded tmpdir = /u01/mysql5611/tmp_embedded socket = /u01/mysql5611/run_embedded/mysql.sock #### Base configure info #### port = 5611 skip-name-resolve old_passwords = 0 lower_case_table_names = 1 open_files_limit = 65535 read_rnd_buffer_size = 5M max_allowed_packet = 24M max_connect_errors = 500 max_connections = 5 max_user_connections = 4 thread_cache_size=2 table_open_cache=16 table_definition_cache=8 server-id= 5611 #innodb innodb_data_home_dir = /u01/mysql5611/data_embedded default-storage-engine = INNODB innodb_flush_method = O_DIRECT innodb_file_per_table = 1 innodb_flush_log_at_trx_commit = 1 innodb_lock_wait_timeout = 100 innodb_additional_mem_pool_size = 4M innodb_buffer_pool_size = 64M innodb_log_buffer_size= 8M innodb_log_file_size = 16M innodb_log_files_in_group = 4 innodb_max_dirty_pages_pct = 75 thread_stack = 1524288 [mysqld_safe] pid-file = /u01/mysql5611/run_embedded/mysqld.pid
[4 Sep 2013 8:25]
Guangpu Feng
in mysql_stmt_init ... init_alloc_root(&stmt->mem_root, 2048, 2048); // line 1512 init_alloc_root(&stmt->result.alloc, 4096, 4096);// line 1513 ... ==29639== 2,064 bytes in 1 blocks are definitely lost in loss record 3 of 4 ==29639== at 0x4A05FDE: malloc (vg_replace_malloc.c:236) ==29639== by 0x4635E1: my_malloc (my_malloc.c:38) ==29639== by 0x462C72: init_alloc_root (my_alloc.c:63) ==29639== by 0x448935: mysql_stmt_init (libmysql.c:1512) ==29639== by 0x444277: main (in /u01/mysql5611/bug62136) 2064 bytes come from: 2048 + sizeof(USED_MEM) ==29639== 4,112 bytes in 1 blocks are definitely lost in loss record 4 of 4 ==29639== at 0x4A05FDE: malloc (vg_replace_malloc.c:236) ==29639== by 0x4635E1: my_malloc (my_malloc.c:38) ==29639== by 0x462C72: init_alloc_root (my_alloc.c:63) ==29639== by 0x44894B: mysql_stmt_init (libmysql.c:1513) ==29639== by 0x444277: main (in /u01/mysql5611/bug62136) 4112 bytes come from: 4096 + sizeof(USED_MEM)
[8 Jan 2014 10:05]
MySQL Verification Team
Hello Guangpu, Thank you for the bug report and test case. Thanks, Umesh
[6 Sep 2017 9:03]
Manyi Lu
Posted by developer: Embedded mode has already been removed starting from 8.0.