|
I ran into this issue also
INSTALL PLUGIN Spider SONAME 'ha_spider.so';
|
CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET'',DATABASE'',USER'',PASSWORD'');
|
CREATE TABLE t1 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",HOST "srv",TABLE "t"';
|
CREATE TABLE t2 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",HOST "srv",TABLE "t"';
|
CREATE TABLE t3 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",HOST "srv",TABLE "t"';
|
SHOW TABLE STATUS;
|
Or MTR:
IF (`SELECT NOT(COUNT(*)) FROM information_schema.system_variables WHERE variable_name='have_sanitizer' AND global_value like "%UBSAN%"`)
|
{
|
--skip test needs to be run with UBSAN
|
}
|
--source include/have_innodb.inc
|
--let $SOCKET= `SELECT @@global.socket`
|
INSTALL PLUGIN Spider SONAME 'ha_spider.so';
|
CREATE USER spider@localhost IDENTIFIED BY 'pwd';
|
GRANT ALL ON test.* TO spider@localhost;
|
eval CREATE SERVER s FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$SOCKET",DATABASE 'test',USER 'spider',PASSWORD 'pwd');
|
CREATE TABLE t1 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",HOST "srv",TABLE "t"';
|
CREATE TABLE t2 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",HOST "srv",TABLE "t"';
|
CREATE TABLE t3 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",HOST "srv",TABLE "t"';
|
SHOW TABLE STATUS;
|
Leads to:
|
11.0.2 368dd22a816f3b437bccd0b9ff28b9de9b1abf0a (Debug, UBASAN)
|
==2504563==ERROR: AddressSanitizer: heap-use-after-free on address 0x612000085bd8 at pc 0x14564335d760 bp 0x145643f66b60 sp 0x145643f66b50
|
WRITE of size 8 at 0x612000085bd8 thread T33
|
#0 0x14564335d75f in spider_conn_queue_and_merge_loop_check(st_spider_conn*, st_spider_conn_loop_check*) /test/11.0_dbg_san/storage/spider/spd_conn.cc:1184
|
#1 0x145643360240 in spider_conn_queue_loop_check(st_spider_conn*, ha_spider*, int) /test/11.0_dbg_san/storage/spider/spd_conn.cc:1430
|
#2 0x145643380b6f in spider_get_conn(st_spider_share*, int, char*, st_spider_transaction*, ha_spider*, bool, bool, int*) /test/11.0_dbg_san/storage/spider/spd_conn.cc:832
|
#3 0x1456433977cf in spider_share_get_conns(ha_spider*, st_spider_share*, int*) /test/11.0_dbg_san/storage/spider/spd_table.cc:4868
|
#4 0x14564340505c in spider_init_share(char const*, TABLE*, THD*, ha_spider*, int*, st_spider_share*, TABLE_SHARE*, bool) /test/11.0_dbg_san/storage/spider/spd_table.cc:5138
|
#5 0x145643406475 in spider_get_share(char const*, TABLE*, THD*, ha_spider*, int*) /test/11.0_dbg_san/storage/spider/spd_table.cc:5252
|
#6 0x145643505021 in ha_spider::open(char const*, int, unsigned int) /test/11.0_dbg_san/storage/spider/ha_spider.cc:312
|
#7 0x55b0cc3c7235 in handler::ha_open(TABLE*, char const*, int, unsigned int, st_mem_root*, List<String>*) /test/11.0_dbg_san/sql/handler.cc:3487
|
#8 0x55b0cb510885 in open_table_from_share(THD*, TABLE_SHARE*, st_mysql_const_lex_string const*, unsigned int, unsigned int, unsigned int, TABLE*, bool, List<String>*) /test/11.0_dbg_san/sql/table.cc:4540
|
#9 0x55b0ca85f3e3 in open_table(THD*, TABLE_LIST*, Open_table_context*) /test/11.0_dbg_san/sql/sql_base.cc:2178
|
#10 0x55b0ca876f14 in open_and_process_table /test/11.0_dbg_san/sql/sql_base.cc:4108
|
#11 0x55b0ca876f14 in open_tables(THD*, DDL_options_st const&, TABLE_LIST**, unsigned int*, unsigned int, Prelocking_strategy*) /test/11.0_dbg_san/sql/sql_base.cc:4595
|
#12 0x55b0ca87ec14 in open_tables /test/11.0_dbg_san/sql/sql_base.h:266
|
#13 0x55b0ca87ec14 in open_normal_and_derived_tables(THD*, TABLE_LIST*, unsigned int, unsigned int) /test/11.0_dbg_san/sql/sql_base.cc:5634
|
#14 0x55b0ca87f81e in open_tables_only_view_structure(THD*, TABLE_LIST*, bool) /test/11.0_dbg_san/sql/sql_base.cc:5685
|
#15 0x55b0cb126ebe in fill_schema_table_by_open /test/11.0_dbg_san/sql/sql_show.cc:4714
|
#16 0x55b0cb238c13 in get_all_tables(THD*, TABLE_LIST*, Item*) /test/11.0_dbg_san/sql/sql_show.cc:5385
|
#17 0x55b0cb240dc4 in get_schema_tables_result(JOIN*, enum_schema_table_state) /test/11.0_dbg_san/sql/sql_show.cc:9060
|
#18 0x55b0cb0dc83c in JOIN::exec_inner() /test/11.0_dbg_san/sql/sql_select.cc:4857
|
#19 0x55b0cb0e0916 in JOIN::exec() /test/11.0_dbg_san/sql/sql_select.cc:4677
|
#20 0x55b0cb0cf0c1 in mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) /test/11.0_dbg_san/sql/sql_select.cc:5158
|
#21 0x55b0cb0d351c in handle_select(THD*, LEX*, select_result*, unsigned long long) /test/11.0_dbg_san/sql/sql_select.cc:616
|
#22 0x55b0cac45a01 in execute_sqlcom_select /test/11.0_dbg_san/sql/sql_parse.cc:6279
|
#23 0x55b0caca6ef5 in mysql_execute_command(THD*, bool) /test/11.0_dbg_san/sql/sql_parse.cc:3949
|
#24 0x55b0cacd6973 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /test/11.0_dbg_san/sql/sql_parse.cc:8014
|
#25 0x55b0cace6707 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /test/11.0_dbg_san/sql/sql_parse.cc:1894
|
#26 0x55b0cacf4542 in do_command(THD*, bool) /test/11.0_dbg_san/sql/sql_parse.cc:1407
|
#27 0x55b0cb6c98b5 in do_handle_one_connection(CONNECT*, bool) /test/11.0_dbg_san/sql/sql_connect.cc:1416
|
#28 0x55b0cb6cadd0 in handle_one_connection /test/11.0_dbg_san/sql/sql_connect.cc:1318
|
#29 0x145668c94b42 in start_thread nptl/pthread_create.c:442
|
#30 0x145668d269ff (/lib/x86_64-linux-gnu/libc.so.6+0x1269ff)
|
|
0x612000085bd8 is located 152 bytes inside of 296-byte region [0x612000085b40,0x612000085c68)
|
freed by thread T33 here:
|
#0 0x55b0ca35afe7 in __interceptor_free (/test/UBASAN_MD120523-mariadb-11.0.2-linux-x86_64-dbg/bin/mariadbd+0x7963fe7)
|
#1 0x55b0cea72a61 in my_free /test/11.0_dbg_san/mysys/my_malloc.c:213
|
#2 0x145643452150 in spider_free_mem(st_spider_transaction*, void*, unsigned long) /test/11.0_dbg_san/storage/spider/spd_malloc.cc:183
|
#3 0x14564335d3cd in spider_conn_queue_and_merge_loop_check(st_spider_conn*, st_spider_conn_loop_check*) /test/11.0_dbg_san/storage/spider/spd_conn.cc:1166
|
#4 0x145643360240 in spider_conn_queue_loop_check(st_spider_conn*, ha_spider*, int) /test/11.0_dbg_san/storage/spider/spd_conn.cc:1430
|
#5 0x145643380b6f in spider_get_conn(st_spider_share*, int, char*, st_spider_transaction*, ha_spider*, bool, bool, int*) /test/11.0_dbg_san/storage/spider/spd_conn.cc:832
|
#6 0x1456433977cf in spider_share_get_conns(ha_spider*, st_spider_share*, int*) /test/11.0_dbg_san/storage/spider/spd_table.cc:4868
|
#7 0x14564340505c in spider_init_share(char const*, TABLE*, THD*, ha_spider*, int*, st_spider_share*, TABLE_SHARE*, bool) /test/11.0_dbg_san/storage/spider/spd_table.cc:5138
|
#8 0x145643406475 in spider_get_share(char const*, TABLE*, THD*, ha_spider*, int*) /test/11.0_dbg_san/storage/spider/spd_table.cc:5252
|
#9 0x145643505021 in ha_spider::open(char const*, int, unsigned int) /test/11.0_dbg_san/storage/spider/ha_spider.cc:312
|
#10 0x55b0cc3c7235 in handler::ha_open(TABLE*, char const*, int, unsigned int, st_mem_root*, List<String>*) /test/11.0_dbg_san/sql/handler.cc:3487
|
#11 0x55b0cb510885 in open_table_from_share(THD*, TABLE_SHARE*, st_mysql_const_lex_string const*, unsigned int, unsigned int, unsigned int, TABLE*, bool, List<String>*) /test/11.0_dbg_san/sql/table.cc:4540
|
#12 0x55b0ca85f3e3 in open_table(THD*, TABLE_LIST*, Open_table_context*) /test/11.0_dbg_san/sql/sql_base.cc:2178
|
#13 0x55b0ca876f14 in open_and_process_table /test/11.0_dbg_san/sql/sql_base.cc:4108
|
#14 0x55b0ca876f14 in open_tables(THD*, DDL_options_st const&, TABLE_LIST**, unsigned int*, unsigned int, Prelocking_strategy*) /test/11.0_dbg_san/sql/sql_base.cc:4595
|
#15 0x55b0ca87ec14 in open_tables /test/11.0_dbg_san/sql/sql_base.h:266
|
#16 0x55b0ca87ec14 in open_normal_and_derived_tables(THD*, TABLE_LIST*, unsigned int, unsigned int) /test/11.0_dbg_san/sql/sql_base.cc:5634
|
#17 0x55b0ca87f81e in open_tables_only_view_structure(THD*, TABLE_LIST*, bool) /test/11.0_dbg_san/sql/sql_base.cc:5685
|
#18 0x55b0cb126ebe in fill_schema_table_by_open /test/11.0_dbg_san/sql/sql_show.cc:4714
|
#19 0x55b0cb238c13 in get_all_tables(THD*, TABLE_LIST*, Item*) /test/11.0_dbg_san/sql/sql_show.cc:5385
|
#20 0x55b0cb240dc4 in get_schema_tables_result(JOIN*, enum_schema_table_state) /test/11.0_dbg_san/sql/sql_show.cc:9060
|
#21 0x55b0cb0dc83c in JOIN::exec_inner() /test/11.0_dbg_san/sql/sql_select.cc:4857
|
#22 0x55b0cb0e0916 in JOIN::exec() /test/11.0_dbg_san/sql/sql_select.cc:4677
|
#23 0x55b0cb0cf0c1 in mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) /test/11.0_dbg_san/sql/sql_select.cc:5158
|
#24 0x55b0cb0d351c in handle_select(THD*, LEX*, select_result*, unsigned long long) /test/11.0_dbg_san/sql/sql_select.cc:616
|
#25 0x55b0cac45a01 in execute_sqlcom_select /test/11.0_dbg_san/sql/sql_parse.cc:6279
|
#26 0x55b0caca6ef5 in mysql_execute_command(THD*, bool) /test/11.0_dbg_san/sql/sql_parse.cc:3949
|
#27 0x55b0cacd6973 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /test/11.0_dbg_san/sql/sql_parse.cc:8014
|
#28 0x55b0cace6707 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /test/11.0_dbg_san/sql/sql_parse.cc:1894
|
#29 0x55b0cacf4542 in do_command(THD*, bool) /test/11.0_dbg_san/sql/sql_parse.cc:1407
|
#30 0x55b0cb6c98b5 in do_handle_one_connection(CONNECT*, bool) /test/11.0_dbg_san/sql/sql_connect.cc:1416
|
#31 0x55b0cb6cadd0 in handle_one_connection /test/11.0_dbg_san/sql/sql_connect.cc:1318
|
|
previously allocated by thread T33 here:
|
#0 0x55b0ca35b337 in __interceptor_malloc (/test/UBASAN_MD120523-mariadb-11.0.2-linux-x86_64-dbg/bin/mariadbd+0x7964337)
|
#1 0x55b0cea72703 in my_malloc /test/11.0_dbg_san/mysys/my_malloc.c:91
|
#2 0x145643452583 in spider_bulk_alloc_mem(st_spider_transaction*, unsigned int, char const*, char const*, unsigned long, unsigned long, ...) /test/11.0_dbg_san/storage/spider/spd_malloc.cc:231
|
#3 0x14564335c1b5 in spider_conn_queue_and_merge_loop_check(st_spider_conn*, st_spider_conn_loop_check*) /test/11.0_dbg_san/storage/spider/spd_conn.cc:1119
|
#4 0x145643360240 in spider_conn_queue_loop_check(st_spider_conn*, ha_spider*, int) /test/11.0_dbg_san/storage/spider/spd_conn.cc:1430
|
#5 0x145643380b6f in spider_get_conn(st_spider_share*, int, char*, st_spider_transaction*, ha_spider*, bool, bool, int*) /test/11.0_dbg_san/storage/spider/spd_conn.cc:832
|
#6 0x1456433977cf in spider_share_get_conns(ha_spider*, st_spider_share*, int*) /test/11.0_dbg_san/storage/spider/spd_table.cc:4868
|
#7 0x14564340505c in spider_init_share(char const*, TABLE*, THD*, ha_spider*, int*, st_spider_share*, TABLE_SHARE*, bool) /test/11.0_dbg_san/storage/spider/spd_table.cc:5138
|
#8 0x145643406475 in spider_get_share(char const*, TABLE*, THD*, ha_spider*, int*) /test/11.0_dbg_san/storage/spider/spd_table.cc:5252
|
#9 0x145643505021 in ha_spider::open(char const*, int, unsigned int) /test/11.0_dbg_san/storage/spider/ha_spider.cc:312
|
#10 0x55b0cc3c7235 in handler::ha_open(TABLE*, char const*, int, unsigned int, st_mem_root*, List<String>*) /test/11.0_dbg_san/sql/handler.cc:3487
|
#11 0x55b0cb510885 in open_table_from_share(THD*, TABLE_SHARE*, st_mysql_const_lex_string const*, unsigned int, unsigned int, unsigned int, TABLE*, bool, List<String>*) /test/11.0_dbg_san/sql/table.cc:4540
|
#12 0x55b0ca85f3e3 in open_table(THD*, TABLE_LIST*, Open_table_context*) /test/11.0_dbg_san/sql/sql_base.cc:2178
|
#13 0x55b0ca876f14 in open_and_process_table /test/11.0_dbg_san/sql/sql_base.cc:4108
|
#14 0x55b0ca876f14 in open_tables(THD*, DDL_options_st const&, TABLE_LIST**, unsigned int*, unsigned int, Prelocking_strategy*) /test/11.0_dbg_san/sql/sql_base.cc:4595
|
#15 0x55b0ca87ec14 in open_tables /test/11.0_dbg_san/sql/sql_base.h:266
|
#16 0x55b0ca87ec14 in open_normal_and_derived_tables(THD*, TABLE_LIST*, unsigned int, unsigned int) /test/11.0_dbg_san/sql/sql_base.cc:5634
|
#17 0x55b0ca87f81e in open_tables_only_view_structure(THD*, TABLE_LIST*, bool) /test/11.0_dbg_san/sql/sql_base.cc:5685
|
#18 0x55b0cb126ebe in fill_schema_table_by_open /test/11.0_dbg_san/sql/sql_show.cc:4714
|
#19 0x55b0cb238c13 in get_all_tables(THD*, TABLE_LIST*, Item*) /test/11.0_dbg_san/sql/sql_show.cc:5385
|
#20 0x55b0cb240dc4 in get_schema_tables_result(JOIN*, enum_schema_table_state) /test/11.0_dbg_san/sql/sql_show.cc:9060
|
#21 0x55b0cb0dc83c in JOIN::exec_inner() /test/11.0_dbg_san/sql/sql_select.cc:4857
|
#22 0x55b0cb0e0916 in JOIN::exec() /test/11.0_dbg_san/sql/sql_select.cc:4677
|
#23 0x55b0cb0cf0c1 in mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) /test/11.0_dbg_san/sql/sql_select.cc:5158
|
#24 0x55b0cb0d351c in handle_select(THD*, LEX*, select_result*, unsigned long long) /test/11.0_dbg_san/sql/sql_select.cc:616
|
#25 0x55b0cac45a01 in execute_sqlcom_select /test/11.0_dbg_san/sql/sql_parse.cc:6279
|
#26 0x55b0caca6ef5 in mysql_execute_command(THD*, bool) /test/11.0_dbg_san/sql/sql_parse.cc:3949
|
#27 0x55b0cacd6973 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /test/11.0_dbg_san/sql/sql_parse.cc:8014
|
#28 0x55b0cace6707 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /test/11.0_dbg_san/sql/sql_parse.cc:1894
|
#29 0x55b0cacf4542 in do_command(THD*, bool) /test/11.0_dbg_san/sql/sql_parse.cc:1407
|
#30 0x55b0cb6c98b5 in do_handle_one_connection(CONNECT*, bool) /test/11.0_dbg_san/sql/sql_connect.cc:1416
|
#31 0x55b0cb6cadd0 in handle_one_connection /test/11.0_dbg_san/sql/sql_connect.cc:1318
|
|
Thread T33 created by T0 here:
|
#0 0x55b0ca2ff175 in pthread_create (/test/UBASAN_MD120523-mariadb-11.0.2-linux-x86_64-dbg/bin/mariadbd+0x7908175)
|
#1 0x55b0ca3b598b in create_thread_to_handle_connection(CONNECT*) /test/11.0_dbg_san/sql/mysqld.cc:6129
|
#2 0x55b0ca3c2e67 in create_new_thread(CONNECT*) /test/11.0_dbg_san/sql/mysqld.cc:6191
|
#3 0x55b0ca3c36e7 in handle_accepted_socket(st_mysql_socket, st_mysql_socket) /test/11.0_dbg_san/sql/mysqld.cc:6253
|
#4 0x55b0ca3c4738 in handle_connections_sockets() /test/11.0_dbg_san/sql/mysqld.cc:6377
|
#5 0x55b0ca3cbee7 in mysqld_main(int, char**) /test/11.0_dbg_san/sql/mysqld.cc:6024
|
#6 0x55b0ca3a0eca in main /test/11.0_dbg_san/sql/main.cc:34
|
#7 0x145668c29d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
|
|
SUMMARY: AddressSanitizer: heap-use-after-free /test/11.0_dbg_san/storage/spider/spd_conn.cc:1184 in spider_conn_queue_and_merge_loop_check(st_spider_conn*, st_spider_conn_loop_check*)
|
Shadow bytes around the buggy address:
|
0x0c2480008b20: 00 00 00 00 00 00 00 00 00 00 00 00 f7 fa fa fa
|
0x0c2480008b30: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
|
0x0c2480008b40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
0x0c2480008b50: 00 00 00 00 00 00 00 00 00 fa fa fa fa fa fa fa
|
0x0c2480008b60: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
|
=>0x0c2480008b70: fd fd fd fd fd fd fd fd fd fd fd[fd]fd fd fd fd
|
0x0c2480008b80: fd fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa
|
0x0c2480008b90: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
|
0x0c2480008ba0: 00 00 00 00 00 00 00 00 00 00 00 f7 00 00 00 00
|
0x0c2480008bb0: 00 00 00 00 00 00 00 00 00 00 00 00 f7 fa fa fa
|
0x0c2480008bc0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
|
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
|
Shadow gap: cc
|
==2504563==ABORTING
|
And:
|
11.1.0 4e5b771e980edfdad5c5414aa62c81d409d585a4 (Debug, UBASAN)
|
==1000503==ERROR: AddressSanitizer: heap-use-after-free on address 0x612000086358 at pc 0x153e2436a8da bp 0x153e25057bd0 sp 0x153e25057bc0
|
WRITE of size 8 at 0x612000086358 thread T22
|
#0 0x153e2436a8d9 in spider_conn_queue_and_merge_loop_check(st_spider_conn*, st_spider_conn_loop_check*) /test/11.1_dbg_san/storage/spider/spd_conn.cc:1184
|
#1 0x153e2436d3ba in spider_conn_queue_loop_check(st_spider_conn*, ha_spider*, int) /test/11.1_dbg_san/storage/spider/spd_conn.cc:1430
|
#2 0x153e2438dde3 in spider_get_conn(st_spider_share*, int, char*, st_spider_transaction*, ha_spider*, bool, bool, int*) /test/11.1_dbg_san/storage/spider/spd_conn.cc:832
|
#3 0x153e2440f799 in spider_get_share(char const*, TABLE*, THD*, ha_spider*, int*) /test/11.1_dbg_san/storage/spider/spd_table.cc:4927
|
#4 0x153e24515571 in ha_spider::open(char const*, int, unsigned int) /test/11.1_dbg_san/storage/spider/ha_spider.cc:312
|
#5 0x56523ecffbff in handler::ha_open(TABLE*, char const*, int, unsigned int, st_mem_root*, List<String>*) /test/11.1_dbg_san/sql/handler.cc:3472
|
#6 0x56523ddf4189 in open_table_from_share(THD*, TABLE_SHARE*, st_mysql_const_lex_string const*, unsigned int, unsigned int, unsigned int, TABLE*, bool, List<String>*) /test/11.1_dbg_san/sql/table.cc:4570
|
#7 0x56523d146717 in open_table(THD*, TABLE_LIST*, Open_table_context*) /test/11.1_dbg_san/sql/sql_base.cc:2210
|
#8 0x56523d15e248 in open_and_process_table /test/11.1_dbg_san/sql/sql_base.cc:4140
|
#9 0x56523d15e248 in open_tables(THD*, DDL_options_st const&, TABLE_LIST**, unsigned int*, unsigned int, Prelocking_strategy*) /test/11.1_dbg_san/sql/sql_base.cc:4627
|
#10 0x56523d165e77 in open_tables /test/11.1_dbg_san/sql/sql_base.h:267
|
#11 0x56523d165e77 in open_normal_and_derived_tables(THD*, TABLE_LIST*, unsigned int, unsigned int) /test/11.1_dbg_san/sql/sql_base.cc:5665
|
#12 0x56523d166a81 in open_tables_only_view_structure(THD*, TABLE_LIST*, bool) /test/11.1_dbg_san/sql/sql_base.cc:5716
|
#13 0x56523da08f2a in fill_schema_table_by_open /test/11.1_dbg_san/sql/sql_show.cc:4713
|
#14 0x56523db1a672 in get_all_tables(THD*, TABLE_LIST*, Item*) /test/11.1_dbg_san/sql/sql_show.cc:5384
|
#15 0x56523db22975 in get_schema_tables_result(JOIN*, enum_schema_table_state) /test/11.1_dbg_san/sql/sql_show.cc:9060
|
#16 0x56523d9be136 in JOIN::exec_inner() /test/11.1_dbg_san/sql/sql_select.cc:4856
|
#17 0x56523d9c21ec in JOIN::exec() /test/11.1_dbg_san/sql/sql_select.cc:4676
|
#18 0x56523d9b09a0 in mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) /test/11.1_dbg_san/sql/sql_select.cc:5157
|
#19 0x56523d9b4dfb in handle_select(THD*, LEX*, select_result*, unsigned long long) /test/11.1_dbg_san/sql/sql_select.cc:611
|
#20 0x56523d539cee in execute_sqlcom_select /test/11.1_dbg_san/sql/sql_parse.cc:6024
|
#21 0x56523d59b661 in mysql_execute_command(THD*, bool) /test/11.1_dbg_san/sql/sql_parse.cc:3944
|
#22 0x56523d5c65ab in mysql_parse(THD*, char*, unsigned int, Parser_state*) /test/11.1_dbg_san/sql/sql_parse.cc:7760
|
#23 0x56523d5d6335 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /test/11.1_dbg_san/sql/sql_parse.cc:1892
|
#24 0x56523d5e413a in do_command(THD*, bool) /test/11.1_dbg_san/sql/sql_parse.cc:1405
|
#25 0x56523dfac265 in do_handle_one_connection(CONNECT*, bool) /test/11.1_dbg_san/sql/sql_connect.cc:1416
|
#26 0x56523dfad780 in handle_one_connection /test/11.1_dbg_san/sql/sql_connect.cc:1318
|
#27 0x153e48694b42 in start_thread nptl/pthread_create.c:442
|
#28 0x153e487269ff (/lib/x86_64-linux-gnu/libc.so.6+0x1269ff)
|
|
0x612000086358 is located 152 bytes inside of 296-byte region [0x6120000862c0,0x6120000863e8)
|
freed by thread T22 here:
|
#0 0x56523cc42fd7 in __interceptor_free (/test/UBASAN_MD120523-mariadb-11.1.0-linux-x86_64-dbg/bin/mariadbd+0x79f6fd7)
|
#1 0x56524138fa6e in my_free /test/11.1_dbg_san/mysys/my_malloc.c:213
|
#2 0x153e244626e2 in spider_free_mem(st_spider_transaction*, void*, unsigned long) /test/11.1_dbg_san/storage/spider/spd_malloc.cc:183
|
#3 0x153e2436a547 in spider_conn_queue_and_merge_loop_check(st_spider_conn*, st_spider_conn_loop_check*) /test/11.1_dbg_san/storage/spider/spd_conn.cc:1166
|
#4 0x153e2436d3ba in spider_conn_queue_loop_check(st_spider_conn*, ha_spider*, int) /test/11.1_dbg_san/storage/spider/spd_conn.cc:1430
|
#5 0x153e2438dde3 in spider_get_conn(st_spider_share*, int, char*, st_spider_transaction*, ha_spider*, bool, bool, int*) /test/11.1_dbg_san/storage/spider/spd_conn.cc:832
|
#6 0x153e2440f799 in spider_get_share(char const*, TABLE*, THD*, ha_spider*, int*) /test/11.1_dbg_san/storage/spider/spd_table.cc:4927
|
#7 0x153e24515571 in ha_spider::open(char const*, int, unsigned int) /test/11.1_dbg_san/storage/spider/ha_spider.cc:312
|
#8 0x56523ecffbff in handler::ha_open(TABLE*, char const*, int, unsigned int, st_mem_root*, List<String>*) /test/11.1_dbg_san/sql/handler.cc:3472
|
#9 0x56523ddf4189 in open_table_from_share(THD*, TABLE_SHARE*, st_mysql_const_lex_string const*, unsigned int, unsigned int, unsigned int, TABLE*, bool, List<String>*) /test/11.1_dbg_san/sql/table.cc:4570
|
#10 0x56523d146717 in open_table(THD*, TABLE_LIST*, Open_table_context*) /test/11.1_dbg_san/sql/sql_base.cc:2210
|
#11 0x56523d15e248 in open_and_process_table /test/11.1_dbg_san/sql/sql_base.cc:4140
|
#12 0x56523d15e248 in open_tables(THD*, DDL_options_st const&, TABLE_LIST**, unsigned int*, unsigned int, Prelocking_strategy*) /test/11.1_dbg_san/sql/sql_base.cc:4627
|
#13 0x56523d165e77 in open_tables /test/11.1_dbg_san/sql/sql_base.h:267
|
#14 0x56523d165e77 in open_normal_and_derived_tables(THD*, TABLE_LIST*, unsigned int, unsigned int) /test/11.1_dbg_san/sql/sql_base.cc:5665
|
#15 0x56523d166a81 in open_tables_only_view_structure(THD*, TABLE_LIST*, bool) /test/11.1_dbg_san/sql/sql_base.cc:5716
|
#16 0x56523da08f2a in fill_schema_table_by_open /test/11.1_dbg_san/sql/sql_show.cc:4713
|
#17 0x56523db1a672 in get_all_tables(THD*, TABLE_LIST*, Item*) /test/11.1_dbg_san/sql/sql_show.cc:5384
|
#18 0x56523db22975 in get_schema_tables_result(JOIN*, enum_schema_table_state) /test/11.1_dbg_san/sql/sql_show.cc:9060
|
#19 0x56523d9be136 in JOIN::exec_inner() /test/11.1_dbg_san/sql/sql_select.cc:4856
|
#20 0x56523d9c21ec in JOIN::exec() /test/11.1_dbg_san/sql/sql_select.cc:4676
|
#21 0x56523d9b09a0 in mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) /test/11.1_dbg_san/sql/sql_select.cc:5157
|
#22 0x56523d9b4dfb in handle_select(THD*, LEX*, select_result*, unsigned long long) /test/11.1_dbg_san/sql/sql_select.cc:611
|
#23 0x56523d539cee in execute_sqlcom_select /test/11.1_dbg_san/sql/sql_parse.cc:6024
|
#24 0x56523d59b661 in mysql_execute_command(THD*, bool) /test/11.1_dbg_san/sql/sql_parse.cc:3944
|
#25 0x56523d5c65ab in mysql_parse(THD*, char*, unsigned int, Parser_state*) /test/11.1_dbg_san/sql/sql_parse.cc:7760
|
#26 0x56523d5d6335 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /test/11.1_dbg_san/sql/sql_parse.cc:1892
|
#27 0x56523d5e413a in do_command(THD*, bool) /test/11.1_dbg_san/sql/sql_parse.cc:1405
|
#28 0x56523dfac265 in do_handle_one_connection(CONNECT*, bool) /test/11.1_dbg_san/sql/sql_connect.cc:1416
|
#29 0x56523dfad780 in handle_one_connection /test/11.1_dbg_san/sql/sql_connect.cc:1318
|
#30 0x153e48694b42 in start_thread nptl/pthread_create.c:442
|
|
previously allocated by thread T22 here:
|
#0 0x56523cc43327 in malloc (/test/UBASAN_MD120523-mariadb-11.1.0-linux-x86_64-dbg/bin/mariadbd+0x79f7327)
|
#1 0x56524138f710 in my_malloc /test/11.1_dbg_san/mysys/my_malloc.c:91
|
#2 0x153e24462b15 in spider_bulk_alloc_mem(st_spider_transaction*, unsigned int, char const*, char const*, unsigned long, unsigned long, ...) /test/11.1_dbg_san/storage/spider/spd_malloc.cc:231
|
#3 0x153e2436932f in spider_conn_queue_and_merge_loop_check(st_spider_conn*, st_spider_conn_loop_check*) /test/11.1_dbg_san/storage/spider/spd_conn.cc:1119
|
#4 0x153e2436d3ba in spider_conn_queue_loop_check(st_spider_conn*, ha_spider*, int) /test/11.1_dbg_san/storage/spider/spd_conn.cc:1430
|
#5 0x153e2438dde3 in spider_get_conn(st_spider_share*, int, char*, st_spider_transaction*, ha_spider*, bool, bool, int*) /test/11.1_dbg_san/storage/spider/spd_conn.cc:832
|
#6 0x153e2440f799 in spider_get_share(char const*, TABLE*, THD*, ha_spider*, int*) /test/11.1_dbg_san/storage/spider/spd_table.cc:4927
|
#7 0x153e24515571 in ha_spider::open(char const*, int, unsigned int) /test/11.1_dbg_san/storage/spider/ha_spider.cc:312
|
#8 0x56523ecffbff in handler::ha_open(TABLE*, char const*, int, unsigned int, st_mem_root*, List<String>*) /test/11.1_dbg_san/sql/handler.cc:3472
|
#9 0x56523ddf4189 in open_table_from_share(THD*, TABLE_SHARE*, st_mysql_const_lex_string const*, unsigned int, unsigned int, unsigned int, TABLE*, bool, List<String>*) /test/11.1_dbg_san/sql/table.cc:4570
|
#10 0x56523d146717 in open_table(THD*, TABLE_LIST*, Open_table_context*) /test/11.1_dbg_san/sql/sql_base.cc:2210
|
#11 0x56523d15e248 in open_and_process_table /test/11.1_dbg_san/sql/sql_base.cc:4140
|
#12 0x56523d15e248 in open_tables(THD*, DDL_options_st const&, TABLE_LIST**, unsigned int*, unsigned int, Prelocking_strategy*) /test/11.1_dbg_san/sql/sql_base.cc:4627
|
#13 0x56523d165e77 in open_tables /test/11.1_dbg_san/sql/sql_base.h:267
|
#14 0x56523d165e77 in open_normal_and_derived_tables(THD*, TABLE_LIST*, unsigned int, unsigned int) /test/11.1_dbg_san/sql/sql_base.cc:5665
|
#15 0x56523d166a81 in open_tables_only_view_structure(THD*, TABLE_LIST*, bool) /test/11.1_dbg_san/sql/sql_base.cc:5716
|
#16 0x56523da08f2a in fill_schema_table_by_open /test/11.1_dbg_san/sql/sql_show.cc:4713
|
#17 0x56523db1a672 in get_all_tables(THD*, TABLE_LIST*, Item*) /test/11.1_dbg_san/sql/sql_show.cc:5384
|
#18 0x56523db22975 in get_schema_tables_result(JOIN*, enum_schema_table_state) /test/11.1_dbg_san/sql/sql_show.cc:9060
|
#19 0x56523d9be136 in JOIN::exec_inner() /test/11.1_dbg_san/sql/sql_select.cc:4856
|
#20 0x56523d9c21ec in JOIN::exec() /test/11.1_dbg_san/sql/sql_select.cc:4676
|
#21 0x56523d9b09a0 in mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) /test/11.1_dbg_san/sql/sql_select.cc:5157
|
#22 0x56523d9b4dfb in handle_select(THD*, LEX*, select_result*, unsigned long long) /test/11.1_dbg_san/sql/sql_select.cc:611
|
#23 0x56523d539cee in execute_sqlcom_select /test/11.1_dbg_san/sql/sql_parse.cc:6024
|
#24 0x56523d59b661 in mysql_execute_command(THD*, bool) /test/11.1_dbg_san/sql/sql_parse.cc:3944
|
#25 0x56523d5c65ab in mysql_parse(THD*, char*, unsigned int, Parser_state*) /test/11.1_dbg_san/sql/sql_parse.cc:7760
|
#26 0x56523d5d6335 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /test/11.1_dbg_san/sql/sql_parse.cc:1892
|
#27 0x56523d5e413a in do_command(THD*, bool) /test/11.1_dbg_san/sql/sql_parse.cc:1405
|
#28 0x56523dfac265 in do_handle_one_connection(CONNECT*, bool) /test/11.1_dbg_san/sql/sql_connect.cc:1416
|
#29 0x56523dfad780 in handle_one_connection /test/11.1_dbg_san/sql/sql_connect.cc:1318
|
#30 0x153e48694b42 in start_thread nptl/pthread_create.c:442
|
|
Thread T22 created by T0 here:
|
#0 0x56523cbe7165 in pthread_create (/test/UBASAN_MD120523-mariadb-11.1.0-linux-x86_64-dbg/bin/mariadbd+0x799b165)
|
#1 0x56523cc9d66f in create_thread_to_handle_connection(CONNECT*) /test/11.1_dbg_san/sql/mysqld.cc:6134
|
#2 0x56523ccaac5f in create_new_thread(CONNECT*) /test/11.1_dbg_san/sql/mysqld.cc:6193
|
#3 0x56523ccab4bb in handle_accepted_socket(st_mysql_socket, st_mysql_socket) /test/11.1_dbg_san/sql/mysqld.cc:6255
|
#4 0x56523ccac50c in handle_connections_sockets() /test/11.1_dbg_san/sql/mysqld.cc:6379
|
#5 0x56523ccb3c87 in mysqld_main(int, char**) /test/11.1_dbg_san/sql/mysqld.cc:6029
|
#6 0x56523cc88eba in main /test/11.1_dbg_san/sql/main.cc:34
|
#7 0x153e48629d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
|
|
SUMMARY: AddressSanitizer: heap-use-after-free /test/11.1_dbg_san/storage/spider/spd_conn.cc:1184 in spider_conn_queue_and_merge_loop_check(st_spider_conn*, st_spider_conn_loop_check*)
|
Shadow bytes around the buggy address:
|
0x0c2480008c10: 00 00 00 00 00 00 00 00 00 00 00 00 f7 fa fa fa
|
0x0c2480008c20: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
|
0x0c2480008c30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
0x0c2480008c40: 00 00 00 00 00 00 00 00 00 fa fa fa fa fa fa fa
|
0x0c2480008c50: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
|
=>0x0c2480008c60: fd fd fd fd fd fd fd fd fd fd fd[fd]fd fd fd fd
|
0x0c2480008c70: fd fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa
|
0x0c2480008c80: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
|
0x0c2480008c90: 00 00 00 00 00 00 00 00 00 00 00 f7 00 00 00 00
|
0x0c2480008ca0: 00 00 00 00 00 00 00 00 00 00 00 00 f7 fa fa fa
|
0x0c2480008cb0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
|
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
|
Shadow gap: cc
|
==1000503==ABORTING
|
UniqueID's seen across versions/build types (same as above):
ASAN|heap-use-after-free|storage/spider/spd_conn.cc|spider_conn_queue_and_merge_loop_check|spider_conn_queue_loop_check|spider_get_conn|spider_get_share
|
ASAN|heap-use-after-free|storage/spider/spd_conn.cc|spider_conn_queue_and_merge_loop_check|spider_conn_queue_loop_check|spider_get_conn|spider_share_get_conns
|
Bug confirmed present in:
MariaDB: 10.5.21 (dbg), 10.5.21 (opt), 10.6.14 (dbg), 10.6.14 (opt), 10.9.7 (opt), 10.10.5 (dbg), 10.10.5 (opt), 10.11.4 (dbg), 10.11.4 (opt), 11.0.2 (dbg), 11.0.2 (opt), 11.1.0 (dbg), 11.1.0 (opt)
|