Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
N/A
-
None
Description
CREATE TABLE t1 (i int) ; |
INSERT INTO t1 VALUES (1),(2),(3); |
|
--connect (con1,localhost,root,,test)
|
--let $conid= `SELECT CONNECTION_ID()`
|
|
--let $run=100
|
while ($run)
|
{
|
send
|
SELECT i FROM (SELECT DISTINCT * FROM t1) a1 GROUP BY i ; |
|
--connection default |
--let $show=100 |
while ($show)
|
{
|
--error 0,ER_TARGET_NOT_EXPLAINABLE |
eval SHOW EXPLAIN FORMAT=JSON FOR $conid; |
--dec $show |
}
|
--connection con1 |
--reap |
--dec $run |
}
|
|
# Cleanup
|
--disconnect con1 |
preview-10.9-MDEV-27021-explain afa835568a1623991799830175039816b9ac2681 |
Version: '10.9.0-MariaDB-debug-log'
|
220330 17:04:13 [ERROR] mysqld got signal 11 ;
|
|
Server version: 10.9.0-MariaDB-debug-log
|
|
sigaction.c:0(__restore_rt)[0x7f5d1927a3c0]
|
sql/item.cc:7821(Item_field::print(String*, enum_query_type))[0x563a4b0fe850]
|
sql/sql_explain.cc:1557(append_item_to_str(String*, Item*))[0x563a4af221d0]
|
sql/sql_explain.cc:1070(Explain_aggr_filesort::print_json_members(Json_writer*, bool))[0x563a4af2032a]
|
sql/sql_explain.cc:1002(Explain_select::print_explain_json(Explain_query*, Json_writer*, bool))[0x563a4af1ffa5]
|
sql/sql_explain.cc:251(Explain_query::print_explain_json(select_result_sink*, bool, unsigned long long))[0x563a4af1d203]
|
sql/sql_lex.cc:5856(LEX::print_explain(select_result_sink*, unsigned char, bool, bool, bool*))[0x563a4acce9a4]
|
sql/sql_show.cc:3005(Show_explain_request::call_in_target_thread())[0x563a4adcee84]
|
sql/my_apc.cc:226(Apc_target::process_apc_requests())[0x563a4af5bd94]
|
sql/my_apc.h:74(Apc_target::disable())[0x563a4af26ad3]
|
sql/sql_explain.cc:168(Explain_query::notify_item_objects_about_to_be_freed())[0x563a4af1cdea]
|
sql/sql_class.cc:2257(THD::cleanup_after_query())[0x563a4ac7a7a8]
|
sql/sql_parse.cc:8058(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x563a4ad10470]
|
sql/sql_parse.cc:1897(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x563a4acfc6ff]
|
sql/sql_parse.cc:1403(do_command(THD*, bool))[0x563a4acfb09b]
|
sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x563a4aed4221]
|
sql/sql_connect.cc:1314(handle_one_connection)[0x563a4aed3eb1]
|
perfschema/pfs.cc:2203(pfs_spawn_thread)[0x563a4b423e4b]
|
nptl/pthread_create.c:478(start_thread)[0x7f5d1926e609]
|
??:0(clone)[0x7f5d18e3f163]
|
|
Query (0x7f5ce4015420): SHOW EXPLAIN FORMAT=JSON FOR 5
|
CREATE TABLE t1 (i int) ; |
INSERT INTO t1 VALUES (1),(2),(3); |
|
--connect (con1,localhost,root,,test)
|
--let $conid= `SELECT CONNECTION_ID()`
|
|
--let $run=100
|
while ($run)
|
{
|
send
|
SELECT i FROM (SELECT DISTINCT * FROM t1) a1 WHERE i IN ('v'); |
|
--connection default |
--let $show=100 |
while ($show)
|
{
|
--error 0,ER_TARGET_NOT_EXPLAINABLE |
eval SHOW EXPLAIN FORMAT=JSON FOR $conid; |
--dec $show |
}
|
--connection con1 |
--reap |
--dec $run |
}
|
|
# Cleanup
|
--disconnect con1 |
preview-10.9-MDEV-27021-explain afa835568a1623991799830175039816b9ac2681 |
220330 17:21:40 [ERROR] mysqld got signal 11 ;
|
|
Server version: 10.9.0-MariaDB-debug-log
|
|
sigaction.c:0(__restore_rt)[0x7f20410413c0]
|
sql/item.cc:7821(Item_field::print(String*, enum_query_type))[0x55da53a1f850]
|
sql/item.cc:497(Item::print_parenthesised(String*, enum_query_type, precedence))[0x55da53a07b9b]
|
sql/item_func.cc:631(Item_func::print_op(String*, enum_query_type))[0x55da53a7361e]
|
sql/item_cmpfunc.h:551(Item_bool_rowready_func2::print(String*, enum_query_type))[0x55da534d2df9]
|
sql/sql_explain.cc:1546(write_item(Json_writer*, Item*))[0x55da538430d4]
|
sql/sql_explain.cc:1605(Explain_table_access::tag_to_json(Json_writer*, explain_extra_tag))[0x55da538433d0]
|
sql/sql_explain.cc:1881(Explain_table_access::print_explain_json(Explain_query*, Json_writer*, bool))[0x55da538442c0]
|
sql/sql_explain.cc:1127(Explain_basic_join::print_explain_json_interns(Explain_query*, Json_writer*, bool))[0x55da538416b7]
|
sql/sql_explain.cc:1022(Explain_select::print_explain_json(Explain_query*, Json_writer*, bool))[0x55da53841068]
|
sql/sql_explain.cc:251(Explain_query::print_explain_json(select_result_sink*, bool, unsigned long long))[0x55da5383e203]
|
sql/sql_lex.cc:5856(LEX::print_explain(select_result_sink*, unsigned char, bool, bool, bool*))[0x55da535ef9a4]
|
sql/sql_show.cc:3005(Show_explain_request::call_in_target_thread())[0x55da536efe84]
|
sql/my_apc.cc:226(Apc_target::process_apc_requests())[0x55da5387cd94]
|
sql/my_apc.h:74(Apc_target::disable())[0x55da53847ad3]
|
sql/sql_explain.cc:168(Explain_query::notify_item_objects_about_to_be_freed())[0x55da5383ddea]
|
sql/sql_class.cc:2257(THD::cleanup_after_query())[0x55da5359b7a8]
|
sql/sql_parse.cc:8058(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x55da53631470]
|
sql/sql_parse.cc:1897(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x55da5361d6ff]
|
sql/sql_parse.cc:1403(do_command(THD*, bool))[0x55da5361c09b]
|
sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x55da537f5221]
|
sql/sql_connect.cc:1314(handle_one_connection)[0x55da537f4eb1]
|
perfschema/pfs.cc:2203(pfs_spawn_thread)[0x55da53d44e4b]
|
nptl/pthread_create.c:478(start_thread)[0x7f2041035609]
|
??:0(clone)[0x7f2040c06163]
|
|
Query (0x7f200c015420): SHOW EXPLAIN FORMAT=JSON FOR 5
|
|
++variations:
mysqld: /10.9/sql/field.cc:7525: virtual String* Field_string::val_str(String*, String*): Assertion `!table || table->in_use == _current_thd()' failed.
|
220330 13:20:06 [ERROR] mysqld got signal 6 ;
|
|
Server version: 10.9.0-MariaDB-debug-log
|
|
linux/raise.c:51(__GI_raise)[0x7ff324cda7bb]
|
stdlib/abort.c:81(__GI_abort)[0x7ff324cc5535]
|
intl/loadmsgcat.c:1177(_nl_load_domain)[0x7ff324cc540f]
|
??:0(__assert_fail)[0x7ff324cd3102]
|
sql/field.cc:7527(Field_string::val_str(String*, String*))[0x556cb3f697dc]
|
sql/item.cc:3323(Item_field::val_str(String*))[0x556cb40314cc]
|
sql/item.cc:526(Item::print_value(String*))[0x556cb40194c3]
|
sql/item.cc:7825(Item_field::print(String*, enum_query_type))[0x556cb4054640]
|
sql/item.cc:8331(Item_ref::print(String*, enum_query_type))[0x556cb40588b2]
|
sql/item.cc:497(Item::print_parenthesised(String*, enum_query_type, precedence))[0x556cb4018fdd]
|
sql/item_func.cc:636(Item_func::print_op(String*, enum_query_type))[0x556cb410d163]
|
sql/item_cmpfunc.h:551(Item_bool_rowready_func2::print(String*, enum_query_type))[0x556cb3428dd1]
|
sql/item.cc:497(Item::print_parenthesised(String*, enum_query_type, precedence))[0x556cb4018fdd]
|
sql/item_cmpfunc.cc:5286(Item_cond::print(String*, enum_query_type))[0x556cb40b70bb]
|
sql/sql_explain.cc:1546(write_item(Json_writer*, Item*))[0x556cb3c52ba7]
|
sql/sql_explain.cc:974(Explain_select::print_explain_json(Explain_query*, Json_writer*, bool))[0x556cb3c4ee52]
|
sql/sql_explain.cc:737(Explain_node::print_explain_json_for_children(Explain_query*, Json_writer*, bool))[0x556cb3c4d599]
|
sql/sql_explain.cc:939(Explain_select::print_explain_json(Explain_query*, Json_writer*, bool))[0x556cb3c4eb0e]
|
sql/sql_explain.cc:251(Explain_query::print_explain_json(select_result_sink*, bool, unsigned long long))[0x556cb3c4a29d]
|
sql/sql_lex.cc:5856(LEX::print_explain(select_result_sink*, unsigned char, bool, bool, bool*))[0x556cb36b7d63]
|
sql/sql_show.cc:3005(Show_explain_request::call_in_target_thread())[0x556cb39234be]
|
sql/my_apc.cc:226(Apc_target::process_apc_requests())[0x556cb3ce133d]
|
sql/my_apc.h:74(Apc_target::disable())[0x556cb3c5ace7]
|
sql/sql_explain.cc:168(Explain_query::notify_item_objects_about_to_be_freed())[0x556cb3c49874]
|
sql/sql_class.cc:2257(THD::cleanup_after_query())[0x556cb35e9545]
|
sql/sql_parse.cc:8058(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x556cb3744177]
|
sql/sql_parse.cc:1897(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x556cb371a59c]
|
sql/sql_parse.cc:1403(do_command(THD*, bool))[0x556cb3717291]
|
sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x556cb3baa786]
|
sql/sql_connect.cc:1314(handle_one_connection)[0x556cb3baa00b]
|
perfschema/pfs.cc:2203(pfs_spawn_thread)[0x556cb482c03b]
|
nptl/pthread_create.c:487(start_thread)[0x7ff325192fa3]
|
x86_64/clone.S:97(clone)[0x7ff324d9beff]
|
|
Query (0x6290007994e8): SHOW ANALYZE FORMAT=JSON FOR 18
|
=================================================================
|
==69440==ERROR: AddressSanitizer: heap-use-after-free on address 0x61a000555318 at pc 0x55de8fc175da bp 0x7fadb04b5c80 sp 0x7fadb04b5c78
|
READ of size 8 at 0x61a000555318 thread T32
|
#0 0x55de8fc175d9 in Item_field::print(String*, enum_query_type) /10.9/sql/item.cc:7821
|
#1 0x55de8fd7fd65 in Item_func_conv_charset::print(String*, enum_query_type) /10.9/sql/item_strfunc.cc:3711
|
#2 0x55de8f815ba6 in write_item /10.9/sql/sql_explain.cc:1544
|
#3 0x55de8f816046 in Explain_table_access::tag_to_json(Json_writer*, explain_extra_tag) /10.9/sql/sql_explain.cc:1602
|
#4 0x55de8f8176ce in Explain_table_access::print_explain_json(Explain_query*, Json_writer*, bool) /10.9/sql/sql_explain.cc:1883
|
#5 0x55de8f812f13 in Explain_basic_join::print_explain_json_interns(Explain_query*, Json_writer*, bool) /10.9/sql/sql_explain.cc:1125
|
#6 0x55de8f8122ba in Explain_select::print_explain_json(Explain_query*, Json_writer*, bool) /10.9/sql/sql_explain.cc:1020
|
#7 0x55de8f80d29c in Explain_query::print_explain_json(select_result_sink*, bool, unsigned long long) /10.9/sql/sql_explain.cc:248
|
#8 0x55de8f27ad62 in LEX::print_explain(select_result_sink*, unsigned char, bool, bool, bool*) /10.9/sql/sql_lex.cc:5856
|
#9 0x55de8f4e64bd in Show_explain_request::call_in_target_thread() /10.9/sql/sql_show.cc:3003
|
#10 0x55de8f8a433c in Apc_target::process_apc_requests() /10.9/sql/my_apc.cc:225
|
#11 0x55de8f81dce6 in Apc_target::disable() /10.9/sql/my_apc.h:73
|
#12 0x55de8f80c873 in Explain_query::notify_item_objects_about_to_be_freed() /10.9/sql/sql_explain.cc:167
|
#13 0x55de8f1ac544 in THD::cleanup_after_query() /10.9/sql/sql_class.cc:2245
|
#14 0x55de8f307176 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /10.9/sql/sql_parse.cc:8058
|
#15 0x55de8f2dd59b in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /10.9/sql/sql_parse.cc:1895
|
#16 0x55de8f2da290 in do_command(THD*, bool) /10.9/sql/sql_parse.cc:1403
|
#17 0x55de8f76d785 in do_handle_one_connection(CONNECT*, bool) /10.9/sql/sql_connect.cc:1418
|
#18 0x55de8f76d00a in handle_one_connection /10.9/sql/sql_connect.cc:1312
|
#19 0x55de903ef03a in pfs_spawn_thread /10.9/storage/perfschema/pfs.cc:2201
|
#20 0x7fadde3f7fa2 in start_thread /build/glibc-fWwxX8/glibc-2.28/nptl/pthread_create.c:486
|
#21 0x7fadde000efe in clone (/lib/x86_64-linux-gnu/libc.so.6+0xf8efe)
|
|
0x61a000555318 is located 664 bytes inside of 1156-byte region [0x61a000555080,0x61a000555504)
|
freed by thread T31 here:
|
#0 0x7faddeb0afb0 in __interceptor_free (/lib/x86_64-linux-gnu/libasan.so.5+0xe8fb0)
|
#1 0x55de91008ec7 in free_memory /10.9/mysys/safemalloc.c:297
|
#2 0x55de91008376 in sf_free /10.9/mysys/safemalloc.c:203
|
#3 0x55de90fd7509 in my_free /10.9/mysys/my_malloc.c:211
|
#4 0x55de90fb21a0 in root_free /10.9/mysys/my_alloc.c:78
|
#5 0x55de90fb4902 in free_root /10.9/mysys/my_alloc.c:495
|
#6 0x55de8f69313b in closefrm(TABLE*) /10.9/sql/table.cc:4464
|
#7 0x55de8f9c9046 in intern_close_table /10.9/sql/table_cache.cc:220
|
#8 0x55de8f9d0fb0 in TDC_element::flush_unused(bool) /10.9/sql/table_cache.cc:1293
|
#9 0x55de8f9d0bf0 in TDC_element::flush(THD*, bool) /10.9/sql/table_cache.cc:1258
|
#10 0x55de8f13b935 in wait_while_table_is_used(THD*, TABLE*, ha_extra_function) /10.9/sql/sql_base.cc:1318
|
#11 0x55de8f5cb8b9 in simple_rename_or_index_change /10.9/sql/sql_table.cc:9395
|
#12 0x55de8f5d1c7c in mysql_alter_table(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool, bool) /10.9/sql/sql_table.cc:10298
|
#13 0x55de8f78aad2 in Sql_cmd_alter_table::execute(THD*) /10.9/sql/sql_alter.cc:547
|
#14 0x55de8f2f9b0d in mysql_execute_command(THD*, bool) /10.9/sql/sql_parse.cc:5995
|
#15 0x55de8f306d68 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /10.9/sql/sql_parse.cc:8034
|
#16 0x55de8f2ddfb6 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /10.9/sql/sql_parse.cc:1992
|
#17 0x55de8f2da290 in do_command(THD*, bool) /10.9/sql/sql_parse.cc:1403
|
#18 0x55de8f76d785 in do_handle_one_connection(CONNECT*, bool) /10.9/sql/sql_connect.cc:1418
|
#19 0x55de8f76d00a in handle_one_connection /10.9/sql/sql_connect.cc:1312
|
#20 0x55de903ef03a in pfs_spawn_thread /10.9/storage/perfschema/pfs.cc:2201
|
#21 0x7fadde3f7fa2 in start_thread /build/glibc-fWwxX8/glibc-2.28/nptl/pthread_create.c:486
|
|
previously allocated by thread T32 here:
|
#0 0x7faddeb0b330 in __interceptor_malloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9330)
|
#1 0x55de91007d5c in sf_malloc /10.9/mysys/safemalloc.c:126
|
#2 0x55de90fd675b in my_malloc /10.9/mysys/my_malloc.c:90
|
#3 0x55de90fb211c in root_alloc /10.9/mysys/my_alloc.c:66
|
#4 0x55de90fb38db in alloc_root /10.9/mysys/my_alloc.c:332
|
#5 0x55de90fb531b in strmake_root /10.9/mysys/my_alloc.c:584
|
#6 0x55de8f68f50a in open_table_from_share(THD*, TABLE_SHARE*, st_mysql_const_lex_string const*, unsigned int, unsigned int, unsigned int, TABLE*, bool, List<String>*) /10.9/sql/table.cc:4033
|
#7 0x55de8f13f0bf in open_table(THD*, TABLE_LIST*, Open_table_context*) /10.9/sql/sql_base.cc:2003
|
#8 0x55de8f148a66 in open_and_process_table /10.9/sql/sql_base.cc:3809
|
#9 0x55de8f14b683 in open_tables(THD*, DDL_options_st const&, TABLE_LIST**, unsigned int*, unsigned int, Prelocking_strategy*) /10.9/sql/sql_base.cc:4292
|
#10 0x55de8f15076b in open_and_lock_tables(THD*, DDL_options_st const&, TABLE_LIST*, bool, unsigned int, Prelocking_strategy*) /10.9/sql/sql_base.cc:5265
|
#11 0x55de8f0accc4 in open_and_lock_tables(THD*, TABLE_LIST*, bool, unsigned int) /10.9/sql/sql_base.h:509
|
#12 0x55de8f2fb454 in execute_sqlcom_select /10.9/sql/sql_parse.cc:6180
|
#13 0x55de8f2eaac1 in mysql_execute_command(THD*, bool) /10.9/sql/sql_parse.cc:3950
|
#14 0x55de8f306d68 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /10.9/sql/sql_parse.cc:8034
|
#15 0x55de8f2dd59b in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /10.9/sql/sql_parse.cc:1895
|
#16 0x55de8f2da290 in do_command(THD*, bool) /10.9/sql/sql_parse.cc:1403
|
#17 0x55de8f76d785 in do_handle_one_connection(CONNECT*, bool) /10.9/sql/sql_connect.cc:1418
|
#18 0x55de8f76d00a in handle_one_connection /10.9/sql/sql_connect.cc:1312
|
#19 0x55de903ef03a in pfs_spawn_thread /10.9/storage/perfschema/pfs.cc:2201
|
#20 0x7fadde3f7fa2 in start_thread /build/glibc-fWwxX8/glibc-2.28/nptl/pthread_create.c:486
|
|
Thread T32 created by T0 here:
|
#0 0x7faddea72db0 in __interceptor_pthread_create (/lib/x86_64-linux-gnu/libasan.so.5+0x50db0)
|
#1 0x55de903eab5a in my_thread_create /10.9/storage/perfschema/my_thread.h:52
|
#2 0x55de903ef429 in pfs_spawn_thread_v1 /10.9/storage/perfschema/pfs.cc:2252
|
#3 0x55de8ef36546 in inline_mysql_thread_create /10.9/include/mysql/psi/mysql_thread.h:1139
|
#4 0x55de8ef4d9d4 in create_thread_to_handle_connection(CONNECT*) /10.9/sql/mysqld.cc:5975
|
#5 0x55de8ef4e03f in create_new_thread(CONNECT*) /10.9/sql/mysqld.cc:6034
|
#6 0x55de8ef4e3b1 in handle_accepted_socket(st_mysql_socket, st_mysql_socket) /10.9/sql/mysqld.cc:6096
|
#7 0x55de8ef4edb0 in handle_connections_sockets() /10.9/sql/mysqld.cc:6220
|
#8 0x55de8ef4d23b in mysqld_main(int, char**) /10.9/sql/mysqld.cc:5870
|
#9 0x55de8ef35794 in main /10.9/sql/main.cc:34
|
#10 0x7fadddf2c09a in __libc_start_main ../csu/libc-start.c:308
|
|
Thread T31 created by T0 here:
|
#0 0x7faddea72db0 in __interceptor_pthread_create (/lib/x86_64-linux-gnu/libasan.so.5+0x50db0)
|
#1 0x55de903eab5a in my_thread_create /10.9/storage/perfschema/my_thread.h:52
|
#2 0x55de903ef429 in pfs_spawn_thread_v1 /10.9/storage/perfschema/pfs.cc:2252
|
#3 0x55de8ef36546 in inline_mysql_thread_create /10.9/include/mysql/psi/mysql_thread.h:1139
|
#4 0x55de8ef4d9d4 in create_thread_to_handle_connection(CONNECT*) /10.9/sql/mysqld.cc:5975
|
#5 0x55de8ef4e03f in create_new_thread(CONNECT*) /10.9/sql/mysqld.cc:6034
|
#6 0x55de8ef4e3b1 in handle_accepted_socket(st_mysql_socket, st_mysql_socket) /10.9/sql/mysqld.cc:6096
|
#7 0x55de8ef4edb0 in handle_connections_sockets() /10.9/sql/mysqld.cc:6220
|
#8 0x55de8ef4d23b in mysqld_main(int, char**) /10.9/sql/mysqld.cc:5870
|
#9 0x55de8ef35794 in main /10.9/sql/main.cc:34
|
#10 0x7fadddf2c09a in __libc_start_main ../csu/libc-start.c:308
|
|
SUMMARY: AddressSanitizer: heap-use-after-free /10.9/sql/item.cc:7821 in Item_field::print(String*, enum_query_type)
|
Shadow bytes around the buggy address:
|
0x0c34800a2a10: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
|
0x0c34800a2a20: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
|
0x0c34800a2a30: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
|
0x0c34800a2a40: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
|
0x0c34800a2a50: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
|
=>0x0c34800a2a60: fd fd fd[fd]fd fd fd fd fd fd fd fd fd fd fd fd
|
0x0c34800a2a70: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
|
0x0c34800a2a80: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
|
0x0c34800a2a90: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
|
0x0c34800a2aa0: fd fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
|
0x0c34800a2ab0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
|
Shadow byte legend (one shadow byte represents 8 application bytes):
|
Addressable: 00
|
Partially addressable: 01 02 03 04 05 06 07
|
Heap left redzone: fa
|
Freed heap region: fd
|
Stack left redzone: f1
|
Stack mid redzone: f2
|
Stack right redzone: f3
|
Stack after return: f5
|
Stack use after scope: f8
|
Global redzone: f9
|
Global init order: f6
|
Poisoned by user: f7
|
Container overflow: fc
|
Array cookie: ac
|
Intra object redzone: bb
|
ASan internal: fe
|
Left alloca redzone: ca
|
Right alloca redzone: cb
|
==69440==ABORTING
|
SHUTDOWN_1648646328
|
220330 17:06:12 [ERROR] mysqld got signal 11 ;
|
|
Server version: 10.9.0-MariaDB-debug-log
|
|
|
sql/sql_class.h:3860(THD::temporal_round_mode() const)[0x560afb9c38e3]
|
sql/sql_type.cc:322(Temporal::default_round_mode(THD*))[0x560afbbe3050]
|
sql/sql_type.h:2348(Datetime::Options::Options(date_conv_mode_t, THD*))[0x560afb223d6f]
|
sql/field.cc:5411(Field_timestamp::val_str(String*, String*))[0x560afbddbdce]
|
sql/item.cc:3323(Item_field::val_str(String*))[0x560afbebb4cc]
|
sql/item.cc:526(Item::print_value(String*))[0x560afbea34c3]
|
sql/item.cc:7825(Item_field::print(String*, enum_query_type))[0x560afbede640]
|
sql/item.cc:497(Item::print_parenthesised(String*, enum_query_type, precedence))[0x560afbea2fdd]
|
sql/item_func.cc:636(Item_func::print_op(String*, enum_query_type))[0x560afbf97163]
|
sql/item_cmpfunc.h:551(Item_bool_rowready_func2::print(String*, enum_query_type))[0x560afb2b2dd1]
|
sql/item.cc:497(Item::print_parenthesised(String*, enum_query_type, precedence))[0x560afbea2fdd]
|
sql/item_cmpfunc.cc:5286(Item_cond::print(String*, enum_query_type))[0x560afbf410bb]
|
sql/sql_explain.cc:1546(write_item(Json_writer*, Item*))[0x560afbadcba7]
|
sql/sql_explain.cc:1605(Explain_table_access::tag_to_json(Json_writer*, explain_extra_tag))[0x560afbadd047]
|
sql/sql_explain.cc:1881(Explain_table_access::print_explain_json(Explain_query*, Json_writer*, bool))[0x560afbade6cf]
|
sql/sql_explain.cc:1127(Explain_basic_join::print_explain_json_interns(Explain_query*, Json_writer*, bool))[0x560afbad9f14]
|
sql/sql_explain.cc:1022(Explain_select::print_explain_json(Explain_query*, Json_writer*, bool))[0x560afbad92bb]
|
sql/sql_explain.cc:251(Explain_query::print_explain_json(select_result_sink*, bool, unsigned long long))[0x560afbad429d]
|
sql/sql_lex.cc:5856(LEX::print_explain(select_result_sink*, unsigned char, bool, bool, bool*))[0x560afb541d63]
|
sql/sql_show.cc:3005(Show_explain_request::call_in_target_thread())[0x560afb7ad4be]
|
sql/my_apc.cc:226(Apc_target::process_apc_requests())[0x560afbb6b33d]
|
sql/my_apc.h:74(Apc_target::disable())[0x560afbae4ce7]
|
sql/sql_explain.cc:168(Explain_query::notify_item_objects_about_to_be_freed())[0x560afbad3874]
|
sql/sql_class.cc:2257(THD::cleanup_after_query())[0x560afb473545]
|
sql/sql_parse.cc:8058(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x560afb5ce177]
|
sql/sql_parse.cc:1897(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x560afb5a459c]
|
sql/sql_parse.cc:1403(do_command(THD*, bool))[0x560afb5a1291]
|
sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x560afba34786]
|
sql/sql_connect.cc:1314(handle_one_connection)[0x560afba3400b]
|
perfschema/pfs.cc:2203(pfs_spawn_thread)[0x560afc6b603b]
|
nptl/pthread_create.c:487(start_thread)[0x7fac24e95fa3]
|
x86_64/clone.S:97(clone)[0x7fac24a9eeff]
|
Attachments
Issue Links
- causes
-
MDEV-31432 tmp_table field accessed after free
-
- Closed
-
- is caused by
-
MDEV-27021 Extend SHOW EXPLAIN to support SHOW ANALYZE [FORMAT=JSON]
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Assignee | Sergei Petrunia [ psergey ] |
Link |
This issue is caused by |
Description |
{code:sql}
CREATE TABLE t1 (i int) ; INSERT INTO t1 VALUES (1),(2),(3); --connect (con1,localhost,root,,test) --let $conid= `SELECT CONNECTION_ID()` --let $run=100 while ($run) { send SELECT i FROM (SELECT DISTINCT * FROM t1) a1 GROUP BY i ; --connection default --let $show=100 while ($show) { --error 0,ER_TARGET_NOT_EXPLAINABLE eval SHOW EXPLAIN FORMAT=JSON FOR $conid; --dec $show } --connection con1 --reap --dec $run } # Cleanup --disconnect con1 {code} {noformat:title=preview-10.9- Version: '10.9.0-MariaDB-debug-log' 220330 17:04:13 [ERROR] mysqld got signal 11 ; Server version: 10.9.0-MariaDB-debug-log sigaction.c:0(__restore_rt)[0x7f5d1927a3c0] sql/item.cc:7821(Item_field::print(String*, enum_query_type))[0x563a4b0fe850] sql/sql_explain.cc:1557(append_item_to_str(String*, Item*))[0x563a4af221d0] sql/sql_explain.cc:1070(Explain_aggr_filesort::print_json_members(Json_writer*, bool))[0x563a4af2032a] sql/sql_explain.cc:1002(Explain_select::print_explain_json(Explain_query*, Json_writer*, bool))[0x563a4af1ffa5] sql/sql_explain.cc:251(Explain_query::print_explain_json(select_result_sink*, bool, unsigned long long))[0x563a4af1d203] sql/sql_lex.cc:5856(LEX::print_explain(select_result_sink*, unsigned char, bool, bool, bool*))[0x563a4acce9a4] sql/sql_show.cc:3005(Show_explain_request::call_in_target_thread())[0x563a4adcee84] sql/my_apc.cc:226(Apc_target::process_apc_requests())[0x563a4af5bd94] sql/my_apc.h:74(Apc_target::disable())[0x563a4af26ad3] sql/sql_explain.cc:168(Explain_query::notify_item_objects_about_to_be_freed())[0x563a4af1cdea] sql/sql_class.cc:2257(THD::cleanup_after_query())[0x563a4ac7a7a8] sql/sql_parse.cc:8058(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x563a4ad10470] sql/sql_parse.cc:1897(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x563a4acfc6ff] sql/sql_parse.cc:1403(do_command(THD*, bool))[0x563a4acfb09b] sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x563a4aed4221] sql/sql_connect.cc:1314(handle_one_connection)[0x563a4aed3eb1] perfschema/pfs.cc:2203(pfs_spawn_thread)[0x563a4b423e4b] nptl/pthread_create.c:478(start_thread)[0x7f5d1926e609] ??:0(clone)[0x7f5d18e3f163] Query (0x7f5ce4015420): SHOW EXPLAIN FORMAT=JSON FOR 5 {noformat} |
{code:sql}
CREATE TABLE t1 (i int) ; INSERT INTO t1 VALUES (1),(2),(3); --connect (con1,localhost,root,,test) --let $conid= `SELECT CONNECTION_ID()` --let $run=100 while ($run) { send SELECT i FROM (SELECT DISTINCT * FROM t1) a1 GROUP BY i ; --connection default --let $show=100 while ($show) { --error 0,ER_TARGET_NOT_EXPLAINABLE eval SHOW EXPLAIN FORMAT=JSON FOR $conid; --dec $show } --connection con1 --reap --dec $run } # Cleanup --disconnect con1 {code} {noformat:title=preview-10.9- Version: '10.9.0-MariaDB-debug-log' 220330 17:04:13 [ERROR] mysqld got signal 11 ; Server version: 10.9.0-MariaDB-debug-log sigaction.c:0(__restore_rt)[0x7f5d1927a3c0] sql/item.cc:7821(Item_field::print(String*, enum_query_type))[0x563a4b0fe850] sql/sql_explain.cc:1557(append_item_to_str(String*, Item*))[0x563a4af221d0] sql/sql_explain.cc:1070(Explain_aggr_filesort::print_json_members(Json_writer*, bool))[0x563a4af2032a] sql/sql_explain.cc:1002(Explain_select::print_explain_json(Explain_query*, Json_writer*, bool))[0x563a4af1ffa5] sql/sql_explain.cc:251(Explain_query::print_explain_json(select_result_sink*, bool, unsigned long long))[0x563a4af1d203] sql/sql_lex.cc:5856(LEX::print_explain(select_result_sink*, unsigned char, bool, bool, bool*))[0x563a4acce9a4] sql/sql_show.cc:3005(Show_explain_request::call_in_target_thread())[0x563a4adcee84] sql/my_apc.cc:226(Apc_target::process_apc_requests())[0x563a4af5bd94] sql/my_apc.h:74(Apc_target::disable())[0x563a4af26ad3] sql/sql_explain.cc:168(Explain_query::notify_item_objects_about_to_be_freed())[0x563a4af1cdea] sql/sql_class.cc:2257(THD::cleanup_after_query())[0x563a4ac7a7a8] sql/sql_parse.cc:8058(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x563a4ad10470] sql/sql_parse.cc:1897(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x563a4acfc6ff] sql/sql_parse.cc:1403(do_command(THD*, bool))[0x563a4acfb09b] sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x563a4aed4221] sql/sql_connect.cc:1314(handle_one_connection)[0x563a4aed3eb1] perfschema/pfs.cc:2203(pfs_spawn_thread)[0x563a4b423e4b] nptl/pthread_create.c:478(start_thread)[0x7f5d1926e609] ??:0(clone)[0x7f5d18e3f163] Query (0x7f5ce4015420): SHOW EXPLAIN FORMAT=JSON FOR 5 {noformat} {code:sql} CREATE TABLE t1 (i int) ; INSERT INTO t1 VALUES (1),(2),(3); --connect (con1,localhost,root,,test) --let $conid= `SELECT CONNECTION_ID()` --let $run=100 while ($run) { send SELECT i FROM (SELECT DISTINCT * FROM t1) a1 WHERE i IN ('v'); --connection default --let $show=100 while ($show) { --error 0,ER_TARGET_NOT_EXPLAINABLE eval SHOW EXPLAIN FORMAT=JSON FOR $conid; --dec $show } --connection con1 --reap --dec $run } # Cleanup --disconnect con1 {code} {noformat:title=preview-10.9- 220330 17:21:40 [ERROR] mysqld got signal 11 ; Server version: 10.9.0-MariaDB-debug-log sigaction.c:0(__restore_rt)[0x7f20410413c0] sql/item.cc:7821(Item_field::print(String*, enum_query_type))[0x55da53a1f850] sql/item.cc:497(Item::print_parenthesised(String*, enum_query_type, precedence))[0x55da53a07b9b] sql/item_func.cc:631(Item_func::print_op(String*, enum_query_type))[0x55da53a7361e] sql/item_cmpfunc.h:551(Item_bool_rowready_func2::print(String*, enum_query_type))[0x55da534d2df9] sql/sql_explain.cc:1546(write_item(Json_writer*, Item*))[0x55da538430d4] sql/sql_explain.cc:1605(Explain_table_access::tag_to_json(Json_writer*, explain_extra_tag))[0x55da538433d0] sql/sql_explain.cc:1881(Explain_table_access::print_explain_json(Explain_query*, Json_writer*, bool))[0x55da538442c0] sql/sql_explain.cc:1127(Explain_basic_join::print_explain_json_interns(Explain_query*, Json_writer*, bool))[0x55da538416b7] sql/sql_explain.cc:1022(Explain_select::print_explain_json(Explain_query*, Json_writer*, bool))[0x55da53841068] sql/sql_explain.cc:251(Explain_query::print_explain_json(select_result_sink*, bool, unsigned long long))[0x55da5383e203] sql/sql_lex.cc:5856(LEX::print_explain(select_result_sink*, unsigned char, bool, bool, bool*))[0x55da535ef9a4] sql/sql_show.cc:3005(Show_explain_request::call_in_target_thread())[0x55da536efe84] sql/my_apc.cc:226(Apc_target::process_apc_requests())[0x55da5387cd94] sql/my_apc.h:74(Apc_target::disable())[0x55da53847ad3] sql/sql_explain.cc:168(Explain_query::notify_item_objects_about_to_be_freed())[0x55da5383ddea] sql/sql_class.cc:2257(THD::cleanup_after_query())[0x55da5359b7a8] sql/sql_parse.cc:8058(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x55da53631470] sql/sql_parse.cc:1897(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x55da5361d6ff] sql/sql_parse.cc:1403(do_command(THD*, bool))[0x55da5361c09b] sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x55da537f5221] sql/sql_connect.cc:1314(handle_one_connection)[0x55da537f4eb1] perfschema/pfs.cc:2203(pfs_spawn_thread)[0x55da53d44e4b] nptl/pthread_create.c:478(start_thread)[0x7f2041035609] ??:0(clone)[0x7f2040c06163] Query (0x7f200c015420): SHOW EXPLAIN FORMAT=JSON FOR 5 {noformat} |
Description |
{code:sql}
CREATE TABLE t1 (i int) ; INSERT INTO t1 VALUES (1),(2),(3); --connect (con1,localhost,root,,test) --let $conid= `SELECT CONNECTION_ID()` --let $run=100 while ($run) { send SELECT i FROM (SELECT DISTINCT * FROM t1) a1 GROUP BY i ; --connection default --let $show=100 while ($show) { --error 0,ER_TARGET_NOT_EXPLAINABLE eval SHOW EXPLAIN FORMAT=JSON FOR $conid; --dec $show } --connection con1 --reap --dec $run } # Cleanup --disconnect con1 {code} {noformat:title=preview-10.9- Version: '10.9.0-MariaDB-debug-log' 220330 17:04:13 [ERROR] mysqld got signal 11 ; Server version: 10.9.0-MariaDB-debug-log sigaction.c:0(__restore_rt)[0x7f5d1927a3c0] sql/item.cc:7821(Item_field::print(String*, enum_query_type))[0x563a4b0fe850] sql/sql_explain.cc:1557(append_item_to_str(String*, Item*))[0x563a4af221d0] sql/sql_explain.cc:1070(Explain_aggr_filesort::print_json_members(Json_writer*, bool))[0x563a4af2032a] sql/sql_explain.cc:1002(Explain_select::print_explain_json(Explain_query*, Json_writer*, bool))[0x563a4af1ffa5] sql/sql_explain.cc:251(Explain_query::print_explain_json(select_result_sink*, bool, unsigned long long))[0x563a4af1d203] sql/sql_lex.cc:5856(LEX::print_explain(select_result_sink*, unsigned char, bool, bool, bool*))[0x563a4acce9a4] sql/sql_show.cc:3005(Show_explain_request::call_in_target_thread())[0x563a4adcee84] sql/my_apc.cc:226(Apc_target::process_apc_requests())[0x563a4af5bd94] sql/my_apc.h:74(Apc_target::disable())[0x563a4af26ad3] sql/sql_explain.cc:168(Explain_query::notify_item_objects_about_to_be_freed())[0x563a4af1cdea] sql/sql_class.cc:2257(THD::cleanup_after_query())[0x563a4ac7a7a8] sql/sql_parse.cc:8058(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x563a4ad10470] sql/sql_parse.cc:1897(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x563a4acfc6ff] sql/sql_parse.cc:1403(do_command(THD*, bool))[0x563a4acfb09b] sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x563a4aed4221] sql/sql_connect.cc:1314(handle_one_connection)[0x563a4aed3eb1] perfschema/pfs.cc:2203(pfs_spawn_thread)[0x563a4b423e4b] nptl/pthread_create.c:478(start_thread)[0x7f5d1926e609] ??:0(clone)[0x7f5d18e3f163] Query (0x7f5ce4015420): SHOW EXPLAIN FORMAT=JSON FOR 5 {noformat} {code:sql} CREATE TABLE t1 (i int) ; INSERT INTO t1 VALUES (1),(2),(3); --connect (con1,localhost,root,,test) --let $conid= `SELECT CONNECTION_ID()` --let $run=100 while ($run) { send SELECT i FROM (SELECT DISTINCT * FROM t1) a1 WHERE i IN ('v'); --connection default --let $show=100 while ($show) { --error 0,ER_TARGET_NOT_EXPLAINABLE eval SHOW EXPLAIN FORMAT=JSON FOR $conid; --dec $show } --connection con1 --reap --dec $run } # Cleanup --disconnect con1 {code} {noformat:title=preview-10.9- 220330 17:21:40 [ERROR] mysqld got signal 11 ; Server version: 10.9.0-MariaDB-debug-log sigaction.c:0(__restore_rt)[0x7f20410413c0] sql/item.cc:7821(Item_field::print(String*, enum_query_type))[0x55da53a1f850] sql/item.cc:497(Item::print_parenthesised(String*, enum_query_type, precedence))[0x55da53a07b9b] sql/item_func.cc:631(Item_func::print_op(String*, enum_query_type))[0x55da53a7361e] sql/item_cmpfunc.h:551(Item_bool_rowready_func2::print(String*, enum_query_type))[0x55da534d2df9] sql/sql_explain.cc:1546(write_item(Json_writer*, Item*))[0x55da538430d4] sql/sql_explain.cc:1605(Explain_table_access::tag_to_json(Json_writer*, explain_extra_tag))[0x55da538433d0] sql/sql_explain.cc:1881(Explain_table_access::print_explain_json(Explain_query*, Json_writer*, bool))[0x55da538442c0] sql/sql_explain.cc:1127(Explain_basic_join::print_explain_json_interns(Explain_query*, Json_writer*, bool))[0x55da538416b7] sql/sql_explain.cc:1022(Explain_select::print_explain_json(Explain_query*, Json_writer*, bool))[0x55da53841068] sql/sql_explain.cc:251(Explain_query::print_explain_json(select_result_sink*, bool, unsigned long long))[0x55da5383e203] sql/sql_lex.cc:5856(LEX::print_explain(select_result_sink*, unsigned char, bool, bool, bool*))[0x55da535ef9a4] sql/sql_show.cc:3005(Show_explain_request::call_in_target_thread())[0x55da536efe84] sql/my_apc.cc:226(Apc_target::process_apc_requests())[0x55da5387cd94] sql/my_apc.h:74(Apc_target::disable())[0x55da53847ad3] sql/sql_explain.cc:168(Explain_query::notify_item_objects_about_to_be_freed())[0x55da5383ddea] sql/sql_class.cc:2257(THD::cleanup_after_query())[0x55da5359b7a8] sql/sql_parse.cc:8058(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x55da53631470] sql/sql_parse.cc:1897(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x55da5361d6ff] sql/sql_parse.cc:1403(do_command(THD*, bool))[0x55da5361c09b] sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x55da537f5221] sql/sql_connect.cc:1314(handle_one_connection)[0x55da537f4eb1] perfschema/pfs.cc:2203(pfs_spawn_thread)[0x55da53d44e4b] nptl/pthread_create.c:478(start_thread)[0x7f2041035609] ??:0(clone)[0x7f2040c06163] Query (0x7f200c015420): SHOW EXPLAIN FORMAT=JSON FOR 5 {noformat} |
{code:sql}
CREATE TABLE t1 (i int) ; INSERT INTO t1 VALUES (1),(2),(3); --connect (con1,localhost,root,,test) --let $conid= `SELECT CONNECTION_ID()` --let $run=100 while ($run) { send SELECT i FROM (SELECT DISTINCT * FROM t1) a1 GROUP BY i ; --connection default --let $show=100 while ($show) { --error 0,ER_TARGET_NOT_EXPLAINABLE eval SHOW EXPLAIN FORMAT=JSON FOR $conid; --dec $show } --connection con1 --reap --dec $run } # Cleanup --disconnect con1 {code} {noformat:title=preview-10.9- Version: '10.9.0-MariaDB-debug-log' 220330 17:04:13 [ERROR] mysqld got signal 11 ; Server version: 10.9.0-MariaDB-debug-log sigaction.c:0(__restore_rt)[0x7f5d1927a3c0] sql/item.cc:7821(Item_field::print(String*, enum_query_type))[0x563a4b0fe850] sql/sql_explain.cc:1557(append_item_to_str(String*, Item*))[0x563a4af221d0] sql/sql_explain.cc:1070(Explain_aggr_filesort::print_json_members(Json_writer*, bool))[0x563a4af2032a] sql/sql_explain.cc:1002(Explain_select::print_explain_json(Explain_query*, Json_writer*, bool))[0x563a4af1ffa5] sql/sql_explain.cc:251(Explain_query::print_explain_json(select_result_sink*, bool, unsigned long long))[0x563a4af1d203] sql/sql_lex.cc:5856(LEX::print_explain(select_result_sink*, unsigned char, bool, bool, bool*))[0x563a4acce9a4] sql/sql_show.cc:3005(Show_explain_request::call_in_target_thread())[0x563a4adcee84] sql/my_apc.cc:226(Apc_target::process_apc_requests())[0x563a4af5bd94] sql/my_apc.h:74(Apc_target::disable())[0x563a4af26ad3] sql/sql_explain.cc:168(Explain_query::notify_item_objects_about_to_be_freed())[0x563a4af1cdea] sql/sql_class.cc:2257(THD::cleanup_after_query())[0x563a4ac7a7a8] sql/sql_parse.cc:8058(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x563a4ad10470] sql/sql_parse.cc:1897(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x563a4acfc6ff] sql/sql_parse.cc:1403(do_command(THD*, bool))[0x563a4acfb09b] sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x563a4aed4221] sql/sql_connect.cc:1314(handle_one_connection)[0x563a4aed3eb1] perfschema/pfs.cc:2203(pfs_spawn_thread)[0x563a4b423e4b] nptl/pthread_create.c:478(start_thread)[0x7f5d1926e609] ??:0(clone)[0x7f5d18e3f163] Query (0x7f5ce4015420): SHOW EXPLAIN FORMAT=JSON FOR 5 {noformat} {code:sql} CREATE TABLE t1 (i int) ; INSERT INTO t1 VALUES (1),(2),(3); --connect (con1,localhost,root,,test) --let $conid= `SELECT CONNECTION_ID()` --let $run=100 while ($run) { send SELECT i FROM (SELECT DISTINCT * FROM t1) a1 WHERE i IN ('v'); --connection default --let $show=100 while ($show) { --error 0,ER_TARGET_NOT_EXPLAINABLE eval SHOW EXPLAIN FORMAT=JSON FOR $conid; --dec $show } --connection con1 --reap --dec $run } # Cleanup --disconnect con1 {code} {noformat:title=preview-10.9- 220330 17:21:40 [ERROR] mysqld got signal 11 ; Server version: 10.9.0-MariaDB-debug-log sigaction.c:0(__restore_rt)[0x7f20410413c0] sql/item.cc:7821(Item_field::print(String*, enum_query_type))[0x55da53a1f850] sql/item.cc:497(Item::print_parenthesised(String*, enum_query_type, precedence))[0x55da53a07b9b] sql/item_func.cc:631(Item_func::print_op(String*, enum_query_type))[0x55da53a7361e] sql/item_cmpfunc.h:551(Item_bool_rowready_func2::print(String*, enum_query_type))[0x55da534d2df9] sql/sql_explain.cc:1546(write_item(Json_writer*, Item*))[0x55da538430d4] sql/sql_explain.cc:1605(Explain_table_access::tag_to_json(Json_writer*, explain_extra_tag))[0x55da538433d0] sql/sql_explain.cc:1881(Explain_table_access::print_explain_json(Explain_query*, Json_writer*, bool))[0x55da538442c0] sql/sql_explain.cc:1127(Explain_basic_join::print_explain_json_interns(Explain_query*, Json_writer*, bool))[0x55da538416b7] sql/sql_explain.cc:1022(Explain_select::print_explain_json(Explain_query*, Json_writer*, bool))[0x55da53841068] sql/sql_explain.cc:251(Explain_query::print_explain_json(select_result_sink*, bool, unsigned long long))[0x55da5383e203] sql/sql_lex.cc:5856(LEX::print_explain(select_result_sink*, unsigned char, bool, bool, bool*))[0x55da535ef9a4] sql/sql_show.cc:3005(Show_explain_request::call_in_target_thread())[0x55da536efe84] sql/my_apc.cc:226(Apc_target::process_apc_requests())[0x55da5387cd94] sql/my_apc.h:74(Apc_target::disable())[0x55da53847ad3] sql/sql_explain.cc:168(Explain_query::notify_item_objects_about_to_be_freed())[0x55da5383ddea] sql/sql_class.cc:2257(THD::cleanup_after_query())[0x55da5359b7a8] sql/sql_parse.cc:8058(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x55da53631470] sql/sql_parse.cc:1897(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x55da5361d6ff] sql/sql_parse.cc:1403(do_command(THD*, bool))[0x55da5361c09b] sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x55da537f5221] sql/sql_connect.cc:1314(handle_one_connection)[0x55da537f4eb1] perfschema/pfs.cc:2203(pfs_spawn_thread)[0x55da53d44e4b] nptl/pthread_create.c:478(start_thread)[0x7f2041035609] ??:0(clone)[0x7f2040c06163] Query (0x7f200c015420): SHOW EXPLAIN FORMAT=JSON FOR 5 {noformat} ++variations: {noformat} mysqld: /10.9/sql/field.cc:7525: virtual String* Field_string::val_str(String*, String*): Assertion `!table || table->in_use == _current_thd()' failed. 220330 13:20:06 [ERROR] mysqld got signal 6 ; Server version: 10.9.0-MariaDB-debug-log linux/raise.c:51(__GI_raise)[0x7ff324cda7bb] stdlib/abort.c:81(__GI_abort)[0x7ff324cc5535] intl/loadmsgcat.c:1177(_nl_load_domain)[0x7ff324cc540f] ??:0(__assert_fail)[0x7ff324cd3102] sql/field.cc:7527(Field_string::val_str(String*, String*))[0x556cb3f697dc] sql/item.cc:3323(Item_field::val_str(String*))[0x556cb40314cc] sql/item.cc:526(Item::print_value(String*))[0x556cb40194c3] sql/item.cc:7825(Item_field::print(String*, enum_query_type))[0x556cb4054640] sql/item.cc:8331(Item_ref::print(String*, enum_query_type))[0x556cb40588b2] sql/item.cc:497(Item::print_parenthesised(String*, enum_query_type, precedence))[0x556cb4018fdd] sql/item_func.cc:636(Item_func::print_op(String*, enum_query_type))[0x556cb410d163] sql/item_cmpfunc.h:551(Item_bool_rowready_func2::print(String*, enum_query_type))[0x556cb3428dd1] sql/item.cc:497(Item::print_parenthesised(String*, enum_query_type, precedence))[0x556cb4018fdd] sql/item_cmpfunc.cc:5286(Item_cond::print(String*, enum_query_type))[0x556cb40b70bb] sql/sql_explain.cc:1546(write_item(Json_writer*, Item*))[0x556cb3c52ba7] sql/sql_explain.cc:974(Explain_select::print_explain_json(Explain_query*, Json_writer*, bool))[0x556cb3c4ee52] sql/sql_explain.cc:737(Explain_node::print_explain_json_for_children(Explain_query*, Json_writer*, bool))[0x556cb3c4d599] sql/sql_explain.cc:939(Explain_select::print_explain_json(Explain_query*, Json_writer*, bool))[0x556cb3c4eb0e] sql/sql_explain.cc:251(Explain_query::print_explain_json(select_result_sink*, bool, unsigned long long))[0x556cb3c4a29d] sql/sql_lex.cc:5856(LEX::print_explain(select_result_sink*, unsigned char, bool, bool, bool*))[0x556cb36b7d63] sql/sql_show.cc:3005(Show_explain_request::call_in_target_thread())[0x556cb39234be] sql/my_apc.cc:226(Apc_target::process_apc_requests())[0x556cb3ce133d] sql/my_apc.h:74(Apc_target::disable())[0x556cb3c5ace7] sql/sql_explain.cc:168(Explain_query::notify_item_objects_about_to_be_freed())[0x556cb3c49874] sql/sql_class.cc:2257(THD::cleanup_after_query())[0x556cb35e9545] sql/sql_parse.cc:8058(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x556cb3744177] sql/sql_parse.cc:1897(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x556cb371a59c] sql/sql_parse.cc:1403(do_command(THD*, bool))[0x556cb3717291] sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x556cb3baa786] sql/sql_connect.cc:1314(handle_one_connection)[0x556cb3baa00b] perfschema/pfs.cc:2203(pfs_spawn_thread)[0x556cb482c03b] nptl/pthread_create.c:487(start_thread)[0x7ff325192fa3] x86_64/clone.S:97(clone)[0x7ff324d9beff] Query (0x6290007994e8): SHOW ANALYZE FORMAT=JSON FOR 18 {noformat} {noformat} ================================================================= ==69440==ERROR: AddressSanitizer: heap-use-after-free on address 0x61a000555318 at pc 0x55de8fc175da bp 0x7fadb04b5c80 sp 0x7fadb04b5c78 READ of size 8 at 0x61a000555318 thread T32 #0 0x55de8fc175d9 in Item_field::print(String*, enum_query_type) /10.9/sql/item.cc:7821 #1 0x55de8fd7fd65 in Item_func_conv_charset::print(String*, enum_query_type) /10.9/sql/item_strfunc.cc:3711 #2 0x55de8f815ba6 in write_item /10.9/sql/sql_explain.cc:1544 #3 0x55de8f816046 in Explain_table_access::tag_to_json(Json_writer*, explain_extra_tag) /10.9/sql/sql_explain.cc:1602 #4 0x55de8f8176ce in Explain_table_access::print_explain_json(Explain_query*, Json_writer*, bool) /10.9/sql/sql_explain.cc:1883 #5 0x55de8f812f13 in Explain_basic_join::print_explain_json_interns(Explain_query*, Json_writer*, bool) /10.9/sql/sql_explain.cc:1125 #6 0x55de8f8122ba in Explain_select::print_explain_json(Explain_query*, Json_writer*, bool) /10.9/sql/sql_explain.cc:1020 #7 0x55de8f80d29c in Explain_query::print_explain_json(select_result_sink*, bool, unsigned long long) /10.9/sql/sql_explain.cc:248 #8 0x55de8f27ad62 in LEX::print_explain(select_result_sink*, unsigned char, bool, bool, bool*) /10.9/sql/sql_lex.cc:5856 #9 0x55de8f4e64bd in Show_explain_request::call_in_target_thread() /10.9/sql/sql_show.cc:3003 #10 0x55de8f8a433c in Apc_target::process_apc_requests() /10.9/sql/my_apc.cc:225 #11 0x55de8f81dce6 in Apc_target::disable() /10.9/sql/my_apc.h:73 #12 0x55de8f80c873 in Explain_query::notify_item_objects_about_to_be_freed() /10.9/sql/sql_explain.cc:167 #13 0x55de8f1ac544 in THD::cleanup_after_query() /10.9/sql/sql_class.cc:2245 #14 0x55de8f307176 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /10.9/sql/sql_parse.cc:8058 #15 0x55de8f2dd59b in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /10.9/sql/sql_parse.cc:1895 #16 0x55de8f2da290 in do_command(THD*, bool) /10.9/sql/sql_parse.cc:1403 #17 0x55de8f76d785 in do_handle_one_connection(CONNECT*, bool) /10.9/sql/sql_connect.cc:1418 #18 0x55de8f76d00a in handle_one_connection /10.9/sql/sql_connect.cc:1312 #19 0x55de903ef03a in pfs_spawn_thread /10.9/storage/perfschema/pfs.cc:2201 #20 0x7fadde3f7fa2 in start_thread /build/glibc-fWwxX8/glibc-2.28/nptl/pthread_create.c:486 #21 0x7fadde000efe in clone (/lib/x86_64-linux-gnu/libc.so.6+0xf8efe) 0x61a000555318 is located 664 bytes inside of 1156-byte region [0x61a000555080,0x61a000555504) freed by thread T31 here: #0 0x7faddeb0afb0 in __interceptor_free (/lib/x86_64-linux-gnu/libasan.so.5+0xe8fb0) #1 0x55de91008ec7 in free_memory /10.9/mysys/safemalloc.c:297 #2 0x55de91008376 in sf_free /10.9/mysys/safemalloc.c:203 #3 0x55de90fd7509 in my_free /10.9/mysys/my_malloc.c:211 #4 0x55de90fb21a0 in root_free /10.9/mysys/my_alloc.c:78 #5 0x55de90fb4902 in free_root /10.9/mysys/my_alloc.c:495 #6 0x55de8f69313b in closefrm(TABLE*) /10.9/sql/table.cc:4464 #7 0x55de8f9c9046 in intern_close_table /10.9/sql/table_cache.cc:220 #8 0x55de8f9d0fb0 in TDC_element::flush_unused(bool) /10.9/sql/table_cache.cc:1293 #9 0x55de8f9d0bf0 in TDC_element::flush(THD*, bool) /10.9/sql/table_cache.cc:1258 #10 0x55de8f13b935 in wait_while_table_is_used(THD*, TABLE*, ha_extra_function) /10.9/sql/sql_base.cc:1318 #11 0x55de8f5cb8b9 in simple_rename_or_index_change /10.9/sql/sql_table.cc:9395 #12 0x55de8f5d1c7c in mysql_alter_table(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool, bool) /10.9/sql/sql_table.cc:10298 #13 0x55de8f78aad2 in Sql_cmd_alter_table::execute(THD*) /10.9/sql/sql_alter.cc:547 #14 0x55de8f2f9b0d in mysql_execute_command(THD*, bool) /10.9/sql/sql_parse.cc:5995 #15 0x55de8f306d68 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /10.9/sql/sql_parse.cc:8034 #16 0x55de8f2ddfb6 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /10.9/sql/sql_parse.cc:1992 #17 0x55de8f2da290 in do_command(THD*, bool) /10.9/sql/sql_parse.cc:1403 #18 0x55de8f76d785 in do_handle_one_connection(CONNECT*, bool) /10.9/sql/sql_connect.cc:1418 #19 0x55de8f76d00a in handle_one_connection /10.9/sql/sql_connect.cc:1312 #20 0x55de903ef03a in pfs_spawn_thread /10.9/storage/perfschema/pfs.cc:2201 #21 0x7fadde3f7fa2 in start_thread /build/glibc-fWwxX8/glibc-2.28/nptl/pthread_create.c:486 previously allocated by thread T32 here: #0 0x7faddeb0b330 in __interceptor_malloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9330) #1 0x55de91007d5c in sf_malloc /10.9/mysys/safemalloc.c:126 #2 0x55de90fd675b in my_malloc /10.9/mysys/my_malloc.c:90 #3 0x55de90fb211c in root_alloc /10.9/mysys/my_alloc.c:66 #4 0x55de90fb38db in alloc_root /10.9/mysys/my_alloc.c:332 #5 0x55de90fb531b in strmake_root /10.9/mysys/my_alloc.c:584 #6 0x55de8f68f50a in open_table_from_share(THD*, TABLE_SHARE*, st_mysql_const_lex_string const*, unsigned int, unsigned int, unsigned int, TABLE*, bool, List<String>*) /10.9/sql/table.cc:4033 #7 0x55de8f13f0bf in open_table(THD*, TABLE_LIST*, Open_table_context*) /10.9/sql/sql_base.cc:2003 #8 0x55de8f148a66 in open_and_process_table /10.9/sql/sql_base.cc:3809 #9 0x55de8f14b683 in open_tables(THD*, DDL_options_st const&, TABLE_LIST**, unsigned int*, unsigned int, Prelocking_strategy*) /10.9/sql/sql_base.cc:4292 #10 0x55de8f15076b in open_and_lock_tables(THD*, DDL_options_st const&, TABLE_LIST*, bool, unsigned int, Prelocking_strategy*) /10.9/sql/sql_base.cc:5265 #11 0x55de8f0accc4 in open_and_lock_tables(THD*, TABLE_LIST*, bool, unsigned int) /10.9/sql/sql_base.h:509 #12 0x55de8f2fb454 in execute_sqlcom_select /10.9/sql/sql_parse.cc:6180 #13 0x55de8f2eaac1 in mysql_execute_command(THD*, bool) /10.9/sql/sql_parse.cc:3950 #14 0x55de8f306d68 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /10.9/sql/sql_parse.cc:8034 #15 0x55de8f2dd59b in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /10.9/sql/sql_parse.cc:1895 #16 0x55de8f2da290 in do_command(THD*, bool) /10.9/sql/sql_parse.cc:1403 #17 0x55de8f76d785 in do_handle_one_connection(CONNECT*, bool) /10.9/sql/sql_connect.cc:1418 #18 0x55de8f76d00a in handle_one_connection /10.9/sql/sql_connect.cc:1312 #19 0x55de903ef03a in pfs_spawn_thread /10.9/storage/perfschema/pfs.cc:2201 #20 0x7fadde3f7fa2 in start_thread /build/glibc-fWwxX8/glibc-2.28/nptl/pthread_create.c:486 Thread T32 created by T0 here: #0 0x7faddea72db0 in __interceptor_pthread_create (/lib/x86_64-linux-gnu/libasan.so.5+0x50db0) #1 0x55de903eab5a in my_thread_create /10.9/storage/perfschema/my_thread.h:52 #2 0x55de903ef429 in pfs_spawn_thread_v1 /10.9/storage/perfschema/pfs.cc:2252 #3 0x55de8ef36546 in inline_mysql_thread_create /10.9/include/mysql/psi/mysql_thread.h:1139 #4 0x55de8ef4d9d4 in create_thread_to_handle_connection(CONNECT*) /10.9/sql/mysqld.cc:5975 #5 0x55de8ef4e03f in create_new_thread(CONNECT*) /10.9/sql/mysqld.cc:6034 #6 0x55de8ef4e3b1 in handle_accepted_socket(st_mysql_socket, st_mysql_socket) /10.9/sql/mysqld.cc:6096 #7 0x55de8ef4edb0 in handle_connections_sockets() /10.9/sql/mysqld.cc:6220 #8 0x55de8ef4d23b in mysqld_main(int, char**) /10.9/sql/mysqld.cc:5870 #9 0x55de8ef35794 in main /10.9/sql/main.cc:34 #10 0x7fadddf2c09a in __libc_start_main ../csu/libc-start.c:308 Thread T31 created by T0 here: #0 0x7faddea72db0 in __interceptor_pthread_create (/lib/x86_64-linux-gnu/libasan.so.5+0x50db0) #1 0x55de903eab5a in my_thread_create /10.9/storage/perfschema/my_thread.h:52 #2 0x55de903ef429 in pfs_spawn_thread_v1 /10.9/storage/perfschema/pfs.cc:2252 #3 0x55de8ef36546 in inline_mysql_thread_create /10.9/include/mysql/psi/mysql_thread.h:1139 #4 0x55de8ef4d9d4 in create_thread_to_handle_connection(CONNECT*) /10.9/sql/mysqld.cc:5975 #5 0x55de8ef4e03f in create_new_thread(CONNECT*) /10.9/sql/mysqld.cc:6034 #6 0x55de8ef4e3b1 in handle_accepted_socket(st_mysql_socket, st_mysql_socket) /10.9/sql/mysqld.cc:6096 #7 0x55de8ef4edb0 in handle_connections_sockets() /10.9/sql/mysqld.cc:6220 #8 0x55de8ef4d23b in mysqld_main(int, char**) /10.9/sql/mysqld.cc:5870 #9 0x55de8ef35794 in main /10.9/sql/main.cc:34 #10 0x7fadddf2c09a in __libc_start_main ../csu/libc-start.c:308 SUMMARY: AddressSanitizer: heap-use-after-free /10.9/sql/item.cc:7821 in Item_field::print(String*, enum_query_type) Shadow bytes around the buggy address: 0x0c34800a2a10: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c34800a2a20: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c34800a2a30: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c34800a2a40: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c34800a2a50: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd =>0x0c34800a2a60: fd fd fd[fd]fd fd fd fd fd fd fd fd fd fd fd fd 0x0c34800a2a70: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c34800a2a80: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c34800a2a90: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c34800a2aa0: fd fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c34800a2ab0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==69440==ABORTING SHUTDOWN_1648646328 {noformat} |
Description |
{code:sql}
CREATE TABLE t1 (i int) ; INSERT INTO t1 VALUES (1),(2),(3); --connect (con1,localhost,root,,test) --let $conid= `SELECT CONNECTION_ID()` --let $run=100 while ($run) { send SELECT i FROM (SELECT DISTINCT * FROM t1) a1 GROUP BY i ; --connection default --let $show=100 while ($show) { --error 0,ER_TARGET_NOT_EXPLAINABLE eval SHOW EXPLAIN FORMAT=JSON FOR $conid; --dec $show } --connection con1 --reap --dec $run } # Cleanup --disconnect con1 {code} {noformat:title=preview-10.9- Version: '10.9.0-MariaDB-debug-log' 220330 17:04:13 [ERROR] mysqld got signal 11 ; Server version: 10.9.0-MariaDB-debug-log sigaction.c:0(__restore_rt)[0x7f5d1927a3c0] sql/item.cc:7821(Item_field::print(String*, enum_query_type))[0x563a4b0fe850] sql/sql_explain.cc:1557(append_item_to_str(String*, Item*))[0x563a4af221d0] sql/sql_explain.cc:1070(Explain_aggr_filesort::print_json_members(Json_writer*, bool))[0x563a4af2032a] sql/sql_explain.cc:1002(Explain_select::print_explain_json(Explain_query*, Json_writer*, bool))[0x563a4af1ffa5] sql/sql_explain.cc:251(Explain_query::print_explain_json(select_result_sink*, bool, unsigned long long))[0x563a4af1d203] sql/sql_lex.cc:5856(LEX::print_explain(select_result_sink*, unsigned char, bool, bool, bool*))[0x563a4acce9a4] sql/sql_show.cc:3005(Show_explain_request::call_in_target_thread())[0x563a4adcee84] sql/my_apc.cc:226(Apc_target::process_apc_requests())[0x563a4af5bd94] sql/my_apc.h:74(Apc_target::disable())[0x563a4af26ad3] sql/sql_explain.cc:168(Explain_query::notify_item_objects_about_to_be_freed())[0x563a4af1cdea] sql/sql_class.cc:2257(THD::cleanup_after_query())[0x563a4ac7a7a8] sql/sql_parse.cc:8058(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x563a4ad10470] sql/sql_parse.cc:1897(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x563a4acfc6ff] sql/sql_parse.cc:1403(do_command(THD*, bool))[0x563a4acfb09b] sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x563a4aed4221] sql/sql_connect.cc:1314(handle_one_connection)[0x563a4aed3eb1] perfschema/pfs.cc:2203(pfs_spawn_thread)[0x563a4b423e4b] nptl/pthread_create.c:478(start_thread)[0x7f5d1926e609] ??:0(clone)[0x7f5d18e3f163] Query (0x7f5ce4015420): SHOW EXPLAIN FORMAT=JSON FOR 5 {noformat} {code:sql} CREATE TABLE t1 (i int) ; INSERT INTO t1 VALUES (1),(2),(3); --connect (con1,localhost,root,,test) --let $conid= `SELECT CONNECTION_ID()` --let $run=100 while ($run) { send SELECT i FROM (SELECT DISTINCT * FROM t1) a1 WHERE i IN ('v'); --connection default --let $show=100 while ($show) { --error 0,ER_TARGET_NOT_EXPLAINABLE eval SHOW EXPLAIN FORMAT=JSON FOR $conid; --dec $show } --connection con1 --reap --dec $run } # Cleanup --disconnect con1 {code} {noformat:title=preview-10.9- 220330 17:21:40 [ERROR] mysqld got signal 11 ; Server version: 10.9.0-MariaDB-debug-log sigaction.c:0(__restore_rt)[0x7f20410413c0] sql/item.cc:7821(Item_field::print(String*, enum_query_type))[0x55da53a1f850] sql/item.cc:497(Item::print_parenthesised(String*, enum_query_type, precedence))[0x55da53a07b9b] sql/item_func.cc:631(Item_func::print_op(String*, enum_query_type))[0x55da53a7361e] sql/item_cmpfunc.h:551(Item_bool_rowready_func2::print(String*, enum_query_type))[0x55da534d2df9] sql/sql_explain.cc:1546(write_item(Json_writer*, Item*))[0x55da538430d4] sql/sql_explain.cc:1605(Explain_table_access::tag_to_json(Json_writer*, explain_extra_tag))[0x55da538433d0] sql/sql_explain.cc:1881(Explain_table_access::print_explain_json(Explain_query*, Json_writer*, bool))[0x55da538442c0] sql/sql_explain.cc:1127(Explain_basic_join::print_explain_json_interns(Explain_query*, Json_writer*, bool))[0x55da538416b7] sql/sql_explain.cc:1022(Explain_select::print_explain_json(Explain_query*, Json_writer*, bool))[0x55da53841068] sql/sql_explain.cc:251(Explain_query::print_explain_json(select_result_sink*, bool, unsigned long long))[0x55da5383e203] sql/sql_lex.cc:5856(LEX::print_explain(select_result_sink*, unsigned char, bool, bool, bool*))[0x55da535ef9a4] sql/sql_show.cc:3005(Show_explain_request::call_in_target_thread())[0x55da536efe84] sql/my_apc.cc:226(Apc_target::process_apc_requests())[0x55da5387cd94] sql/my_apc.h:74(Apc_target::disable())[0x55da53847ad3] sql/sql_explain.cc:168(Explain_query::notify_item_objects_about_to_be_freed())[0x55da5383ddea] sql/sql_class.cc:2257(THD::cleanup_after_query())[0x55da5359b7a8] sql/sql_parse.cc:8058(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x55da53631470] sql/sql_parse.cc:1897(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x55da5361d6ff] sql/sql_parse.cc:1403(do_command(THD*, bool))[0x55da5361c09b] sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x55da537f5221] sql/sql_connect.cc:1314(handle_one_connection)[0x55da537f4eb1] perfschema/pfs.cc:2203(pfs_spawn_thread)[0x55da53d44e4b] nptl/pthread_create.c:478(start_thread)[0x7f2041035609] ??:0(clone)[0x7f2040c06163] Query (0x7f200c015420): SHOW EXPLAIN FORMAT=JSON FOR 5 {noformat} ++variations: {noformat} mysqld: /10.9/sql/field.cc:7525: virtual String* Field_string::val_str(String*, String*): Assertion `!table || table->in_use == _current_thd()' failed. 220330 13:20:06 [ERROR] mysqld got signal 6 ; Server version: 10.9.0-MariaDB-debug-log linux/raise.c:51(__GI_raise)[0x7ff324cda7bb] stdlib/abort.c:81(__GI_abort)[0x7ff324cc5535] intl/loadmsgcat.c:1177(_nl_load_domain)[0x7ff324cc540f] ??:0(__assert_fail)[0x7ff324cd3102] sql/field.cc:7527(Field_string::val_str(String*, String*))[0x556cb3f697dc] sql/item.cc:3323(Item_field::val_str(String*))[0x556cb40314cc] sql/item.cc:526(Item::print_value(String*))[0x556cb40194c3] sql/item.cc:7825(Item_field::print(String*, enum_query_type))[0x556cb4054640] sql/item.cc:8331(Item_ref::print(String*, enum_query_type))[0x556cb40588b2] sql/item.cc:497(Item::print_parenthesised(String*, enum_query_type, precedence))[0x556cb4018fdd] sql/item_func.cc:636(Item_func::print_op(String*, enum_query_type))[0x556cb410d163] sql/item_cmpfunc.h:551(Item_bool_rowready_func2::print(String*, enum_query_type))[0x556cb3428dd1] sql/item.cc:497(Item::print_parenthesised(String*, enum_query_type, precedence))[0x556cb4018fdd] sql/item_cmpfunc.cc:5286(Item_cond::print(String*, enum_query_type))[0x556cb40b70bb] sql/sql_explain.cc:1546(write_item(Json_writer*, Item*))[0x556cb3c52ba7] sql/sql_explain.cc:974(Explain_select::print_explain_json(Explain_query*, Json_writer*, bool))[0x556cb3c4ee52] sql/sql_explain.cc:737(Explain_node::print_explain_json_for_children(Explain_query*, Json_writer*, bool))[0x556cb3c4d599] sql/sql_explain.cc:939(Explain_select::print_explain_json(Explain_query*, Json_writer*, bool))[0x556cb3c4eb0e] sql/sql_explain.cc:251(Explain_query::print_explain_json(select_result_sink*, bool, unsigned long long))[0x556cb3c4a29d] sql/sql_lex.cc:5856(LEX::print_explain(select_result_sink*, unsigned char, bool, bool, bool*))[0x556cb36b7d63] sql/sql_show.cc:3005(Show_explain_request::call_in_target_thread())[0x556cb39234be] sql/my_apc.cc:226(Apc_target::process_apc_requests())[0x556cb3ce133d] sql/my_apc.h:74(Apc_target::disable())[0x556cb3c5ace7] sql/sql_explain.cc:168(Explain_query::notify_item_objects_about_to_be_freed())[0x556cb3c49874] sql/sql_class.cc:2257(THD::cleanup_after_query())[0x556cb35e9545] sql/sql_parse.cc:8058(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x556cb3744177] sql/sql_parse.cc:1897(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x556cb371a59c] sql/sql_parse.cc:1403(do_command(THD*, bool))[0x556cb3717291] sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x556cb3baa786] sql/sql_connect.cc:1314(handle_one_connection)[0x556cb3baa00b] perfschema/pfs.cc:2203(pfs_spawn_thread)[0x556cb482c03b] nptl/pthread_create.c:487(start_thread)[0x7ff325192fa3] x86_64/clone.S:97(clone)[0x7ff324d9beff] Query (0x6290007994e8): SHOW ANALYZE FORMAT=JSON FOR 18 {noformat} {noformat} ================================================================= ==69440==ERROR: AddressSanitizer: heap-use-after-free on address 0x61a000555318 at pc 0x55de8fc175da bp 0x7fadb04b5c80 sp 0x7fadb04b5c78 READ of size 8 at 0x61a000555318 thread T32 #0 0x55de8fc175d9 in Item_field::print(String*, enum_query_type) /10.9/sql/item.cc:7821 #1 0x55de8fd7fd65 in Item_func_conv_charset::print(String*, enum_query_type) /10.9/sql/item_strfunc.cc:3711 #2 0x55de8f815ba6 in write_item /10.9/sql/sql_explain.cc:1544 #3 0x55de8f816046 in Explain_table_access::tag_to_json(Json_writer*, explain_extra_tag) /10.9/sql/sql_explain.cc:1602 #4 0x55de8f8176ce in Explain_table_access::print_explain_json(Explain_query*, Json_writer*, bool) /10.9/sql/sql_explain.cc:1883 #5 0x55de8f812f13 in Explain_basic_join::print_explain_json_interns(Explain_query*, Json_writer*, bool) /10.9/sql/sql_explain.cc:1125 #6 0x55de8f8122ba in Explain_select::print_explain_json(Explain_query*, Json_writer*, bool) /10.9/sql/sql_explain.cc:1020 #7 0x55de8f80d29c in Explain_query::print_explain_json(select_result_sink*, bool, unsigned long long) /10.9/sql/sql_explain.cc:248 #8 0x55de8f27ad62 in LEX::print_explain(select_result_sink*, unsigned char, bool, bool, bool*) /10.9/sql/sql_lex.cc:5856 #9 0x55de8f4e64bd in Show_explain_request::call_in_target_thread() /10.9/sql/sql_show.cc:3003 #10 0x55de8f8a433c in Apc_target::process_apc_requests() /10.9/sql/my_apc.cc:225 #11 0x55de8f81dce6 in Apc_target::disable() /10.9/sql/my_apc.h:73 #12 0x55de8f80c873 in Explain_query::notify_item_objects_about_to_be_freed() /10.9/sql/sql_explain.cc:167 #13 0x55de8f1ac544 in THD::cleanup_after_query() /10.9/sql/sql_class.cc:2245 #14 0x55de8f307176 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /10.9/sql/sql_parse.cc:8058 #15 0x55de8f2dd59b in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /10.9/sql/sql_parse.cc:1895 #16 0x55de8f2da290 in do_command(THD*, bool) /10.9/sql/sql_parse.cc:1403 #17 0x55de8f76d785 in do_handle_one_connection(CONNECT*, bool) /10.9/sql/sql_connect.cc:1418 #18 0x55de8f76d00a in handle_one_connection /10.9/sql/sql_connect.cc:1312 #19 0x55de903ef03a in pfs_spawn_thread /10.9/storage/perfschema/pfs.cc:2201 #20 0x7fadde3f7fa2 in start_thread /build/glibc-fWwxX8/glibc-2.28/nptl/pthread_create.c:486 #21 0x7fadde000efe in clone (/lib/x86_64-linux-gnu/libc.so.6+0xf8efe) 0x61a000555318 is located 664 bytes inside of 1156-byte region [0x61a000555080,0x61a000555504) freed by thread T31 here: #0 0x7faddeb0afb0 in __interceptor_free (/lib/x86_64-linux-gnu/libasan.so.5+0xe8fb0) #1 0x55de91008ec7 in free_memory /10.9/mysys/safemalloc.c:297 #2 0x55de91008376 in sf_free /10.9/mysys/safemalloc.c:203 #3 0x55de90fd7509 in my_free /10.9/mysys/my_malloc.c:211 #4 0x55de90fb21a0 in root_free /10.9/mysys/my_alloc.c:78 #5 0x55de90fb4902 in free_root /10.9/mysys/my_alloc.c:495 #6 0x55de8f69313b in closefrm(TABLE*) /10.9/sql/table.cc:4464 #7 0x55de8f9c9046 in intern_close_table /10.9/sql/table_cache.cc:220 #8 0x55de8f9d0fb0 in TDC_element::flush_unused(bool) /10.9/sql/table_cache.cc:1293 #9 0x55de8f9d0bf0 in TDC_element::flush(THD*, bool) /10.9/sql/table_cache.cc:1258 #10 0x55de8f13b935 in wait_while_table_is_used(THD*, TABLE*, ha_extra_function) /10.9/sql/sql_base.cc:1318 #11 0x55de8f5cb8b9 in simple_rename_or_index_change /10.9/sql/sql_table.cc:9395 #12 0x55de8f5d1c7c in mysql_alter_table(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool, bool) /10.9/sql/sql_table.cc:10298 #13 0x55de8f78aad2 in Sql_cmd_alter_table::execute(THD*) /10.9/sql/sql_alter.cc:547 #14 0x55de8f2f9b0d in mysql_execute_command(THD*, bool) /10.9/sql/sql_parse.cc:5995 #15 0x55de8f306d68 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /10.9/sql/sql_parse.cc:8034 #16 0x55de8f2ddfb6 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /10.9/sql/sql_parse.cc:1992 #17 0x55de8f2da290 in do_command(THD*, bool) /10.9/sql/sql_parse.cc:1403 #18 0x55de8f76d785 in do_handle_one_connection(CONNECT*, bool) /10.9/sql/sql_connect.cc:1418 #19 0x55de8f76d00a in handle_one_connection /10.9/sql/sql_connect.cc:1312 #20 0x55de903ef03a in pfs_spawn_thread /10.9/storage/perfschema/pfs.cc:2201 #21 0x7fadde3f7fa2 in start_thread /build/glibc-fWwxX8/glibc-2.28/nptl/pthread_create.c:486 previously allocated by thread T32 here: #0 0x7faddeb0b330 in __interceptor_malloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9330) #1 0x55de91007d5c in sf_malloc /10.9/mysys/safemalloc.c:126 #2 0x55de90fd675b in my_malloc /10.9/mysys/my_malloc.c:90 #3 0x55de90fb211c in root_alloc /10.9/mysys/my_alloc.c:66 #4 0x55de90fb38db in alloc_root /10.9/mysys/my_alloc.c:332 #5 0x55de90fb531b in strmake_root /10.9/mysys/my_alloc.c:584 #6 0x55de8f68f50a in open_table_from_share(THD*, TABLE_SHARE*, st_mysql_const_lex_string const*, unsigned int, unsigned int, unsigned int, TABLE*, bool, List<String>*) /10.9/sql/table.cc:4033 #7 0x55de8f13f0bf in open_table(THD*, TABLE_LIST*, Open_table_context*) /10.9/sql/sql_base.cc:2003 #8 0x55de8f148a66 in open_and_process_table /10.9/sql/sql_base.cc:3809 #9 0x55de8f14b683 in open_tables(THD*, DDL_options_st const&, TABLE_LIST**, unsigned int*, unsigned int, Prelocking_strategy*) /10.9/sql/sql_base.cc:4292 #10 0x55de8f15076b in open_and_lock_tables(THD*, DDL_options_st const&, TABLE_LIST*, bool, unsigned int, Prelocking_strategy*) /10.9/sql/sql_base.cc:5265 #11 0x55de8f0accc4 in open_and_lock_tables(THD*, TABLE_LIST*, bool, unsigned int) /10.9/sql/sql_base.h:509 #12 0x55de8f2fb454 in execute_sqlcom_select /10.9/sql/sql_parse.cc:6180 #13 0x55de8f2eaac1 in mysql_execute_command(THD*, bool) /10.9/sql/sql_parse.cc:3950 #14 0x55de8f306d68 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /10.9/sql/sql_parse.cc:8034 #15 0x55de8f2dd59b in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /10.9/sql/sql_parse.cc:1895 #16 0x55de8f2da290 in do_command(THD*, bool) /10.9/sql/sql_parse.cc:1403 #17 0x55de8f76d785 in do_handle_one_connection(CONNECT*, bool) /10.9/sql/sql_connect.cc:1418 #18 0x55de8f76d00a in handle_one_connection /10.9/sql/sql_connect.cc:1312 #19 0x55de903ef03a in pfs_spawn_thread /10.9/storage/perfschema/pfs.cc:2201 #20 0x7fadde3f7fa2 in start_thread /build/glibc-fWwxX8/glibc-2.28/nptl/pthread_create.c:486 Thread T32 created by T0 here: #0 0x7faddea72db0 in __interceptor_pthread_create (/lib/x86_64-linux-gnu/libasan.so.5+0x50db0) #1 0x55de903eab5a in my_thread_create /10.9/storage/perfschema/my_thread.h:52 #2 0x55de903ef429 in pfs_spawn_thread_v1 /10.9/storage/perfschema/pfs.cc:2252 #3 0x55de8ef36546 in inline_mysql_thread_create /10.9/include/mysql/psi/mysql_thread.h:1139 #4 0x55de8ef4d9d4 in create_thread_to_handle_connection(CONNECT*) /10.9/sql/mysqld.cc:5975 #5 0x55de8ef4e03f in create_new_thread(CONNECT*) /10.9/sql/mysqld.cc:6034 #6 0x55de8ef4e3b1 in handle_accepted_socket(st_mysql_socket, st_mysql_socket) /10.9/sql/mysqld.cc:6096 #7 0x55de8ef4edb0 in handle_connections_sockets() /10.9/sql/mysqld.cc:6220 #8 0x55de8ef4d23b in mysqld_main(int, char**) /10.9/sql/mysqld.cc:5870 #9 0x55de8ef35794 in main /10.9/sql/main.cc:34 #10 0x7fadddf2c09a in __libc_start_main ../csu/libc-start.c:308 Thread T31 created by T0 here: #0 0x7faddea72db0 in __interceptor_pthread_create (/lib/x86_64-linux-gnu/libasan.so.5+0x50db0) #1 0x55de903eab5a in my_thread_create /10.9/storage/perfschema/my_thread.h:52 #2 0x55de903ef429 in pfs_spawn_thread_v1 /10.9/storage/perfschema/pfs.cc:2252 #3 0x55de8ef36546 in inline_mysql_thread_create /10.9/include/mysql/psi/mysql_thread.h:1139 #4 0x55de8ef4d9d4 in create_thread_to_handle_connection(CONNECT*) /10.9/sql/mysqld.cc:5975 #5 0x55de8ef4e03f in create_new_thread(CONNECT*) /10.9/sql/mysqld.cc:6034 #6 0x55de8ef4e3b1 in handle_accepted_socket(st_mysql_socket, st_mysql_socket) /10.9/sql/mysqld.cc:6096 #7 0x55de8ef4edb0 in handle_connections_sockets() /10.9/sql/mysqld.cc:6220 #8 0x55de8ef4d23b in mysqld_main(int, char**) /10.9/sql/mysqld.cc:5870 #9 0x55de8ef35794 in main /10.9/sql/main.cc:34 #10 0x7fadddf2c09a in __libc_start_main ../csu/libc-start.c:308 SUMMARY: AddressSanitizer: heap-use-after-free /10.9/sql/item.cc:7821 in Item_field::print(String*, enum_query_type) Shadow bytes around the buggy address: 0x0c34800a2a10: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c34800a2a20: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c34800a2a30: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c34800a2a40: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c34800a2a50: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd =>0x0c34800a2a60: fd fd fd[fd]fd fd fd fd fd fd fd fd fd fd fd fd 0x0c34800a2a70: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c34800a2a80: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c34800a2a90: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c34800a2aa0: fd fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c34800a2ab0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==69440==ABORTING SHUTDOWN_1648646328 {noformat} |
{code:sql}
CREATE TABLE t1 (i int) ; INSERT INTO t1 VALUES (1),(2),(3); --connect (con1,localhost,root,,test) --let $conid= `SELECT CONNECTION_ID()` --let $run=100 while ($run) { send SELECT i FROM (SELECT DISTINCT * FROM t1) a1 GROUP BY i ; --connection default --let $show=100 while ($show) { --error 0,ER_TARGET_NOT_EXPLAINABLE eval SHOW EXPLAIN FORMAT=JSON FOR $conid; --dec $show } --connection con1 --reap --dec $run } # Cleanup --disconnect con1 {code} {noformat:title=preview-10.9- Version: '10.9.0-MariaDB-debug-log' 220330 17:04:13 [ERROR] mysqld got signal 11 ; Server version: 10.9.0-MariaDB-debug-log sigaction.c:0(__restore_rt)[0x7f5d1927a3c0] sql/item.cc:7821(Item_field::print(String*, enum_query_type))[0x563a4b0fe850] sql/sql_explain.cc:1557(append_item_to_str(String*, Item*))[0x563a4af221d0] sql/sql_explain.cc:1070(Explain_aggr_filesort::print_json_members(Json_writer*, bool))[0x563a4af2032a] sql/sql_explain.cc:1002(Explain_select::print_explain_json(Explain_query*, Json_writer*, bool))[0x563a4af1ffa5] sql/sql_explain.cc:251(Explain_query::print_explain_json(select_result_sink*, bool, unsigned long long))[0x563a4af1d203] sql/sql_lex.cc:5856(LEX::print_explain(select_result_sink*, unsigned char, bool, bool, bool*))[0x563a4acce9a4] sql/sql_show.cc:3005(Show_explain_request::call_in_target_thread())[0x563a4adcee84] sql/my_apc.cc:226(Apc_target::process_apc_requests())[0x563a4af5bd94] sql/my_apc.h:74(Apc_target::disable())[0x563a4af26ad3] sql/sql_explain.cc:168(Explain_query::notify_item_objects_about_to_be_freed())[0x563a4af1cdea] sql/sql_class.cc:2257(THD::cleanup_after_query())[0x563a4ac7a7a8] sql/sql_parse.cc:8058(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x563a4ad10470] sql/sql_parse.cc:1897(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x563a4acfc6ff] sql/sql_parse.cc:1403(do_command(THD*, bool))[0x563a4acfb09b] sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x563a4aed4221] sql/sql_connect.cc:1314(handle_one_connection)[0x563a4aed3eb1] perfschema/pfs.cc:2203(pfs_spawn_thread)[0x563a4b423e4b] nptl/pthread_create.c:478(start_thread)[0x7f5d1926e609] ??:0(clone)[0x7f5d18e3f163] Query (0x7f5ce4015420): SHOW EXPLAIN FORMAT=JSON FOR 5 {noformat} {code:sql} CREATE TABLE t1 (i int) ; INSERT INTO t1 VALUES (1),(2),(3); --connect (con1,localhost,root,,test) --let $conid= `SELECT CONNECTION_ID()` --let $run=100 while ($run) { send SELECT i FROM (SELECT DISTINCT * FROM t1) a1 WHERE i IN ('v'); --connection default --let $show=100 while ($show) { --error 0,ER_TARGET_NOT_EXPLAINABLE eval SHOW EXPLAIN FORMAT=JSON FOR $conid; --dec $show } --connection con1 --reap --dec $run } # Cleanup --disconnect con1 {code} {noformat:title=preview-10.9- 220330 17:21:40 [ERROR] mysqld got signal 11 ; Server version: 10.9.0-MariaDB-debug-log sigaction.c:0(__restore_rt)[0x7f20410413c0] sql/item.cc:7821(Item_field::print(String*, enum_query_type))[0x55da53a1f850] sql/item.cc:497(Item::print_parenthesised(String*, enum_query_type, precedence))[0x55da53a07b9b] sql/item_func.cc:631(Item_func::print_op(String*, enum_query_type))[0x55da53a7361e] sql/item_cmpfunc.h:551(Item_bool_rowready_func2::print(String*, enum_query_type))[0x55da534d2df9] sql/sql_explain.cc:1546(write_item(Json_writer*, Item*))[0x55da538430d4] sql/sql_explain.cc:1605(Explain_table_access::tag_to_json(Json_writer*, explain_extra_tag))[0x55da538433d0] sql/sql_explain.cc:1881(Explain_table_access::print_explain_json(Explain_query*, Json_writer*, bool))[0x55da538442c0] sql/sql_explain.cc:1127(Explain_basic_join::print_explain_json_interns(Explain_query*, Json_writer*, bool))[0x55da538416b7] sql/sql_explain.cc:1022(Explain_select::print_explain_json(Explain_query*, Json_writer*, bool))[0x55da53841068] sql/sql_explain.cc:251(Explain_query::print_explain_json(select_result_sink*, bool, unsigned long long))[0x55da5383e203] sql/sql_lex.cc:5856(LEX::print_explain(select_result_sink*, unsigned char, bool, bool, bool*))[0x55da535ef9a4] sql/sql_show.cc:3005(Show_explain_request::call_in_target_thread())[0x55da536efe84] sql/my_apc.cc:226(Apc_target::process_apc_requests())[0x55da5387cd94] sql/my_apc.h:74(Apc_target::disable())[0x55da53847ad3] sql/sql_explain.cc:168(Explain_query::notify_item_objects_about_to_be_freed())[0x55da5383ddea] sql/sql_class.cc:2257(THD::cleanup_after_query())[0x55da5359b7a8] sql/sql_parse.cc:8058(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x55da53631470] sql/sql_parse.cc:1897(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x55da5361d6ff] sql/sql_parse.cc:1403(do_command(THD*, bool))[0x55da5361c09b] sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x55da537f5221] sql/sql_connect.cc:1314(handle_one_connection)[0x55da537f4eb1] perfschema/pfs.cc:2203(pfs_spawn_thread)[0x55da53d44e4b] nptl/pthread_create.c:478(start_thread)[0x7f2041035609] ??:0(clone)[0x7f2040c06163] Query (0x7f200c015420): SHOW EXPLAIN FORMAT=JSON FOR 5 {noformat} ++variations: {noformat} mysqld: /10.9/sql/field.cc:7525: virtual String* Field_string::val_str(String*, String*): Assertion `!table || table->in_use == _current_thd()' failed. 220330 13:20:06 [ERROR] mysqld got signal 6 ; Server version: 10.9.0-MariaDB-debug-log linux/raise.c:51(__GI_raise)[0x7ff324cda7bb] stdlib/abort.c:81(__GI_abort)[0x7ff324cc5535] intl/loadmsgcat.c:1177(_nl_load_domain)[0x7ff324cc540f] ??:0(__assert_fail)[0x7ff324cd3102] sql/field.cc:7527(Field_string::val_str(String*, String*))[0x556cb3f697dc] sql/item.cc:3323(Item_field::val_str(String*))[0x556cb40314cc] sql/item.cc:526(Item::print_value(String*))[0x556cb40194c3] sql/item.cc:7825(Item_field::print(String*, enum_query_type))[0x556cb4054640] sql/item.cc:8331(Item_ref::print(String*, enum_query_type))[0x556cb40588b2] sql/item.cc:497(Item::print_parenthesised(String*, enum_query_type, precedence))[0x556cb4018fdd] sql/item_func.cc:636(Item_func::print_op(String*, enum_query_type))[0x556cb410d163] sql/item_cmpfunc.h:551(Item_bool_rowready_func2::print(String*, enum_query_type))[0x556cb3428dd1] sql/item.cc:497(Item::print_parenthesised(String*, enum_query_type, precedence))[0x556cb4018fdd] sql/item_cmpfunc.cc:5286(Item_cond::print(String*, enum_query_type))[0x556cb40b70bb] sql/sql_explain.cc:1546(write_item(Json_writer*, Item*))[0x556cb3c52ba7] sql/sql_explain.cc:974(Explain_select::print_explain_json(Explain_query*, Json_writer*, bool))[0x556cb3c4ee52] sql/sql_explain.cc:737(Explain_node::print_explain_json_for_children(Explain_query*, Json_writer*, bool))[0x556cb3c4d599] sql/sql_explain.cc:939(Explain_select::print_explain_json(Explain_query*, Json_writer*, bool))[0x556cb3c4eb0e] sql/sql_explain.cc:251(Explain_query::print_explain_json(select_result_sink*, bool, unsigned long long))[0x556cb3c4a29d] sql/sql_lex.cc:5856(LEX::print_explain(select_result_sink*, unsigned char, bool, bool, bool*))[0x556cb36b7d63] sql/sql_show.cc:3005(Show_explain_request::call_in_target_thread())[0x556cb39234be] sql/my_apc.cc:226(Apc_target::process_apc_requests())[0x556cb3ce133d] sql/my_apc.h:74(Apc_target::disable())[0x556cb3c5ace7] sql/sql_explain.cc:168(Explain_query::notify_item_objects_about_to_be_freed())[0x556cb3c49874] sql/sql_class.cc:2257(THD::cleanup_after_query())[0x556cb35e9545] sql/sql_parse.cc:8058(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x556cb3744177] sql/sql_parse.cc:1897(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x556cb371a59c] sql/sql_parse.cc:1403(do_command(THD*, bool))[0x556cb3717291] sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x556cb3baa786] sql/sql_connect.cc:1314(handle_one_connection)[0x556cb3baa00b] perfschema/pfs.cc:2203(pfs_spawn_thread)[0x556cb482c03b] nptl/pthread_create.c:487(start_thread)[0x7ff325192fa3] x86_64/clone.S:97(clone)[0x7ff324d9beff] Query (0x6290007994e8): SHOW ANALYZE FORMAT=JSON FOR 18 {noformat} {noformat} ================================================================= ==69440==ERROR: AddressSanitizer: heap-use-after-free on address 0x61a000555318 at pc 0x55de8fc175da bp 0x7fadb04b5c80 sp 0x7fadb04b5c78 READ of size 8 at 0x61a000555318 thread T32 #0 0x55de8fc175d9 in Item_field::print(String*, enum_query_type) /10.9/sql/item.cc:7821 #1 0x55de8fd7fd65 in Item_func_conv_charset::print(String*, enum_query_type) /10.9/sql/item_strfunc.cc:3711 #2 0x55de8f815ba6 in write_item /10.9/sql/sql_explain.cc:1544 #3 0x55de8f816046 in Explain_table_access::tag_to_json(Json_writer*, explain_extra_tag) /10.9/sql/sql_explain.cc:1602 #4 0x55de8f8176ce in Explain_table_access::print_explain_json(Explain_query*, Json_writer*, bool) /10.9/sql/sql_explain.cc:1883 #5 0x55de8f812f13 in Explain_basic_join::print_explain_json_interns(Explain_query*, Json_writer*, bool) /10.9/sql/sql_explain.cc:1125 #6 0x55de8f8122ba in Explain_select::print_explain_json(Explain_query*, Json_writer*, bool) /10.9/sql/sql_explain.cc:1020 #7 0x55de8f80d29c in Explain_query::print_explain_json(select_result_sink*, bool, unsigned long long) /10.9/sql/sql_explain.cc:248 #8 0x55de8f27ad62 in LEX::print_explain(select_result_sink*, unsigned char, bool, bool, bool*) /10.9/sql/sql_lex.cc:5856 #9 0x55de8f4e64bd in Show_explain_request::call_in_target_thread() /10.9/sql/sql_show.cc:3003 #10 0x55de8f8a433c in Apc_target::process_apc_requests() /10.9/sql/my_apc.cc:225 #11 0x55de8f81dce6 in Apc_target::disable() /10.9/sql/my_apc.h:73 #12 0x55de8f80c873 in Explain_query::notify_item_objects_about_to_be_freed() /10.9/sql/sql_explain.cc:167 #13 0x55de8f1ac544 in THD::cleanup_after_query() /10.9/sql/sql_class.cc:2245 #14 0x55de8f307176 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /10.9/sql/sql_parse.cc:8058 #15 0x55de8f2dd59b in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /10.9/sql/sql_parse.cc:1895 #16 0x55de8f2da290 in do_command(THD*, bool) /10.9/sql/sql_parse.cc:1403 #17 0x55de8f76d785 in do_handle_one_connection(CONNECT*, bool) /10.9/sql/sql_connect.cc:1418 #18 0x55de8f76d00a in handle_one_connection /10.9/sql/sql_connect.cc:1312 #19 0x55de903ef03a in pfs_spawn_thread /10.9/storage/perfschema/pfs.cc:2201 #20 0x7fadde3f7fa2 in start_thread /build/glibc-fWwxX8/glibc-2.28/nptl/pthread_create.c:486 #21 0x7fadde000efe in clone (/lib/x86_64-linux-gnu/libc.so.6+0xf8efe) 0x61a000555318 is located 664 bytes inside of 1156-byte region [0x61a000555080,0x61a000555504) freed by thread T31 here: #0 0x7faddeb0afb0 in __interceptor_free (/lib/x86_64-linux-gnu/libasan.so.5+0xe8fb0) #1 0x55de91008ec7 in free_memory /10.9/mysys/safemalloc.c:297 #2 0x55de91008376 in sf_free /10.9/mysys/safemalloc.c:203 #3 0x55de90fd7509 in my_free /10.9/mysys/my_malloc.c:211 #4 0x55de90fb21a0 in root_free /10.9/mysys/my_alloc.c:78 #5 0x55de90fb4902 in free_root /10.9/mysys/my_alloc.c:495 #6 0x55de8f69313b in closefrm(TABLE*) /10.9/sql/table.cc:4464 #7 0x55de8f9c9046 in intern_close_table /10.9/sql/table_cache.cc:220 #8 0x55de8f9d0fb0 in TDC_element::flush_unused(bool) /10.9/sql/table_cache.cc:1293 #9 0x55de8f9d0bf0 in TDC_element::flush(THD*, bool) /10.9/sql/table_cache.cc:1258 #10 0x55de8f13b935 in wait_while_table_is_used(THD*, TABLE*, ha_extra_function) /10.9/sql/sql_base.cc:1318 #11 0x55de8f5cb8b9 in simple_rename_or_index_change /10.9/sql/sql_table.cc:9395 #12 0x55de8f5d1c7c in mysql_alter_table(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool, bool) /10.9/sql/sql_table.cc:10298 #13 0x55de8f78aad2 in Sql_cmd_alter_table::execute(THD*) /10.9/sql/sql_alter.cc:547 #14 0x55de8f2f9b0d in mysql_execute_command(THD*, bool) /10.9/sql/sql_parse.cc:5995 #15 0x55de8f306d68 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /10.9/sql/sql_parse.cc:8034 #16 0x55de8f2ddfb6 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /10.9/sql/sql_parse.cc:1992 #17 0x55de8f2da290 in do_command(THD*, bool) /10.9/sql/sql_parse.cc:1403 #18 0x55de8f76d785 in do_handle_one_connection(CONNECT*, bool) /10.9/sql/sql_connect.cc:1418 #19 0x55de8f76d00a in handle_one_connection /10.9/sql/sql_connect.cc:1312 #20 0x55de903ef03a in pfs_spawn_thread /10.9/storage/perfschema/pfs.cc:2201 #21 0x7fadde3f7fa2 in start_thread /build/glibc-fWwxX8/glibc-2.28/nptl/pthread_create.c:486 previously allocated by thread T32 here: #0 0x7faddeb0b330 in __interceptor_malloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9330) #1 0x55de91007d5c in sf_malloc /10.9/mysys/safemalloc.c:126 #2 0x55de90fd675b in my_malloc /10.9/mysys/my_malloc.c:90 #3 0x55de90fb211c in root_alloc /10.9/mysys/my_alloc.c:66 #4 0x55de90fb38db in alloc_root /10.9/mysys/my_alloc.c:332 #5 0x55de90fb531b in strmake_root /10.9/mysys/my_alloc.c:584 #6 0x55de8f68f50a in open_table_from_share(THD*, TABLE_SHARE*, st_mysql_const_lex_string const*, unsigned int, unsigned int, unsigned int, TABLE*, bool, List<String>*) /10.9/sql/table.cc:4033 #7 0x55de8f13f0bf in open_table(THD*, TABLE_LIST*, Open_table_context*) /10.9/sql/sql_base.cc:2003 #8 0x55de8f148a66 in open_and_process_table /10.9/sql/sql_base.cc:3809 #9 0x55de8f14b683 in open_tables(THD*, DDL_options_st const&, TABLE_LIST**, unsigned int*, unsigned int, Prelocking_strategy*) /10.9/sql/sql_base.cc:4292 #10 0x55de8f15076b in open_and_lock_tables(THD*, DDL_options_st const&, TABLE_LIST*, bool, unsigned int, Prelocking_strategy*) /10.9/sql/sql_base.cc:5265 #11 0x55de8f0accc4 in open_and_lock_tables(THD*, TABLE_LIST*, bool, unsigned int) /10.9/sql/sql_base.h:509 #12 0x55de8f2fb454 in execute_sqlcom_select /10.9/sql/sql_parse.cc:6180 #13 0x55de8f2eaac1 in mysql_execute_command(THD*, bool) /10.9/sql/sql_parse.cc:3950 #14 0x55de8f306d68 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /10.9/sql/sql_parse.cc:8034 #15 0x55de8f2dd59b in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /10.9/sql/sql_parse.cc:1895 #16 0x55de8f2da290 in do_command(THD*, bool) /10.9/sql/sql_parse.cc:1403 #17 0x55de8f76d785 in do_handle_one_connection(CONNECT*, bool) /10.9/sql/sql_connect.cc:1418 #18 0x55de8f76d00a in handle_one_connection /10.9/sql/sql_connect.cc:1312 #19 0x55de903ef03a in pfs_spawn_thread /10.9/storage/perfschema/pfs.cc:2201 #20 0x7fadde3f7fa2 in start_thread /build/glibc-fWwxX8/glibc-2.28/nptl/pthread_create.c:486 Thread T32 created by T0 here: #0 0x7faddea72db0 in __interceptor_pthread_create (/lib/x86_64-linux-gnu/libasan.so.5+0x50db0) #1 0x55de903eab5a in my_thread_create /10.9/storage/perfschema/my_thread.h:52 #2 0x55de903ef429 in pfs_spawn_thread_v1 /10.9/storage/perfschema/pfs.cc:2252 #3 0x55de8ef36546 in inline_mysql_thread_create /10.9/include/mysql/psi/mysql_thread.h:1139 #4 0x55de8ef4d9d4 in create_thread_to_handle_connection(CONNECT*) /10.9/sql/mysqld.cc:5975 #5 0x55de8ef4e03f in create_new_thread(CONNECT*) /10.9/sql/mysqld.cc:6034 #6 0x55de8ef4e3b1 in handle_accepted_socket(st_mysql_socket, st_mysql_socket) /10.9/sql/mysqld.cc:6096 #7 0x55de8ef4edb0 in handle_connections_sockets() /10.9/sql/mysqld.cc:6220 #8 0x55de8ef4d23b in mysqld_main(int, char**) /10.9/sql/mysqld.cc:5870 #9 0x55de8ef35794 in main /10.9/sql/main.cc:34 #10 0x7fadddf2c09a in __libc_start_main ../csu/libc-start.c:308 Thread T31 created by T0 here: #0 0x7faddea72db0 in __interceptor_pthread_create (/lib/x86_64-linux-gnu/libasan.so.5+0x50db0) #1 0x55de903eab5a in my_thread_create /10.9/storage/perfschema/my_thread.h:52 #2 0x55de903ef429 in pfs_spawn_thread_v1 /10.9/storage/perfschema/pfs.cc:2252 #3 0x55de8ef36546 in inline_mysql_thread_create /10.9/include/mysql/psi/mysql_thread.h:1139 #4 0x55de8ef4d9d4 in create_thread_to_handle_connection(CONNECT*) /10.9/sql/mysqld.cc:5975 #5 0x55de8ef4e03f in create_new_thread(CONNECT*) /10.9/sql/mysqld.cc:6034 #6 0x55de8ef4e3b1 in handle_accepted_socket(st_mysql_socket, st_mysql_socket) /10.9/sql/mysqld.cc:6096 #7 0x55de8ef4edb0 in handle_connections_sockets() /10.9/sql/mysqld.cc:6220 #8 0x55de8ef4d23b in mysqld_main(int, char**) /10.9/sql/mysqld.cc:5870 #9 0x55de8ef35794 in main /10.9/sql/main.cc:34 #10 0x7fadddf2c09a in __libc_start_main ../csu/libc-start.c:308 SUMMARY: AddressSanitizer: heap-use-after-free /10.9/sql/item.cc:7821 in Item_field::print(String*, enum_query_type) Shadow bytes around the buggy address: 0x0c34800a2a10: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c34800a2a20: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c34800a2a30: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c34800a2a40: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c34800a2a50: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd =>0x0c34800a2a60: fd fd fd[fd]fd fd fd fd fd fd fd fd fd fd fd fd 0x0c34800a2a70: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c34800a2a80: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c34800a2a90: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c34800a2aa0: fd fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c34800a2ab0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==69440==ABORTING SHUTDOWN_1648646328 {noformat} {noformat} 220330 17:06:12 [ERROR] mysqld got signal 11 ; Server version: 10.9.0-MariaDB-debug-log sql/sql_class.h:3860(THD::temporal_round_mode() const)[0x560afb9c38e3] sql/sql_type.cc:322(Temporal::default_round_mode(THD*))[0x560afbbe3050] sql/sql_type.h:2348(Datetime::Options::Options(date_conv_mode_t, THD*))[0x560afb223d6f] sql/field.cc:5411(Field_timestamp::val_str(String*, String*))[0x560afbddbdce] sql/item.cc:3323(Item_field::val_str(String*))[0x560afbebb4cc] sql/item.cc:526(Item::print_value(String*))[0x560afbea34c3] sql/item.cc:7825(Item_field::print(String*, enum_query_type))[0x560afbede640] sql/item.cc:497(Item::print_parenthesised(String*, enum_query_type, precedence))[0x560afbea2fdd] sql/item_func.cc:636(Item_func::print_op(String*, enum_query_type))[0x560afbf97163] sql/item_cmpfunc.h:551(Item_bool_rowready_func2::print(String*, enum_query_type))[0x560afb2b2dd1] sql/item.cc:497(Item::print_parenthesised(String*, enum_query_type, precedence))[0x560afbea2fdd] sql/item_cmpfunc.cc:5286(Item_cond::print(String*, enum_query_type))[0x560afbf410bb] sql/sql_explain.cc:1546(write_item(Json_writer*, Item*))[0x560afbadcba7] sql/sql_explain.cc:1605(Explain_table_access::tag_to_json(Json_writer*, explain_extra_tag))[0x560afbadd047] sql/sql_explain.cc:1881(Explain_table_access::print_explain_json(Explain_query*, Json_writer*, bool))[0x560afbade6cf] sql/sql_explain.cc:1127(Explain_basic_join::print_explain_json_interns(Explain_query*, Json_writer*, bool))[0x560afbad9f14] sql/sql_explain.cc:1022(Explain_select::print_explain_json(Explain_query*, Json_writer*, bool))[0x560afbad92bb] sql/sql_explain.cc:251(Explain_query::print_explain_json(select_result_sink*, bool, unsigned long long))[0x560afbad429d] sql/sql_lex.cc:5856(LEX::print_explain(select_result_sink*, unsigned char, bool, bool, bool*))[0x560afb541d63] sql/sql_show.cc:3005(Show_explain_request::call_in_target_thread())[0x560afb7ad4be] sql/my_apc.cc:226(Apc_target::process_apc_requests())[0x560afbb6b33d] sql/my_apc.h:74(Apc_target::disable())[0x560afbae4ce7] sql/sql_explain.cc:168(Explain_query::notify_item_objects_about_to_be_freed())[0x560afbad3874] sql/sql_class.cc:2257(THD::cleanup_after_query())[0x560afb473545] sql/sql_parse.cc:8058(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x560afb5ce177] sql/sql_parse.cc:1897(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x560afb5a459c] sql/sql_parse.cc:1403(do_command(THD*, bool))[0x560afb5a1291] sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x560afba34786] sql/sql_connect.cc:1314(handle_one_connection)[0x560afba3400b] perfschema/pfs.cc:2203(pfs_spawn_thread)[0x560afc6b603b] nptl/pthread_create.c:487(start_thread)[0x7fac24e95fa3] x86_64/clone.S:97(clone)[0x7fac24a9eeff] {noformat} |
Comment | [ * If the table is gone, we cannot get the constant value. But we can tell the Item_field was constant by looking at its flags. Should we print {{CONST(tableX.columnY) }} instead? ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Status | In Progress [ 3 ] | In Testing [ 10301 ] |
Assignee | Sergei Petrunia [ psergey ] | Alice Sherepa [ alice ] |
Status | In Testing [ 10301 ] | Stalled [ 10000 ] |
Fix Version/s | N/A [ 14700 ] | |
Fix Version/s | 10.9 [ 26905 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Link |
This issue causes |
This fix makes the crash go away:
diff --git a/sql/item.cc b/sql/item.cc
index c4ba402db49..52660f4495f 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -3129,6 +3129,8 @@ void Item_field::set_field(Field *field_par)
any_privileges= 0;
refers_to_temp_table= true;
}
+ if (field->table->s->tmp_table == INTERNAL_TMP_TABLE)
+ refers_to_temp_table= true;
}
but then some explain outputs change in MTR.