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

Race condition upon changing log name: ASAN and other errors

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11
    • 10.4, 10.5, 10.6
    • Server, Variables
    • None

    Description

      The test case is for reproducing purposes only, don't put it into the regression suite! Create a deterministic one instead.

      The compound statements in the test case are irrelevant to the problem, they are there just to produce concurrency between two threads changing the log name.

      The main thread allows it to run 10 seconds before termination. It fails for me within a second (on ASAN builds) every time, so probably there is no much point increasing it if it doesn't fail for you.

      --connect (con1,localhost,root,,)
      --let $conid1= `select connection_id()`
      --delimiter $
      --send
      loop
        SET GLOBAL slow_query_log_file = 'slow.log';
      end loop $
       
      --connect (con2,localhost,root,,)
      --let $conid2= `select connection_id()`
      --send
      loop
        SET GLOBAL slow_query_log_file = DEFAULT;
      end loop $
      --delimiter ;
       
      --connection default
      --sleep 10
      --eval KILL $conid1
      --eval KILL $conid2
      

      10.3 f4a1298f ASAN

      ==4136841==ERROR: AddressSanitizer: heap-use-after-free on address 0x60300004e5e8 at pc 0x5624e0291792 bp 0x7f8136e13fa0 sp 0x7f8136e13f98
      READ of size 1 at 0x60300004e5e8 thread T7
          #0 0x5624e0291791 in MYSQL_LOG::generate_name(char const*, char const*, bool, char*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/log.cc:3137
          #1 0x5624dfc867f8 in MYSQL_QUERY_LOG::open_slow_log(char const*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/log.h:373
          #2 0x5624dfc6a4b6 in reopen_slow_log /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sys_vars.cc:4683
          #3 0x5624dfc6a342 in fix_log /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sys_vars.cc:4659
          #4 0x5624dfc6a570 in fix_slow_log_file /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sys_vars.cc:4687
          #5 0x5624df6066c6 in sys_var::update(THD*, set_var*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/set_var.cc:209
          #6 0x5624df607504 in sys_var::set_default(THD*, set_var*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/set_var.cc:295
          #7 0x5624df60aae2 in set_var::update(THD*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/set_var.cc:837
          #8 0x5624df60a230 in sql_set_variables(THD*, List<set_var_base>*, bool) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/set_var.cc:740
          #9 0x5624df87dcf7 in mysql_execute_command(THD*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:4934
          #10 0x5624df663ecd in sp_instr_stmt::exec_core(THD*, unsigned int*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:3708
          #11 0x5624df6626a8 in sp_lex_keeper::reset_lex_and_exec_core(THD*, unsigned int*, bool, sp_instr*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:3438
          #12 0x5624df663676 in sp_instr_stmt::execute(THD*, unsigned int*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:3614
          #13 0x5624df655400 in sp_head::execute(THD*, bool) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:1377
          #14 0x5624df65b267 in sp_head::execute_procedure(THD*, List<Item>*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:2404
          #15 0x5624df87019c in do_execute_sp /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:3019
          #16 0x5624df883727 in mysql_execute_command(THD*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:5693
          #17 0x5624df891e43 in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:7855
          #18 0x5624df869491 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:1852
          #19 0x5624df866049 in do_command(THD*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:1398
          #20 0x5624dfc29a85 in do_handle_one_connection(CONNECT*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_connect.cc:1404
          #21 0x5624dfc29381 in handle_one_connection /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_connect.cc:1309
          #22 0x5624e11d63f2 in pfs_spawn_thread /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/storage/perfschema/pfs.cc:1869
          #23 0x7f8141e25ea6 in start_thread nptl/pthread_create.c:477
          #24 0x7f8141d45aee in __clone (/lib/x86_64-linux-gnu/libc.so.6+0xfcaee)
       
      0x60300004e5e8 is located 8 bytes inside of 24-byte region [0x60300004e5e0,0x60300004e5f8)
      freed by thread T6 here:
          #0 0x7f814272bb6f in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:123
          #1 0x5624e12eb27a in my_free /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/mysys/my_malloc.c:223
          #2 0x5624dfc8982e in Sys_var_charptr_base::global_update_finish(char*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sys_vars.inl:546
          #3 0x5624dfc898fd in Sys_var_charptr_base::global_update(THD*, set_var*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sys_vars.inl:553
          #4 0x5624df60665b in sys_var::update(THD*, set_var*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/set_var.cc:208
          #5 0x5624df60aa9d in set_var::update(THD*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/set_var.cc:837
          #6 0x5624df60a230 in sql_set_variables(THD*, List<set_var_base>*, bool) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/set_var.cc:740
          #7 0x5624df87dcf7 in mysql_execute_command(THD*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:4934
          #8 0x5624df663ecd in sp_instr_stmt::exec_core(THD*, unsigned int*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:3708
          #9 0x5624df6626a8 in sp_lex_keeper::reset_lex_and_exec_core(THD*, unsigned int*, bool, sp_instr*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:3438
          #10 0x5624df663676 in sp_instr_stmt::execute(THD*, unsigned int*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:3614
          #11 0x5624df655400 in sp_head::execute(THD*, bool) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:1377
          #12 0x5624df65b267 in sp_head::execute_procedure(THD*, List<Item>*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:2404
          #13 0x5624df87019c in do_execute_sp /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:3019
          #14 0x5624df883727 in mysql_execute_command(THD*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:5693
          #15 0x5624df891e43 in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:7855
          #16 0x5624df869491 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:1852
          #17 0x5624df866049 in do_command(THD*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:1398
          #18 0x5624dfc29a85 in do_handle_one_connection(CONNECT*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_connect.cc:1404
          #19 0x5624dfc29381 in handle_one_connection /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_connect.cc:1309
          #20 0x5624e11d63f2 in pfs_spawn_thread /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/storage/perfschema/pfs.cc:1869
          #21 0x7f8141e25ea6 in start_thread nptl/pthread_create.c:477
       
      previously allocated by thread T7 here:
          #0 0x7f814272be8f in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
          #1 0x5624e12ea70e in my_malloc /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/mysys/my_malloc.c:101
          #2 0x5624e12eb5d2 in my_strdup /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/mysys/my_malloc.c:246
          #3 0x5624e027ff3c in make_default_log_name(char**, char const*, bool) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/log.cc:252
          #4 0x5624dfc6a2aa in fix_log /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sys_vars.cc:4652
          #5 0x5624dfc6a570 in fix_slow_log_file /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sys_vars.cc:4687
          #6 0x5624df6066c6 in sys_var::update(THD*, set_var*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/set_var.cc:209
          #7 0x5624df607504 in sys_var::set_default(THD*, set_var*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/set_var.cc:295
          #8 0x5624df60aae2 in set_var::update(THD*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/set_var.cc:837
          #9 0x5624df60a230 in sql_set_variables(THD*, List<set_var_base>*, bool) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/set_var.cc:740
          #10 0x5624df87dcf7 in mysql_execute_command(THD*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:4934
          #11 0x5624df663ecd in sp_instr_stmt::exec_core(THD*, unsigned int*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:3708
          #12 0x5624df6626a8 in sp_lex_keeper::reset_lex_and_exec_core(THD*, unsigned int*, bool, sp_instr*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:3438
          #13 0x5624df663676 in sp_instr_stmt::execute(THD*, unsigned int*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:3614
          #14 0x5624df655400 in sp_head::execute(THD*, bool) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:1377
          #15 0x5624df65b267 in sp_head::execute_procedure(THD*, List<Item>*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:2404
          #16 0x5624df87019c in do_execute_sp /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:3019
          #17 0x5624df883727 in mysql_execute_command(THD*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:5693
          #18 0x5624df891e43 in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:7855
          #19 0x5624df869491 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:1852
          #20 0x5624df866049 in do_command(THD*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:1398
          #21 0x5624dfc29a85 in do_handle_one_connection(CONNECT*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_connect.cc:1404
          #22 0x5624dfc29381 in handle_one_connection /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_connect.cc:1309
          #23 0x5624e11d63f2 in pfs_spawn_thread /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/storage/perfschema/pfs.cc:1869
          #24 0x7f8141e25ea6 in start_thread nptl/pthread_create.c:477
       
      Thread T7 created by T0 here:
          #0 0x7f81426d72a2 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:214
          #1 0x5624e11d67df in spawn_thread_v1 /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/storage/perfschema/pfs.cc:1919
          #2 0x5624df59de4c in inline_mysql_thread_create /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/include/mysql/psi/mysql_thread.h:1275
          #3 0x5624df5b6029 in create_thread_to_handle_connection(CONNECT*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/mysqld.cc:6677
          #4 0x5624df5b6789 in create_new_thread /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/mysqld.cc:6747
          #5 0x5624df5b78f3 in handle_connections_sockets() /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/mysqld.cc:7005
          #6 0x5624df5b53a9 in mysqld_main(int, char**) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/mysqld.cc:6299
          #7 0x5624df59c624 in main /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/main.cc:25
          #8 0x7f8141c6cd09 in __libc_start_main ../csu/libc-start.c:308
       
      Thread T6 created by T0 here:
          #0 0x7f81426d72a2 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:214
          #1 0x5624e11d67df in spawn_thread_v1 /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/storage/perfschema/pfs.cc:1919
          #2 0x5624df59de4c in inline_mysql_thread_create /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/include/mysql/psi/mysql_thread.h:1275
          #3 0x5624df5b6029 in create_thread_to_handle_connection(CONNECT*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/mysqld.cc:6677
          #4 0x5624df5b6789 in create_new_thread /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/mysqld.cc:6747
          #5 0x5624df5b78f3 in handle_connections_sockets() /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/mysqld.cc:7005
          #6 0x5624df5b53a9 in mysqld_main(int, char**) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/mysqld.cc:6299
          #7 0x5624df59c624 in main /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/main.cc:25
          #8 0x7f8141c6cd09 in __libc_start_main ../csu/libc-start.c:308
       
      SUMMARY: AddressSanitizer: heap-use-after-free /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/log.cc:3137 in MYSQL_LOG::generate_name(char const*, char const*, bool, char*)
      Shadow bytes around the buggy address:
        0x0c0680001c60: fa fa fd fd fd fa fa fa fd fd fd fa fa fa fd fd
        0x0c0680001c70: fd fd fa fa fd fd fd fa fa fa fd fd fd fa fa fa
        0x0c0680001c80: fd fd fd fd fa fa fd fd fd fa fa fa fd fd fd fa
        0x0c0680001c90: fa fa fd fd fd fd fa fa fd fd fd fa fa fa fd fd
        0x0c0680001ca0: fd fa fa fa fd fd fd fd fa fa fd fd fd fa fa fa
      =>0x0c0680001cb0: fd fd fd fa fa fa fd fd fd fd fa fa fd[fd]fd fa
        0x0c0680001cc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
        0x0c0680001cd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
        0x0c0680001ce0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
        0x0c0680001cf0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
        0x0c0680001d00: 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
        Shadow gap:              cc
      ==4136841==ABORTING
      

      Non-ASAN build doesn't crash, but produces an error instead:

      10.3 602124bb

      2022-11-21 14:23:16 5 [ERROR] Could not use  for logging (error 21). Turning logging off for the whole duration of the MariaDB server process. To turn it on again: fix the cause, shutdown the MariaDB server and restart it.
      

      The errors also happen with a general log instead of slow log.

      The general log variation:

      --connect (con1,localhost,root,,)
      --let $conid1= `select connection_id()`
      --delimiter $
      --send
      loop
        SET GLOBAL general_log_file = 'query.log';
      end loop $
       
      --connect (con2,localhost,root,,)
      --let $conid2= `select connection_id()`
      --send
      loop
        SET GLOBAL general_log_file = DEFAULT;
      end loop $
      --delimiter ;
       
      --connection default
      --sleep 10
      --eval KILL $conid1
      --eval KILL $conid2
      

      10.3 f4a1298f

      ==4137927==ERROR: AddressSanitizer: heap-use-after-free on address 0x60300004a838 at pc 0x560effff5792 bp 0x7f7fd6ecafa0 sp 0x7f7fd6ecaf98
      READ of size 1 at 0x60300004a838 thread T7
          #0 0x560effff5791 in MYSQL_LOG::generate_name(char const*, char const*, bool, char*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/log.cc:3137
          #1 0x560eff9ea9d8 in MYSQL_QUERY_LOG::open_query_log(char const*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/log.h:383
          #2 0x560eff9ce3bc in reopen_general_log /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sys_vars.cc:4667
          #3 0x560eff9ce342 in fix_log /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sys_vars.cc:4659
          #4 0x560eff9ce46b in fix_general_log_file /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sys_vars.cc:4671
          #5 0x560eff36a6c6 in sys_var::update(THD*, set_var*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/set_var.cc:209
          #6 0x560eff36b504 in sys_var::set_default(THD*, set_var*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/set_var.cc:295
          #7 0x560eff36eae2 in set_var::update(THD*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/set_var.cc:837
          #8 0x560eff36e230 in sql_set_variables(THD*, List<set_var_base>*, bool) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/set_var.cc:740
          #9 0x560eff5e1cf7 in mysql_execute_command(THD*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:4934
          #10 0x560eff3c7ecd in sp_instr_stmt::exec_core(THD*, unsigned int*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:3708
          #11 0x560eff3c66a8 in sp_lex_keeper::reset_lex_and_exec_core(THD*, unsigned int*, bool, sp_instr*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:3438
          #12 0x560eff3c7676 in sp_instr_stmt::execute(THD*, unsigned int*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:3614
          #13 0x560eff3b9400 in sp_head::execute(THD*, bool) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:1377
          #14 0x560eff3bf267 in sp_head::execute_procedure(THD*, List<Item>*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:2404
          #15 0x560eff5d419c in do_execute_sp /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:3019
          #16 0x560eff5e7727 in mysql_execute_command(THD*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:5693
          #17 0x560eff5f5e43 in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:7855
          #18 0x560eff5cd491 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:1852
          #19 0x560eff5ca049 in do_command(THD*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:1398
          #20 0x560eff98da85 in do_handle_one_connection(CONNECT*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_connect.cc:1404
          #21 0x560eff98d381 in handle_one_connection /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_connect.cc:1309
          #22 0x560f00f3a3f2 in pfs_spawn_thread /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/storage/perfschema/pfs.cc:1869
          #23 0x7f7fe1ed9ea6 in start_thread nptl/pthread_create.c:477
          #24 0x7f7fe1df9aee in __clone (/lib/x86_64-linux-gnu/libc.so.6+0xfcaee)
       
      0x60300004a838 is located 8 bytes inside of 24-byte region [0x60300004a830,0x60300004a848)
      freed by thread T6 here:
          #0 0x7f7fe27dfb6f in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:123
          #1 0x560f0104f27a in my_free /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/mysys/my_malloc.c:223
          #2 0x560eff9ed82e in Sys_var_charptr_base::global_update_finish(char*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sys_vars.inl:546
          #3 0x560eff9ed8fd in Sys_var_charptr_base::global_update(THD*, set_var*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sys_vars.inl:553
          #4 0x560eff36a65b in sys_var::update(THD*, set_var*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/set_var.cc:208
          #5 0x560eff36ea9d in set_var::update(THD*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/set_var.cc:837
          #6 0x560eff36e230 in sql_set_variables(THD*, List<set_var_base>*, bool) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/set_var.cc:740
          #7 0x560eff5e1cf7 in mysql_execute_command(THD*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:4934
          #8 0x560eff3c7ecd in sp_instr_stmt::exec_core(THD*, unsigned int*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:3708
          #9 0x560eff3c66a8 in sp_lex_keeper::reset_lex_and_exec_core(THD*, unsigned int*, bool, sp_instr*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:3438
          #10 0x560eff3c7676 in sp_instr_stmt::execute(THD*, unsigned int*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:3614
          #11 0x560eff3b9400 in sp_head::execute(THD*, bool) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:1377
          #12 0x560eff3bf267 in sp_head::execute_procedure(THD*, List<Item>*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:2404
          #13 0x560eff5d419c in do_execute_sp /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:3019
          #14 0x560eff5e7727 in mysql_execute_command(THD*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:5693
          #15 0x560eff5f5e43 in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:7855
          #16 0x560eff5cd491 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:1852
          #17 0x560eff5ca049 in do_command(THD*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:1398
          #18 0x560eff98da85 in do_handle_one_connection(CONNECT*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_connect.cc:1404
          #19 0x560eff98d381 in handle_one_connection /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_connect.cc:1309
          #20 0x560f00f3a3f2 in pfs_spawn_thread /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/storage/perfschema/pfs.cc:1869
          #21 0x7f7fe1ed9ea6 in start_thread nptl/pthread_create.c:477
       
      previously allocated by thread T7 here:
          #0 0x7f7fe27dfe8f in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
          #1 0x560f0104e70e in my_malloc /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/mysys/my_malloc.c:101
          #2 0x560f0104f5d2 in my_strdup /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/mysys/my_malloc.c:246
          #3 0x560efffe3f3c in make_default_log_name(char**, char const*, bool) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/log.cc:252
          #4 0x560eff9ce2aa in fix_log /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sys_vars.cc:4652
          #5 0x560eff9ce46b in fix_general_log_file /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sys_vars.cc:4671
          #6 0x560eff36a6c6 in sys_var::update(THD*, set_var*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/set_var.cc:209
          #7 0x560eff36b504 in sys_var::set_default(THD*, set_var*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/set_var.cc:295
          #8 0x560eff36eae2 in set_var::update(THD*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/set_var.cc:837
          #9 0x560eff36e230 in sql_set_variables(THD*, List<set_var_base>*, bool) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/set_var.cc:740
          #10 0x560eff5e1cf7 in mysql_execute_command(THD*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:4934
          #11 0x560eff3c7ecd in sp_instr_stmt::exec_core(THD*, unsigned int*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:3708
          #12 0x560eff3c66a8 in sp_lex_keeper::reset_lex_and_exec_core(THD*, unsigned int*, bool, sp_instr*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:3438
          #13 0x560eff3c7676 in sp_instr_stmt::execute(THD*, unsigned int*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:3614
          #14 0x560eff3b9400 in sp_head::execute(THD*, bool) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:1377
          #15 0x560eff3bf267 in sp_head::execute_procedure(THD*, List<Item>*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:2404
          #16 0x560eff5d419c in do_execute_sp /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:3019
          #17 0x560eff5e7727 in mysql_execute_command(THD*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:5693
          #18 0x560eff5f5e43 in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:7855
          #19 0x560eff5cd491 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:1852
          #20 0x560eff5ca049 in do_command(THD*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:1398
          #21 0x560eff98da85 in do_handle_one_connection(CONNECT*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_connect.cc:1404
          #22 0x560eff98d381 in handle_one_connection /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_connect.cc:1309
          #23 0x560f00f3a3f2 in pfs_spawn_thread /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/storage/perfschema/pfs.cc:1869
          #24 0x7f7fe1ed9ea6 in start_thread nptl/pthread_create.c:477
       
      Thread T7 created by T0 here:
          #0 0x7f7fe278b2a2 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:214
          #1 0x560f00f3a7df in spawn_thread_v1 /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/storage/perfschema/pfs.cc:1919
          #2 0x560eff301e4c in inline_mysql_thread_create /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/include/mysql/psi/mysql_thread.h:1275
          #3 0x560eff31a029 in create_thread_to_handle_connection(CONNECT*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/mysqld.cc:6677
          #4 0x560eff31a789 in create_new_thread /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/mysqld.cc:6747
          #5 0x560eff31b8f3 in handle_connections_sockets() /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/mysqld.cc:7005
          #6 0x560eff3193a9 in mysqld_main(int, char**) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/mysqld.cc:6299
          #7 0x560eff300624 in main /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/main.cc:25
          #8 0x7f7fe1d20d09 in __libc_start_main ../csu/libc-start.c:308
       
      Thread T6 created by T0 here:
          #0 0x7f7fe278b2a2 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:214
          #1 0x560f00f3a7df in spawn_thread_v1 /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/storage/perfschema/pfs.cc:1919
          #2 0x560eff301e4c in inline_mysql_thread_create /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/include/mysql/psi/mysql_thread.h:1275
          #3 0x560eff31a029 in create_thread_to_handle_connection(CONNECT*) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/mysqld.cc:6677
          #4 0x560eff31a789 in create_new_thread /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/mysqld.cc:6747
          #5 0x560eff31b8f3 in handle_connections_sockets() /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/mysqld.cc:7005
          #6 0x560eff3193a9 in mysqld_main(int, char**) /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/mysqld.cc:6299
          #7 0x560eff300624 in main /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/main.cc:25
          #8 0x7f7fe1d20d09 in __libc_start_main ../csu/libc-start.c:308
       
      SUMMARY: AddressSanitizer: heap-use-after-free /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/log.cc:3137 in MYSQL_LOG::generate_name(char const*, char const*, bool, char*)
      Shadow bytes around the buggy address:
        0x0c06800014b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
        0x0c06800014c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
        0x0c06800014d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
        0x0c06800014e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
        0x0c06800014f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
      =>0x0c0680001500: fd fd fd fd fa fa fd[fd]fd fa fa fa fa fa fa fa
        0x0c0680001510: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
        0x0c0680001520: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
        0x0c0680001530: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
        0x0c0680001540: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
        0x0c0680001550: 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
        Shadow gap:              cc
      ==4137927==ABORTING
      

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.