|
Test from MDEV-28096:
create table t1 (a int);
|
create table t2 (c int);
|
|
create trigger t2 before insert on t1 for each row update t1 join t2 on 'x' natural join t2 t set c = 1 ;
|
|
--error 1292
|
insert into t1 values (1) ;
|
--error 1292
|
insert into t1 values (1) ;
|
|
10.2 22fd31c5883622b5c7451cee7
|
Version: '10.2.44-MariaDB-debug-log'
|
=================================================================
|
==489237==ERROR: AddressSanitizer: use-after-poison on address 0x62500011b080 at pc 0x55605dfe9b30 bp 0x7ff2668c9270 sp 0x7ff2668c9260
|
READ of size 8 at 0x62500011b080 thread T27
|
#0 0x55605dfe9b2f in multi_update::prepare(List<Item>&, st_select_lex_unit*) /10.2/src/sql/sql_update.cc:1837
|
#1 0x55605ddfc576 in JOIN::prepare(TABLE_LIST*, unsigned int, Item*, unsigned int, st_order*, bool, st_order*, Item*, st_order*, st_select_lex*, st_select_lex_unit*) /10.2/src/sql/sql_select.cc:1062
|
#2 0x55605de18591 in mysql_select(THD*, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) /10.2/src/sql/sql_select.cc:3827
|
#3 0x55605dfe7a12 in mysql_multi_update(THD*, TABLE_LIST*, List<Item>*, List<Item>*, Item*, unsigned long long, enum_duplicates, bool, st_select_lex_unit*, st_select_lex*, multi_update**) /10.2/src/sql/sql_update.cc:1647
|
#4 0x55605dd5bd43 in mysql_execute_command(THD*) /10.2/src/sql/sql_parse.cc:4132
|
#5 0x55605dba46cb in sp_instr_stmt::exec_core(THD*, unsigned int*) /10.2/src/sql/sp_head.cc:3337
|
#6 0x55605dba3197 in sp_lex_keeper::reset_lex_and_exec_core(THD*, unsigned int*, bool, sp_instr*) /10.2/src/sql/sp_head.cc:3099
|
#7 0x55605dba3f3f in sp_instr_stmt::execute(THD*, unsigned int*) /10.2/src/sql/sp_head.cc:3253
|
#8 0x55605db98271 in sp_head::execute(THD*, bool) /10.2/src/sql/sp_head.cc:1326
|
#9 0x55605db9a06b in sp_head::execute_trigger(THD*, st_mysql_lex_string const*, st_mysql_lex_string const*, st_grant_info*) /10.2/src/sql/sp_head.cc:1742
|
#10 0x55605dfbf6c8 in Table_triggers_list::process_triggers(THD*, trg_event_type, trg_action_time_type, bool) /10.2/src/sql/sql_trigger.cc:2209
|
#11 0x55605dc51918 in fill_record_n_invoke_before_triggers(THD*, TABLE*, Field**, List<Item>&, bool, trg_event_type) /10.2/src/sql/sql_base.cc:8420
|
#12 0x55605dcf4a82 in mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool) /10.2/src/sql/sql_insert.cc:1010
|
#13 0x55605dd5c428 in mysql_execute_command(THD*) /10.2/src/sql/sql_parse.cc:4217
|
#14 0x55605dd74d03 in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /10.2/src/sql/sql_parse.cc:7793
|
#15 0x55605dd4df08 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /10.2/src/sql/sql_parse.cc:1827
|
#16 0x55605dd4acd3 in do_command(THD*) /10.2/src/sql/sql_parse.cc:1381
|
#17 0x55605e0d7409 in do_handle_one_connection(CONNECT*) /10.2/src/sql/sql_connect.cc:1336
|
#18 0x55605e0d6ccc in handle_one_connection /10.2/src/sql/sql_connect.cc:1241
|
#19 0x55605f477af3 in pfs_spawn_thread /10.2/src/storage/perfschema/pfs.cc:1869
|
#20 0x7ff27d95b608 in start_thread /build/glibc-sMfBJT/glibc-2.31/nptl/pthread_create.c:477
|
#21 0x7ff27d0c9162 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x11f162)
|
|
0x62500011b080 is located 1920 bytes inside of 8268-byte region [0x62500011a900,0x62500011c94c)
|
allocated by thread T27 here:
|
#0 0x7ff27da83808 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144
|
#1 0x55605f5959f8 in sf_malloc /10.2/src/mysys/safemalloc.c:118
|
#2 0x55605f561993 in my_malloc /10.2/src/mysys/my_malloc.c:101
|
#3 0x55605f53f005 in alloc_root /10.2/src/mysys/my_alloc.c:243
|
#4 0x55605dd85b3e in Query_arena::memdup_w_gap(void const*, unsigned long, unsigned int) /10.2/src/sql/sql_class.h:1012
|
#5 0x55605dd52da1 in alloc_query(THD*, char const*, unsigned int) /10.2/src/sql/sql_parse.cc:2687
|
#6 0x55605dba3e2b in sp_instr_stmt::execute(THD*, unsigned int*) /10.2/src/sql/sp_head.cc:3241
|
#7 0x55605db98271 in sp_head::execute(THD*, bool) /10.2/src/sql/sp_head.cc:1326
|
#8 0x55605db9a06b in sp_head::execute_trigger(THD*, st_mysql_lex_string const*, st_mysql_lex_string const*, st_grant_info*) /10.2/src/sql/sp_head.cc:1742
|
#9 0x55605dfbf6c8 in Table_triggers_list::process_triggers(THD*, trg_event_type, trg_action_time_type, bool) /10.2/src/sql/sql_trigger.cc:2209
|
#10 0x55605dc51918 in fill_record_n_invoke_before_triggers(THD*, TABLE*, Field**, List<Item>&, bool, trg_event_type) /10.2/src/sql/sql_base.cc:8420
|
#11 0x55605dcf4a82 in mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool) /10.2/src/sql/sql_insert.cc:1010
|
#12 0x55605dd5c428 in mysql_execute_command(THD*) /10.2/src/sql/sql_parse.cc:4217
|
#13 0x55605dd74d03 in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /10.2/src/sql/sql_parse.cc:7793
|
#14 0x55605dd4df08 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /10.2/src/sql/sql_parse.cc:1827
|
#15 0x55605dd4acd3 in do_command(THD*) /10.2/src/sql/sql_parse.cc:1381
|
#16 0x55605e0d7409 in do_handle_one_connection(CONNECT*) /10.2/src/sql/sql_connect.cc:1336
|
#17 0x55605e0d6ccc in handle_one_connection /10.2/src/sql/sql_connect.cc:1241
|
#18 0x55605f477af3 in pfs_spawn_thread /10.2/src/storage/perfschema/pfs.cc:1869
|
#19 0x7ff27d95b608 in start_thread /build/glibc-sMfBJT/glibc-2.31/nptl/pthread_create.c:477
|
|
Thread T27 created by T0 here:
|
#0 0x7ff27d9b0815 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cc:208
|
#1 0x55605f477ee4 in spawn_thread_v1 /10.2/src/storage/perfschema/pfs.cc:1919
|
#2 0x55605daed293 in inline_mysql_thread_create /10.2/src/include/mysql/psi/mysql_thread.h:1246
|
#3 0x55605db051ea in create_thread_to_handle_connection(CONNECT*) /10.2/src/sql/mysqld.cc:6580
|
#4 0x55605db05985 in create_new_thread /10.2/src/sql/mysqld.cc:6650
|
#5 0x55605db06b17 in handle_connections_sockets() /10.2/src/sql/mysqld.cc:6908
|
#6 0x55605db0453b in mysqld_main(int, char**) /10.2/src/sql/mysqld.cc:6199
|
#7 0x55605daebb4c in main /10.2/src/sql/main.cc:25
|
#8 0x7ff27cfce0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b2)
|
|
SUMMARY: AddressSanitizer: use-after-poison /10.2/src/sql/sql_update.cc:1837 in multi_update::prepare(List<Item>&, st_select_lex_unit*)
|
Shadow bytes around the buggy address:
|
0x0c4a8001b5c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
0x0c4a8001b5d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
0x0c4a8001b5e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
0x0c4a8001b5f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
0x0c4a8001b600: 00 00 00 00 00 00 00 00 00 00 00 00 00 f7 f7 f7
|
=>0x0c4a8001b610:[f7]f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7
|
0x0c4a8001b620: f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7
|
0x0c4a8001b630: f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7
|
0x0c4a8001b640: f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7
|
0x0c4a8001b650: f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7
|
0x0c4a8001b660: f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7
|
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
|
==489237==ABORTING
|
----------SERVER LOG END-------------
|
|
|
on non-debug build - sig.11:
Version: '10.6.7-MariaDB'
|
220317 14:26:56 [ERROR] mysqld got signal 11 ;
|
|
Server version: 10.6.7-MariaDB
|
]
|
sql/signal_handler.cc:226(handle_fatal_signal)[0x56014ade9657]
|
sigaction.c:0(__restore_rt)[0x7f5d3db4c3c0]
|
sql/sql_list.h:195(base_list::push_back(void*, st_mem_root*))[0x56014ac7eb8e]
|
sql/sql_select.cc:1684(JOIN::prepare(TABLE_LIST*, Item*, unsigned int, st_order*, bool, st_order*, Item*, st_order*, st_select_lex*, st_select_lex_unit*))[0x56014ac10d52]
|
sql/sql_select.cc:4986(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*))[0x56014ac24906]
|
sql/sql_class.h:4326(mysql_multi_update(THD*, TABLE_LIST*, List<Item>*, List<Item>*, Item*, unsigned long long, enum_duplicates, bool, st_select_lex_unit*, st_select_lex*, multi_update**))[0x56014ac7d3c6]
|
sql/sql_parse.cc:4498(mysql_execute_command(THD*, bool))[0x56014abc7c97]
|
sql/sp_head.cc:3778(sp_instr_stmt::exec_core(THD*, unsigned int*))[0x56014ab1f2e8]
|
sql/sp_head.cc:3511(sp_lex_keeper::reset_lex_and_exec_core(THD*, unsigned int*, bool, sp_instr*))[0x56014ab28226]
|
sql/sp_head.cc:3684(sp_instr_stmt::execute(THD*, unsigned int*))[0x56014ab28cbe]
|
sql/sp_head.cc:1437(sp_head::execute(THD*, bool))[0x56014ab23284]
|
psi/mysql_sp.h:79(sp_head::execute_trigger(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, st_grant_info*))[0x56014ab24216]
|
sql/sql_trigger.cc:2473(Table_triggers_list::process_triggers(THD*, trg_event_type, trg_action_time_type, bool))[0x56014ac67b75]
|
sql/sql_base.cc:8924(fill_record_n_invoke_before_triggers(THD*, TABLE*, Field**, List<Item>&, bool, trg_event_type))[0x56014ab5febb]
|
sql/sql_insert.cc:1066(mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool, select_result*))[0x56014ab94139]
|
sql/sql_parse.cc:4567(mysql_execute_command(THD*, bool))[0x56014abc6f48]
|
sql/sql_parse.cc:8030(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x56014abc959b]
|
sql/sql_parse.cc:1955(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x56014abcb7e7]
|
sql/sql_parse.cc:1406(do_command(THD*, bool))[0x56014abcce83]
|
sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x56014acc2be7]
|
sql/sql_connect.cc:1318(handle_one_connection)[0x56014acc2e84]
|
perfschema/pfs.cc:2204(pfs_spawn_thread)[0x56014b0560cc]
|
nptl/pthread_create.c:478(start_thread)[0x7f5d3db40609]
|
??:0(clone)[0x7f5d3d72c163]
|
|
Query (0x7f5cf007fb90): update t1 join t2 on 'x' natural join t2 t set c = 1
|
create table t1 (a int);
|
create table t2 (c int);
|
|
prepare stmt from "update t1 join t2 on 'x' natural join t2 t set c = 1 ;";
|
|
--error 1292
|
execute stmt;
|
execute stmt;
|
|
|