Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.11.4, 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.11, 11.0(EOL), 11.1(EOL), 11.2(EOL)
-
None
Description
--source include/have_log_bin.inc
|
RESET MASTER;
|
--error ER_WRONG_VALUE_FOR_VAR
|
SET
|
@@global.gtid_binlog_state='1-1-101,2-1-2002', |
@@global.slave_parallel_mode=x; |
SELECT @@global.gtid_binlog_state; |
***Warnings generated in error logs during shutdown after running tests: main.AAA
|
|
Warning: Memory not freed: 224
|
Warning: 40 bytes lost at 0x45fa260, allocated by T@0 at sql/sys_vars.cc:2120, sql/set_var.cc:246, sql/set_var.cc:810, sql/set_var.cc:738, sql/sql_parse.cc:5040, sql/sql_parse.cc:8023, sql/sql_parse.cc:1896, sql/sql_parse.cc:1407
|
Warning: 184 bytes lost at 0x7f71481b7790, allocated by T@0 at mysys/my_malloc.c:143, sql/rpl_gtid.cc:1359, sql/sys_vars.cc:2114, sql/set_var.cc:246, sql/set_var.cc:810, sql/set_var.cc:738, sql/sql_parse.cc:5040, sql/sql_parse.cc:8023
|
Warning: 152 bytes lost at 0x409c760, allocated by T@0 at mysys/array.c:73, mysys/hash.c:99, sql/sql_hset.h:37, sql/debug_sync.cc:90, sql/debug_sync.cc:166, sql/debug_sync.cc:1808, ??:0, csu/libc-start.c:268
|
Warning: 40 bytes lost at 0x45fa260, allocated by T@0 at sql/sys_vars.cc:2120, sql/set_var.cc:246, sql/set_var.cc:810, sql/set_var.cc:738, sql/sql_parse.cc:5040, sql/sql_parse.cc:8023, sql/sql_parse.cc:1896, sql/sql_parse.cc:1407
|
Warning: 184 bytes lost at 0x7f71481b7790, allocated by T@0 at mysys/my_malloc.c:143, sql/rpl_gtid.cc:1359, sql/sys_vars.cc:2114, sql/set_var.cc:246, sql/set_var.cc:810, sql/set_var.cc:738, sql/sql_parse.cc:5040, sql/sql_parse.cc:8023
|
The leaked memory is allocated in Sys_var_gtid_binlog_state::do_check() in this code:
if (!(data= (gtid_binlog_state_data *)my_malloc(PSI_INSTRUMENT_ME,
|
sizeof(*data), MYF(0))))
|
{
|
|
The problem happens because:
- The @@global.gtid_binlog_state='1-1-101,2-1-2002' part of the statement allocated memory and assigns it to var->save_result.ptr
- The @@global.slave_parallel_mode=x part fails on an error (wrong value)
- The entire statement fails
- The allocated value in var->save_result.ptr is never freed during the statement cleanup
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Description |
{code:sql}
--source include/have_log_bin.inc RESET MASTER; --error ER_WRONG_VALUE_FOR_VAR SET @@global.gtid_binlog_state='1-1-101,2-1-2002', @@global.slave_parallel_mode=x; SELECT @@global.gtid_binlog_state; {code} {noformat} ***Warnings generated in error logs during shutdown after running tests: main.AAA Warning: Memory not freed: 224 Warning: 40 bytes lost at 0x45fa260, allocated by T@0 at sql/sys_vars.cc:2120, sql/set_var.cc:246, sql/set_var.cc:810, sql/set_var.cc:738, sql/sql_parse.cc:5040, sql/sql_parse.cc:8023, sql/sql_parse.cc:1896, sql/sql_parse.cc:1407 Warning: 184 bytes lost at 0x7f71481b7790, allocated by T@0 at mysys/my_malloc.c:143, sql/rpl_gtid.cc:1359, sql/sys_vars.cc:2114, sql/set_var.cc:246, sql/set_var.cc:810, sql/set_var.cc:738, sql/sql_parse.cc:5040, sql/sql_parse.cc:8023 Warning: 152 bytes lost at 0x409c760, allocated by T@0 at mysys/array.c:73, mysys/hash.c:99, sql/sql_hset.h:37, sql/debug_sync.cc:90, sql/debug_sync.cc:166, sql/debug_sync.cc:1808, ??:0, csu/libc-start.c:268 Warning: 40 bytes lost at 0x45fa260, allocated by T@0 at sql/sys_vars.cc:2120, sql/set_var.cc:246, sql/set_var.cc:810, sql/set_var.cc:738, sql/sql_parse.cc:5040, sql/sql_parse.cc:8023, sql/sql_parse.cc:1896, sql/sql_parse.cc:1407 Warning: 184 bytes lost at 0x7f71481b7790, allocated by T@0 at mysys/my_malloc.c:143, sql/rpl_gtid.cc:1359, sql/sys_vars.cc:2114, sql/set_var.cc:246, sql/set_var.cc:810, sql/set_var.cc:738, sql/sql_parse.cc:5040, sql/sql_parse.cc:8023 {noformat} The leaked memory is allocated in Sys_var_gtid_binlog_state::do_check() in this code: {code:spp} if (!(data= (gtid_binlog_state_data *)my_malloc(PSI_INSTRUMENT_ME, sizeof(*data), MYF(0)))) { {code} |
{code:sql}
--source include/have_log_bin.inc RESET MASTER; --error ER_WRONG_VALUE_FOR_VAR SET @@global.gtid_binlog_state='1-1-101,2-1-2002', @@global.slave_parallel_mode=x; SELECT @@global.gtid_binlog_state; {code} {noformat} ***Warnings generated in error logs during shutdown after running tests: main.AAA Warning: Memory not freed: 224 Warning: 40 bytes lost at 0x45fa260, allocated by T@0 at sql/sys_vars.cc:2120, sql/set_var.cc:246, sql/set_var.cc:810, sql/set_var.cc:738, sql/sql_parse.cc:5040, sql/sql_parse.cc:8023, sql/sql_parse.cc:1896, sql/sql_parse.cc:1407 Warning: 184 bytes lost at 0x7f71481b7790, allocated by T@0 at mysys/my_malloc.c:143, sql/rpl_gtid.cc:1359, sql/sys_vars.cc:2114, sql/set_var.cc:246, sql/set_var.cc:810, sql/set_var.cc:738, sql/sql_parse.cc:5040, sql/sql_parse.cc:8023 Warning: 152 bytes lost at 0x409c760, allocated by T@0 at mysys/array.c:73, mysys/hash.c:99, sql/sql_hset.h:37, sql/debug_sync.cc:90, sql/debug_sync.cc:166, sql/debug_sync.cc:1808, ??:0, csu/libc-start.c:268 Warning: 40 bytes lost at 0x45fa260, allocated by T@0 at sql/sys_vars.cc:2120, sql/set_var.cc:246, sql/set_var.cc:810, sql/set_var.cc:738, sql/sql_parse.cc:5040, sql/sql_parse.cc:8023, sql/sql_parse.cc:1896, sql/sql_parse.cc:1407 Warning: 184 bytes lost at 0x7f71481b7790, allocated by T@0 at mysys/my_malloc.c:143, sql/rpl_gtid.cc:1359, sql/sys_vars.cc:2114, sql/set_var.cc:246, sql/set_var.cc:810, sql/set_var.cc:738, sql/sql_parse.cc:5040, sql/sql_parse.cc:8023 {noformat} The leaked memory is allocated in Sys_var_gtid_binlog_state::do_check() in this code: {code:spp} if (!(data= (gtid_binlog_state_data *)my_malloc(PSI_INSTRUMENT_ME, sizeof(*data), MYF(0)))) { {code} The problem happens because: - The {{@@global.gtid_binlog_state='1-1-101,2-1-2002'}} part of the statement allocated memory and assigns it to var->save_result.ptr - The {{@@global.slave_parallel_mode=x}} part fails on an error (wrong value) - The entire statement fails - The allocated value in var->save_result.ptr is never freed during the statement cleanup |
Affects Version/s | 10.11.4 [ 28918 ] | |
Affects Version/s | 10.4 [ 22408 ] | |
Affects Version/s | 10.5 [ 23123 ] | |
Affects Version/s | 10.6 [ 24028 ] | |
Affects Version/s | 10.7 [ 24805 ] | |
Affects Version/s | 10.8 [ 26121 ] | |
Affects Version/s | 10.9 [ 26905 ] | |
Affects Version/s | 11.0 [ 28320 ] | |
Affects Version/s | 11.1 [ 28549 ] | |
Affects Version/s | 11.2 [ 28603 ] |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Fix Version/s | 10.7 [ 24805 ] | |
Fix Version/s | 10.9 [ 26905 ] | |
Fix Version/s | 11.0 [ 28320 ] | |
Fix Version/s | 11.1 [ 28549 ] | |
Fix Version/s | 11.2 [ 28603 ] |
Priority | Major [ 3 ] | Critical [ 2 ] |
Link |
This issue blocks |
Assignee | Alexander Barkov [ bar ] |
Link |
This issue blocks |
Assignee | Alexander Barkov [ bar ] | Andrei Elkin [ elkin ] |
Fix Version/s | 10.7 [ 24805 ] |
Fix Version/s | 10.9 [ 26905 ] |
Assignee | Andrei Elkin [ elkin ] | Brandon Nesterenko [ JIRAUSER48702 ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Fix Version/s | 11.0 [ 28320 ] |
Status | In Progress [ 3 ] | Stalled [ 10000 ] |
Assignee | Brandon Nesterenko [ JIRAUSER48702 ] | Dave Gosselin [ JIRAUSER52216 ] |
Fix Version/s | 10.4 [ 22408 ] |
Fix Version/s | 11.1 [ 28549 ] |
Status | Stalled [ 10000 ] | In Progress [ 3 ] |
Assignee | Dave Gosselin [ JIRAUSER52216 ] | Andrei Elkin [ elkin ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Assignee | Andrei Elkin [ elkin ] | Dave Gosselin [ JIRAUSER52216 ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Status | Stalled [ 10000 ] | In Progress [ 3 ] |
Assignee | Dave Gosselin [ JIRAUSER52216 ] | Andrei Elkin [ elkin ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Fix Version/s | 10.5.27 [ 29902 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Fix Version/s | 10.11 [ 27614 ] | |
Fix Version/s | 11.2 [ 28603 ] | |
Resolution | Fixed [ 1 ] | |
Status | In Review [ 10002 ] | Closed [ 6 ] |
Fix Version/s | 10.6.20 [ 29903 ] | |
Fix Version/s | 10.11.10 [ 29904 ] | |
Fix Version/s | 11.2.6 [ 29906 ] | |
Fix Version/s | 11.4.4 [ 29907 ] |
For the new system variable @@character_set_collations we'll need to allocate a temporary value to pass it between do_check() and session_update()/global_update(), similar to how it is done in @@gtid_binlog_state. So @@gtid_binlog_state should be fixed first.