Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-19014

pure virtual method called, SIGSEGV, ASAN heap-use-after-free in Item_direct_view_ref::fix_fields

    Details

      Description

      CREATE TABLE t1 (a INT);
      CREATE TABLE t2 (b INT);
      INSERT INTO t2 VALUES (1),(2);
      CREATE TABLE t3 (c INT);
      CREATE VIEW v3 AS SELECT * FROM t3;
      CREATE OR REPLACE VIEW v33 AS SELECT * FROM v3;
      CREATE TRIGGER tr BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 SELECT * FROM v33;
       
      --error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
      INSERT INTO t1 SELECT * FROM t2;
      INSERT INTO t1 VALUES (1),(2);
      INSERT INTO t1 SELECT * FROM t1;
       
      # Cleanup
      DROP VIEW v33, v3;
      DROP TABLE t1, t2, t3;
      

      10.3 non-debug 117291db

      pure virtual method called
      terminate called without an active exception
      190321 18:04:54 [ERROR] mysqld got signal 6 ;
       
      #4  0x00007f8c09df13fa in abort () from /lib/x86_64-linux-gnu/libc.so.6
      #5  0x00007f8c0a7060ad in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
      #6  0x00007f8c0a704066 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
      #7  0x00007f8c0a7040b1 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
      #8  0x00007f8c0a704b8f in __cxa_pure_virtual () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
      #9  0x0000558ca6d97f0e in Item_ref::fix_fields (this=0x7f8bf00befc8, thd=0x7f8bf00009a8, reference=0x7f8bf00a93f8) at /data/src/10.3/sql/item.cc:8067
      #10 0x0000558ca6d98634 in fix_fields (it=0x7f8bf00a7f20, thd=0x7f8bf00009a8, this=0x7f8bf00befc8) at /data/src/10.3/sql/item.h:4986
      #11 Item_direct_view_ref::fix_fields (this=0x7f8bf00befc8, thd=0x7f8bf00009a8, reference=0x7f8bf00a7f20) at /data/src/10.3/sql/item.cc:8967
      #12 0x0000558ca6b515fe in fix_fields_if_needed (ref=<optimized out>, thd=0x7f8bf00009a8, this=0x7f8bf00befc8) at /data/src/10.3/sql/item.h:824
      #13 fix_fields_if_needed_for_scalar (ref=<optimized out>, thd=0x7f8bf00009a8, this=0x7f8bf00befc8) at /data/src/10.3/sql/item.h:828
      #14 setup_fields (thd=0x7f8bf00009a8, ref_pointer_array=..., fields=..., column_usage=<optimized out>, sum_func_list=0x7f8bf00adb10, pre_fix=0x7f8bf00a93f8, allow_sum_func=true) at /data/src/10.3/sql/sql_base.cc:7420
      #15 0x0000558ca6bebecf in JOIN::prepare (this=0x7f8bf00ad7f0, tables_init=0x7f8bfff66280, wild_num=0, conds_init=0xffffffffffffffff, og_num=0, order_init=0x7f8bfff66280, skip_order_by=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x7f8bf00a92b8, unit_arg=0x7f8bf00a8b48) at /data/src/10.3/sql/sql_select.cc:1102
      #16 0x0000558ca6bfc984 in mysql_select (thd=thd@entry=0x7f8bf00009a8, tables=0x7f8bf00a7f70, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=3489663744, result=0x7f8bf00ad740, unit=0x7f8bf00a8b48, select_lex=0x7f8bf00a92b8) at /data/src/10.3/sql/sql_select.cc:4217
      #17 0x0000558ca6bfcb77 in handle_select (thd=0x7f8bf00009a8, lex=0x7f8bf00a8a80, result=0x7f8bf00ad740, setup_tables_done_option=1073741824) at /data/src/10.3/sql/sql_select.cc:385
      #18 0x0000558ca6ba8874 in mysql_execute_command (thd=0x7f8bf00009a8) at /data/src/10.3/sql/sql_parse.cc:4836
      #19 0x0000558ca6b1a924 in sp_instr_stmt::exec_core (this=0x7f8bf00a85c8, thd=<optimized out>, nextp=0x7f8bfff68574) at /data/src/10.3/sql/sp_head.cc:3594
      #20 0x0000558ca6b21983 in sp_lex_keeper::reset_lex_and_exec_core (this=this@entry=0x7f8bf00a8610, thd=thd@entry=0x7f8bf00009a8, nextp=nextp@entry=0x7f8bfff68574, open_tables=open_tables@entry=false, instr=instr@entry=0x7f8bf00a85c8) at /data/src/10.3/sql/sp_head.cc:3322
      #21 0x0000558ca6b222d1 in sp_instr_stmt::execute (this=0x7f8bf00a85c8, thd=0x7f8bf00009a8, nextp=0x7f8bfff68574) at /data/src/10.3/sql/sp_head.cc:3500
      #22 0x0000558ca6b1de8b in sp_head::execute (this=this@entry=0x7f8bf00a6a50, thd=thd@entry=0x7f8bf00009a8, merge_da_on_success=merge_da_on_success@entry=false) at /data/src/10.3/sql/sp_head.cc:1354
      #23 0x0000558ca6b1e6b6 in sp_head::execute_trigger (this=0x7f8bf00a6a50, thd=thd@entry=0x7f8bf00009a8, db_name=<optimized out>, table_name=<optimized out>, grant_info=grant_info@entry=0x7f8bf00aab00) at /data/src/10.3/sql/sp_head.cc:1763
      #24 0x0000558ca6c385ec in Table_triggers_list::process_triggers (this=this@entry=0x7f8bf0073520, thd=thd@entry=0x7f8bf00009a8, event=event@entry=TRG_EVENT_INSERT, time_type=time_type@entry=TRG_ACTION_BEFORE, old_row_is_record1=old_row_is_record1@entry=true) at /data/src/10.3/sql/sql_trigger.cc:2212
      #25 0x0000558ca6b53b99 in fill_record_n_invoke_before_triggers (thd=thd@entry=0x7f8bf00009a8, table=table@entry=0x7f8bf00713f8, ptr=0x7f8bf0071fe8, values=..., ignore_errors=ignore_errors@entry=false, event=event@entry=TRG_EVENT_INSERT) at /data/src/10.3/sql/sql_base.cc:8623
      #26 0x0000558ca6b7db90 in mysql_insert (thd=0x7f8bf00009a8, table_list=<optimized out>, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=false) at /data/src/10.3/sql/sql_insert.cc:1006
      #27 0x0000558ca6ba79fb in mysql_execute_command (thd=0x7f8bf00009a8) at /data/src/10.3/sql/sql_parse.cc:4729
      #28 0x0000558ca6ba973b in mysql_parse (thd=0x7f8bf00009a8, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>, is_com_multi=<optimized out>, is_next_command=<optimized out>) at /data/src/10.3/sql/sql_parse.cc:8091
      #29 0x0000558ca6babe68 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f8bf00009a8, packet=packet@entry=0x7f8bf0009329 "INSERT INTO t1 VALUES (1),(2)", packet_length=packet_length@entry=29, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.3/sql/sql_parse.cc:1857
      #30 0x0000558ca6bac820 in do_command (thd=0x7f8bf00009a8) at /data/src/10.3/sql/sql_parse.cc:1403
      #31 0x0000558ca6c7f5c4 in do_handle_one_connection (connect=connect@entry=0x558ca8c2fec8) at /data/src/10.3/sql/sql_connect.cc:1402
      #32 0x0000558ca6c7f764 in handle_one_connection (arg=arg@entry=0x558ca8c2fec8) at /data/src/10.3/sql/sql_connect.cc:1308
      #33 0x0000558ca6f64574 in pfs_spawn_thread (arg=0x558ca8c30128) at /data/src/10.3/storage/perfschema/pfs.cc:1862
      #34 0x00007f8c0bcd7494 in start_thread (arg=0x7f8bfff6b700) at pthread_create.c:333
      #35 0x00007f8c09ea593f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      10.3 debug 117291db

      #3  <signal handler called>
      #4  0x000055c17f818953 in Item_direct_view_ref::fix_fields (this=0x7fe038063450, thd=0x7fe038000b00, reference=0x7fe038039d28) at /data/src/10.3/sql/item.cc:8950
      #5  0x000055c17f3f36e2 in Item::fix_fields_if_needed (this=0x7fe038063450, thd=0x7fe038000b00, ref=0x7fe038039d28) at /data/src/10.3/sql/item.h:824
      #6  0x000055c17f3f370f in Item::fix_fields_if_needed_for_scalar (this=0x7fe038063450, thd=0x7fe038000b00, ref=0x7fe038039d28) at /data/src/10.3/sql/item.h:828
      #7  0x000055c17f467ba2 in setup_fields (thd=0x7fe038000b00, ref_pointer_array=..., fields=..., column_usage=MARK_COLUMNS_READ, sum_func_list=0x7fe038065b48, pre_fix=0x7fe03803b270, allow_sum_func=true) at /data/src/10.3/sql/sql_base.cc:7420
      #8  0x000055c17f52ea59 in JOIN::prepare (this=0x7fe038065828, tables_init=0x7fe038039d78, wild_num=0, conds_init=0x0, og_num=0, order_init=0x0, skip_order_by=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x7fe03803b130, unit_arg=0x7fe03803a9c0) at /data/src/10.3/sql/sql_select.cc:1102
      #9  0x000055c17f539d57 in mysql_select (thd=0x7fe038000b00, tables=0x7fe038039d78, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=3489663744, result=0x7fe038065778, unit=0x7fe03803a9c0, select_lex=0x7fe03803b130) at /data/src/10.3/sql/sql_select.cc:4217
      #10 0x000055c17f52bd36 in handle_select (thd=0x7fe038000b00, lex=0x7fe03803a8f8, result=0x7fe038065778, setup_tables_done_option=1073741824) at /data/src/10.3/sql/sql_select.cc:385
      #11 0x000055c17f4f0104 in mysql_execute_command (thd=0x7fe038000b00) at /data/src/10.3/sql/sql_parse.cc:4836
      #12 0x000055c17f418292 in sp_instr_stmt::exec_core (this=0x7fe03803a3d0, thd=0x7fe038000b00, nextp=0x7fe04a10bb74) at /data/src/10.3/sql/sp_head.cc:3594
      #13 0x000055c17f4176ef in sp_lex_keeper::reset_lex_and_exec_core (this=0x7fe03803a418, thd=0x7fe038000b00, nextp=0x7fe04a10bb74, open_tables=false, instr=0x7fe03803a3d0) at /data/src/10.3/sql/sp_head.cc:3322
      #14 0x000055c17f417e74 in sp_instr_stmt::execute (this=0x7fe03803a3d0, thd=0x7fe038000b00, nextp=0x7fe04a10bb74) at /data/src/10.3/sql/sp_head.cc:3500
      #15 0x000055c17f411bef in sp_head::execute (this=0x7fe038038858, thd=0x7fe038000b00, merge_da_on_success=false) at /data/src/10.3/sql/sp_head.cc:1354
      #16 0x000055c17f412d71 in sp_head::execute_trigger (this=0x7fe038038858, thd=0x7fe038000b00, db_name=0x7fe038176778, table_name=0x7fe038176788, grant_info=0x7fe03803c9e8) at /data/src/10.3/sql/sp_head.cc:1763
      #17 0x000055c17f5d94ca in Table_triggers_list::process_triggers (this=0x7fe03803fb38, thd=0x7fe038000b00, event=TRG_EVENT_INSERT, time_type=TRG_ACTION_BEFORE, old_row_is_record1=true) at /data/src/10.3/sql/sql_trigger.cc:2212
      #18 0x000055c17f46b0e6 in fill_record_n_invoke_before_triggers (thd=0x7fe038000b00, table=0x7fe038043150, ptr=0x7fe038172e30, values=..., ignore_errors=false, event=TRG_EVENT_INSERT) at /data/src/10.3/sql/sql_base.cc:8623
      #19 0x000055c17f4adc34 in mysql_insert (thd=0x7fe038000b00, table_list=0x7fe038014dd0, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=false) at /data/src/10.3/sql/sql_insert.cc:1006
      #20 0x000055c17f4ef996 in mysql_execute_command (thd=0x7fe038000b00) at /data/src/10.3/sql/sql_parse.cc:4729
      #21 0x000055c17f4fa6bc in mysql_parse (thd=0x7fe038000b00, rawbuf=0x7fe038014ce8 "INSERT INTO t1 VALUES (1),(2)", length=29, parser_state=0x7fe04a10d5f0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:8091
      #22 0x000055c17f4e7970 in dispatch_command (command=COM_QUERY, thd=0x7fe038000b00, packet=0x7fe03800b1f1 "INSERT INTO t1 VALUES (1),(2)", packet_length=29, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1857
      #23 0x000055c17f4e635a in do_command (thd=0x7fe038000b00) at /data/src/10.3/sql/sql_parse.cc:1403
      #24 0x000055c17f64ee51 in do_handle_one_connection (connect=0x55c18321b470) at /data/src/10.3/sql/sql_connect.cc:1402
      #25 0x000055c17f64ebd5 in handle_one_connection (arg=0x55c18321b470) at /data/src/10.3/sql/sql_connect.cc:1308
      #26 0x000055c17faeb597 in pfs_spawn_thread (arg=0x55c1831601d0) at /data/src/10.3/storage/perfschema/pfs.cc:1862
      #27 0x00007fe051e55494 in start_thread (arg=0x7fe04a10e700) at pthread_create.c:333
      #28 0x00007fe05002393f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      10.3 ASAN 117291db

      ==4425==ERROR: AddressSanitizer: heap-use-after-free on address 0x6250000fffd3 at pc 0x56366e890597 bp 0x7fe54d41adb0 sp 0x7fe54d41ada8
      READ of size 1 at 0x6250000fffd3 thread T5
          #0 0x56366e890596 in Item_direct_view_ref::fix_fields(THD*, Item**) /data/src/10.3/sql/item.cc:8948
          #1 0x56366debc188 in Item::fix_fields_if_needed(THD*, Item**) /data/src/10.3/sql/item.h:824
          #2 0x56366debc1b6 in Item::fix_fields_if_needed_for_scalar(THD*, Item**) (/data/bld/10.3-asan/bin/mysqld+0xc1c1b6)
          #3 0x56366dfb94f5 in setup_fields(THD*, Bounds_checked_array<Item*>, List<Item>&, enum_column_usage, List<Item>*, List<Item>*, bool) /data/src/10.3/sql/sql_base.cc:7420
          #4 0x56366e18ade2 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*) /data/src/10.3/sql/sql_select.cc:1102
          #5 0x56366e1a9689 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*) /data/src/10.3/sql/sql_select.cc:4217
          #6 0x56366e1843c0 in handle_select(THD*, LEX*, select_result*, unsigned long) /data/src/10.3/sql/sql_select.cc:385
          #7 0x56366e0fb1c3 in mysql_execute_command(THD*) /data/src/10.3/sql/sql_parse.cc:4836
          #8 0x56366df06be9 in sp_instr_stmt::exec_core(THD*, unsigned int*) /data/src/10.3/sql/sp_head.cc:3594
          #9 0x56366df054dd in sp_lex_keeper::reset_lex_and_exec_core(THD*, unsigned int*, bool, sp_instr*) /data/src/10.3/sql/sp_head.cc:3322
          #10 0x56366df063b8 in sp_instr_stmt::execute(THD*, unsigned int*) /data/src/10.3/sql/sp_head.cc:3500
          #11 0x56366def964d in sp_head::execute(THD*, bool) /data/src/10.3/sql/sp_head.cc:1354
          #12 0x56366defbcc8 in sp_head::execute_trigger(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, st_grant_info*) /data/src/10.3/sql/sp_head.cc:1763
          #13 0x56366e33b15b in Table_triggers_list::process_triggers(THD*, trg_event_type, trg_action_time_type, bool) /data/src/10.3/sql/sql_trigger.cc:2212
          #14 0x56366dfc12fc in fill_record_n_invoke_before_triggers(THD*, TABLE*, Field**, List<Item>&, bool, trg_event_type) /data/src/10.3/sql/sql_base.cc:8623
          #15 0x56366e05f2a7 in mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool) /data/src/10.3/sql/sql_insert.cc:1006
          #16 0x56366e0fa2d9 in mysql_execute_command(THD*) /data/src/10.3/sql/sql_parse.cc:4729
          #17 0x56366e110104 in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /data/src/10.3/sql/sql_parse.cc:8091
          #18 0x56366e0ea1e1 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /data/src/10.3/sql/sql_parse.cc:1857
          #19 0x56366e0e7243 in do_command(THD*) /data/src/10.3/sql/sql_parse.cc:1403
          #20 0x56366e45ad9f in do_handle_one_connection(CONNECT*) /data/src/10.3/sql/sql_connect.cc:1402
          #21 0x56366e45a7ab in handle_one_connection /data/src/10.3/sql/sql_connect.cc:1308
          #22 0x56366ef90f29 in pfs_spawn_thread /data/src/10.3/storage/perfschema/pfs.cc:1862
          #23 0x7fe559c3a493 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x7493)
          #24 0x7fe557e0893e in __clone (/lib/x86_64-linux-gnu/libc.so.6+0xe893e)
       
      0x6250000fffd3 is located 3795 bytes inside of 8268-byte region [0x6250000ff100,0x62500010114c)
      freed by thread T5 here:
          #0 0x7fe559ea4527 in __interceptor_free (/usr/lib/x86_64-linux-gnu/libasan.so.1+0x54527)
          #1 0x56366f940e45 in free_memory /data/src/10.3/mysys/safemalloc.c:279
          #2 0x56366f94044b in sf_free /data/src/10.3/mysys/safemalloc.c:197
          #3 0x56366f910e94 in my_free /data/src/10.3/mysys/my_malloc.c:223
          #4 0x56366f8f0e8f in free_root /data/src/10.3/mysys/my_alloc.c:419
          #5 0x56366def97eb in sp_head::execute(THD*, bool) /data/src/10.3/sql/sp_head.cc:1373
          #6 0x56366defbcc8 in sp_head::execute_trigger(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, st_grant_info*) /data/src/10.3/sql/sp_head.cc:1763
          #7 0x56366e33b15b in Table_triggers_list::process_triggers(THD*, trg_event_type, trg_action_time_type, bool) /data/src/10.3/sql/sql_trigger.cc:2212
          #8 0x56366dfc12fc in fill_record_n_invoke_before_triggers(THD*, TABLE*, Field**, List<Item>&, bool, trg_event_type) /data/src/10.3/sql/sql_base.cc:8623
          #9 0x56366e05f2a7 in mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool) /data/src/10.3/sql/sql_insert.cc:1006
          #10 0x56366e0fa2d9 in mysql_execute_command(THD*) /data/src/10.3/sql/sql_parse.cc:4729
          #11 0x56366e110104 in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /data/src/10.3/sql/sql_parse.cc:8091
          #12 0x56366e0ea1e1 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /data/src/10.3/sql/sql_parse.cc:1857
          #13 0x56366e0e7243 in do_command(THD*) /data/src/10.3/sql/sql_parse.cc:1403
          #14 0x56366e45ad9f in do_handle_one_connection(CONNECT*) /data/src/10.3/sql/sql_connect.cc:1402
          #15 0x56366e45a7ab in handle_one_connection /data/src/10.3/sql/sql_connect.cc:1308
          #16 0x56366ef90f29 in pfs_spawn_thread /data/src/10.3/storage/perfschema/pfs.cc:1862
          #17 0x7fe559c3a493 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x7493)
       
      previously allocated by thread T5 here:
          #0 0x7fe559ea473f in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.1+0x5473f)
          #1 0x56366f93fbbb in sf_malloc /data/src/10.3/mysys/safemalloc.c:118
          #2 0x56366f9104b6 in my_malloc /data/src/10.3/mysys/my_malloc.c:101
          #3 0x56366f8efd62 in alloc_root /data/src/10.3/mysys/my_alloc.c:250
          #4 0x56366e11e52f in Query_arena::memdup_w_gap(void const*, unsigned long, unsigned long) /data/src/10.3/sql/sql_class.h:1034
          #5 0x56366e0eea66 in alloc_query(THD*, char const*, unsigned long) /data/src/10.3/sql/sql_parse.cc:2728
          #6 0x56366df06295 in sp_instr_stmt::execute(THD*, unsigned int*) /data/src/10.3/sql/sp_head.cc:3487
          #7 0x56366def964d in sp_head::execute(THD*, bool) /data/src/10.3/sql/sp_head.cc:1354
          #8 0x56366defbcc8 in sp_head::execute_trigger(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, st_grant_info*) /data/src/10.3/sql/sp_head.cc:1763
          #9 0x56366e33b15b in Table_triggers_list::process_triggers(THD*, trg_event_type, trg_action_time_type, bool) /data/src/10.3/sql/sql_trigger.cc:2212
          #10 0x56366dfc12fc in fill_record_n_invoke_before_triggers(THD*, TABLE*, Field**, List<Item>&, bool, trg_event_type) /data/src/10.3/sql/sql_base.cc:8623
          #11 0x56366e05f2a7 in mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool) /data/src/10.3/sql/sql_insert.cc:1006
          #12 0x56366e0fa2d9 in mysql_execute_command(THD*) /data/src/10.3/sql/sql_parse.cc:4729
          #13 0x56366e110104 in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /data/src/10.3/sql/sql_parse.cc:8091
          #14 0x56366e0ea1e1 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /data/src/10.3/sql/sql_parse.cc:1857
          #15 0x56366e0e7243 in do_command(THD*) /data/src/10.3/sql/sql_parse.cc:1403
          #16 0x56366e45ad9f in do_handle_one_connection(CONNECT*) /data/src/10.3/sql/sql_connect.cc:1402
          #17 0x56366e45a7ab in handle_one_connection /data/src/10.3/sql/sql_connect.cc:1308
          #18 0x56366ef90f29 in pfs_spawn_thread /data/src/10.3/storage/perfschema/pfs.cc:1862
          #19 0x7fe559c3a493 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x7493)
       
      Thread T5 created by T0 here:
          #0 0x7fe559e73bba in pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.1+0x23bba)
          #1 0x56366ef914f1 in spawn_thread_v1 /data/src/10.3/storage/perfschema/pfs.cc:1912
          #2 0x56366de52a18 in inline_mysql_thread_create /data/src/10.3/include/mysql/psi/mysql_thread.h:1268
          #3 0x56366de683ae in create_thread_to_handle_connection(CONNECT*) /data/src/10.3/sql/mysqld.cc:6589
          #4 0x56366de68ab3 in create_new_thread /data/src/10.3/sql/mysqld.cc:6659
          #5 0x56366de69aca in handle_connections_sockets() /data/src/10.3/sql/mysqld.cc:6934
          #6 0x56366de6786b in mysqld_main(int, char**) /data/src/10.3/sql/mysqld.cc:6211
          #7 0x56366de50a9f in main /data/src/10.3/sql/main.cc:25
          #8 0x7fe557d402b0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b0)
       
      SUMMARY: AddressSanitizer: heap-use-after-free /data/src/10.3/sql/item.cc:8948 Item_direct_view_ref::fix_fields(THD*, Item**)
      Shadow bytes around the buggy address:
        0x0c4a80017fa0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
        0x0c4a80017fb0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
        0x0c4a80017fc0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
        0x0c4a80017fd0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
        0x0c4a80017fe0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
      =>0x0c4a80017ff0: fd fd fd fd fd fd fd fd fd fd[fd]fd fd fd fd fd
        0x0c4a80018000: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
        0x0c4a80018010: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
        0x0c4a80018020: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
        0x0c4a80018030: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
        0x0c4a80018040: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
      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
        Heap right redzone:      fb
        Freed heap region:       fd
        Stack left redzone:      f1
        Stack mid redzone:       f2
        Stack right redzone:     f3
        Stack partial redzone:   f4
        Stack after return:      f5
        Stack use after scope:   f8
        Global redzone:          f9
        Global init order:       f6
        Poisoned by user:        f7
        Contiguous container OOB:fc
        ASan internal:           fe
      ==4425==ABORTING
      

      Reproducible with at least InnoDB and MyISAM.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sanja Oleksandr Byelkin
                Reporter:
                elenst Elena Stepanova
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: