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

SEQUENCE related crash when running concurrent I_S.TABLES and FLUSH queries

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.3(EOL)
    • 10.3.1
    • Sequences
    • None
    • Linux, 10.3 branch as of today (2017-07-27, commit e67b816451cb1003fc42755e40327411fd8b7a35 )

    Description

      With at least one SEQUENCE defined in the database a combination of:

      • two tasks concurrently running "SELECT * FROM I_S.TABLES" in a loop
      • one task running "FLUSH TABLES" in a loop

      the server process quickly crashes with the following backtrace:

      /usr/local/mariadb-git-10.3/bin/mysqld(my_print_stacktrace+0x29)[0x55b9694ad369]
      /usr/local/mariadb-git-10.3/bin/mysqld(handle_fatal_signal+0x305)[0x55b968fa5615]
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7f3489576390]
      /lib/x86_64-linux-gnu/libpthread.so.0(pthread_rwlock_unlock+0x2c)[0x7f3489571edc]
      /usr/local/mariadb-git-10.3/bin/mysqld(_ZN8SEQUENCE19read_initial_valuesEP5TABLE+0x1d6)[0x55b968f19f16]
      /usr/local/mariadb-git-10.3/bin/mysqld(+0xb8bb93)[0x55b96948fb93]
      /usr/local/mariadb-git-10.3/bin/mysqld(_ZN7handler7ha_openEP5TABLEPKcij+0x2a)[0x55b968fa971a]
      /usr/local/mariadb-git-10.3/bin/mysqld(_Z21open_table_from_shareP3THDP11TABLE_SHAREPKcjjjP5TABLEb+0x652)[0x55b968e99f32]
      /usr/local/mariadb-git-10.3/bin/mysqld(_Z10open_tableP3THDP10TABLE_LISTP18Open_table_context+0x8e4)[0x55b968db0e14]
      /usr/local/mariadb-git-10.3/bin/mysqld(_Z11open_tablesP3THDRK14DDL_options_stPP10TABLE_LISTPjjP19Prelocking_strategy+0xa03)[0x55b968db36d3]
      /usr/local/mariadb-git-10.3/bin/mysqld(_Z30open_normal_and_derived_tablesP3THDP10TABLE_LISTjj+0x5a)[0x55b968db3f4a]
      /usr/local/mariadb-git-10.3/bin/mysqld(_Z31open_tables_only_view_structureP3THDP10TABLE_LISTb+0x4e)[0x55b968db3fde]
      /usr/local/mariadb-git-10.3/bin/mysqld(+0x54964a)[0x55b968e4d64a]
      /usr/local/mariadb-git-10.3/bin/mysqld(_Z14get_all_tablesP3THDP10TABLE_LISTP4Item+0x7f4)[0x55b968e5e904]
      /usr/local/mariadb-git-10.3/bin/mysqld(_Z24get_schema_tables_resultP4JOIN23enum_schema_table_state+0x27f)[0x55b968e5fecf]
      /usr/local/mariadb-git-10.3/bin/mysqld(_ZN4JOIN10exec_innerEv+0x596)[0x55b968e48726]
      /usr/local/mariadb-git-10.3/bin/mysqld(_ZN4JOIN4execEv+0x29)[0x55b968e48e49]
      /usr/local/mariadb-git-10.3/bin/mysqld(_Z12mysql_selectP3THDP10TABLE_LISTjR4ListI4ItemEPS4_jP8st_orderS9_S7_S9_yP13select_resultP18st_select_lex_unitP13st_select_lex+0xee)[0x55b968e48f8e]
      /usr/local/mariadb-git-10.3/bin/mysqld(_Z13handle_selectP3THDP3LEXP13select_resultm+0x128)[0x55b968e498d8]
      /usr/local/mariadb-git-10.3/bin/mysqld(+0x4ed6f6)[0x55b968df16f6]
      /usr/local/mariadb-git-10.3/bin/mysqld(_Z21mysql_execute_commandP3THD+0x5d26)[0x55b968dfd856]
      /usr/local/mariadb-git-10.3/bin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_statebb+0x27d)[0x55b968e0048d]
      /usr/local/mariadb-git-10.3/bin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcjbb+0x1e3e)[0x55b968e02f9e]
      /usr/local/mariadb-git-10.3/bin/mysqld(_Z10do_commandP3THD+0x151)[0x55b968e037d1]
      /usr/local/mariadb-git-10.3/bin/mysqld(_Z24do_handle_one_connectionP7CONNECT+0x234)[0x55b968ebe554]
      /usr/local/mariadb-git-10.3/bin/mysqld(handle_one_connection+0x34)[0x55b968ebe6c4]
      

      The minimal script I used to reproduce this crash is:

      #! /bin/bash
       
      OPT="-u root"
       
      mysql $OPT test -e "CREATE SEQUENCE s1;"
       
      (while mysql $OPT test -e "SELECT * FROM information_schema.TABLES;" >/dev/null; do echo -n .; done) &
      (while mysql $OPT test -e "SELECT * FROM information_schema.TABLES;" >/dev/null; do echo -n .; done) &
      (while mysql $OPT test -e "FLUSH TABLES;" >/dev/null; do echo -n .; done) &
      

      With all three parallel while loops it crashes within a second, removing any of them I didn't see any crashes even when running things for several minutes.

      This only happens with 10.3 built from current git source, and some customer specific custom builds, but I could not crash the 10.3.0 release. So it looks like something introduced between 10.3.0 and now, which should be easy to track down with "git bisect"

      Attachments

        Issue Links

          Activity

            hholzgra Hartmut Holzgraefe added a comment - - edited

            Introduced by:

            commit 7e5bd1500f7149ed67b0593e021d3695a8f9d81a
            Author: Monty <monty@mariadb.org>
            Date:   Mon May 29 16:08:11 2017 +0300
             
                Add locks for sequence's to ensure that there is only one writer or many readers
            

            https://github.com/MariaDB/server/commit/7e5bd1500f7149ed67b0593e021d3695a8f9d81a

            hholzgra Hartmut Holzgraefe added a comment - - edited Introduced by: commit 7e5bd1500f7149ed67b0593e021d3695a8f9d81a Author: Monty <monty@mariadb.org> Date: Mon May 29 16:08:11 2017 +0300   Add locks for sequence's to ensure that there is only one writer or many readers https://github.com/MariaDB/server/commit/7e5bd1500f7149ed67b0593e021d3695a8f9d81a
            hholzgra Hartmut Holzgraefe added a comment - - edited

            Attached thread apply all bt output as {{gdb.txt}]

            hholzgra Hartmut Holzgraefe added a comment - - edited Attached thread apply all bt output as {{gdb.txt}]

            10.3 c431eafd62bae41dd89a6b71e4554facbad1040b debug

            mysqld: /data/src/10.3/sql/handler.cc:5920: int handler::ha_reset(): Assertion `(uchar*) table->def_read_set.bitmap + table->s->column_bitmap_size == (uchar*) table->def_write_set.bitmap' failed.
            170801  0:49:41 [ERROR] mysqld got signal 6 ;
             
            #3  0x00007f4a95997ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
            #4  0x000055c93c35d0de in handler::ha_reset (this=0x7f4a1c0323a8) at /data/src/10.3/sql/handler.cc:5918
            #5  0x000055c93c020806 in close_thread_table (thd=0x7f4a1c000b00, table_ptr=0x7f4a1c000bc0) at /data/src/10.3/sql/sql_base.cc:891
            #6  0x000055c93c020584 in close_thread_tables (thd=0x7f4a1c000b00) at /data/src/10.3/sql/sql_base.cc:848
            #7  0x000055c93c13807d in fill_schema_table_by_open (thd=0x7f4a1c000b00, is_show_fields_or_keys=false, table=0x7f4a1c0348f8, schema_table=0x55c93d4d70c0 <schema_tables+1920>, orig_db_name=0x7f4a1c0bbd30, orig_table_name=0x7f4a1c424698, open_tables_state_backup=0x7f4a8017d020, can_deadlock=false) at /data/src/10.3/sql/sql_show.cc:4417
            #8  0x000055c93c1396f5 in get_all_tables (thd=0x7f4a1c000b00, tables=0x7f4a1c01b610, cond=0x0) at /data/src/10.3/sql/sql_show.cc:5000
            #9  0x000055c93c149436 in get_schema_tables_result (join=0x7f4a1c057a60, executed_place=PROCESSED_BY_JOIN_EXEC) at /data/src/10.3/sql/sql_show.cc:8351
            #10 0x000055c93c0e71e7 in JOIN::exec_inner (this=0x7f4a1c057a60) at /data/src/10.3/sql/sql_select.cc:3454
            #11 0x000055c93c0e68a0 in JOIN::exec (this=0x7f4a1c057a60) at /data/src/10.3/sql/sql_select.cc:3285
            #12 0x000055c93c0e7a6b in mysql_select (thd=0x7f4a1c000b00, tables=0x7f4a1c01b610, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2684620544, result=0x7f4a1c057a40, unit=0x7f4a1c01d250, select_lex=0x7f4a1c01d990) at /data/src/10.3/sql/sql_select.cc:3685
            #13 0x000055c93c0dc390 in handle_select (thd=0x7f4a1c000b00, lex=0x7f4a1c01d188, result=0x7f4a1c057a40, setup_tables_done_option=0) at /data/src/10.3/sql/sql_select.cc:373
            #14 0x000055c93c0a8581 in execute_sqlcom_select (thd=0x7f4a1c000b00, all_tables=0x7f4a1c01b610) at /data/src/10.3/sql/sql_parse.cc:6438
            #15 0x000055c93c09ecf2 in mysql_execute_command (thd=0x7f4a1c000b00) at /data/src/10.3/sql/sql_parse.cc:3639
            #16 0x000055c93c4cd52c in sp_instr_stmt::exec_core (this=0x7f4a1c01bc30, thd=0x7f4a1c000b00, nextp=0x7f4a8017f2a4) at /data/src/10.3/sql/sp_head.cc:3302
            #17 0x000055c93c4ccaf7 in sp_lex_keeper::reset_lex_and_exec_core (this=0x7f4a1c01bc78, thd=0x7f4a1c000b00, nextp=0x7f4a8017f2a4, open_tables=false, instr=0x7f4a1c01bc30) at /data/src/10.3/sql/sp_head.cc:3046
            #18 0x000055c93c4cd1d7 in sp_instr_stmt::execute (this=0x7f4a1c01bc30, thd=0x7f4a1c000b00, nextp=0x7f4a8017f2a4) at /data/src/10.3/sql/sp_head.cc:3218
            #19 0x000055c93c4c782a in sp_head::execute (this=0x7f4a1c01a5e8, thd=0x7f4a1c000b00, merge_da_on_success=true) at /data/src/10.3/sql/sp_head.cc:1202
            #20 0x000055c93c4c9ae2 in sp_head::execute_procedure (this=0x7f4a1c01a5e8, thd=0x7f4a1c000b00, args=0x7f4a1c0053b0) at /data/src/10.3/sql/sp_head.cc:2030
            #21 0x000055c93c09cc52 in do_execute_sp (thd=0x7f4a1c000b00, sp=0x7f4a1c01a5e8) at /data/src/10.3/sql/sql_parse.cc:2901
            #22 0x000055c93c0a5c7f in mysql_execute_command (thd=0x7f4a1c000b00) at /data/src/10.3/sql/sql_parse.cc:5806
            #23 0x000055c93c0abfbe in mysql_parse (thd=0x7f4a1c000b00, rawbuf=0x7f4a1c0134a8 "call pr1()", length=10, parser_state=0x7f4a80181250, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7893
            #24 0x000055c93c099ee0 in dispatch_command (command=COM_QUERY, thd=0x7f4a1c000b00, packet=0x7f4a1c00ace1 "amic\001\062\001\060\001\060\001\060\001\060\001\060\373\373\373\373\017utf8_general_c", <incomplete sequence \373>, packet_length=10, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1822
            #25 0x000055c93c09885a in do_command (thd=0x7f4a1c000b00) at /data/src/10.3/sql/sql_parse.cc:1380
            #26 0x000055c93c1e747c in do_handle_one_connection (connect=0x55c93f8c1100) at /data/src/10.3/sql/sql_connect.cc:1354
            #27 0x000055c93c1e7209 in handle_one_connection (arg=0x55c93f8c1100) at /data/src/10.3/sql/sql_connect.cc:1260
            #28 0x00007f4a978dc494 in start_thread (arg=0x7f4a80182700) at pthread_create.c:333
            #29 0x00007f4a95a5493f in clone () from /lib/x86_64-linux-gnu/libc.so.6
            

            Stack trace from the attachment

            #3  <signal handler called>
            #4  0x00007f2b7dcb5edc in _xend () at pthread_rwlock_unlock.c:38
            #5  __GI___pthread_rwlock_unlock (rwlock=rwlock@entry=0x7f2b001b58e8) at pthread_rwlock_unlock.c:38
            #6  0x000055c2be607285 in inline_mysql_rwlock_unlock (that=<optimized out>) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/include/mysql/psi/mysql_thread.h:1055
            #7  SEQUENCE::write_unlock (this=this@entry=0x7f2b001b5880, table=<optimized out>) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_sequence.cc:373
            #8  0x000055c2be607816 in SEQUENCE::read_initial_values (this=0x7f2b001b5880, table_arg=<optimized out>)
                at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_sequence.cc:457
            #9  0x000055c2beb7ceb3 in ha_sequence::open (this=0x7f2b084bb620, name=<optimized out>, mode=<optimized out>, flags=<optimized out>)
                at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/ha_sequence.cc:110
            #10 0x000055c2be69752a in handler::ha_open (this=0x7f2b084bb620, table_arg=table_arg@entry=0x7f2b084ba308, name=0x7f2b001b5830 "./test/s1", mode=mode@entry=2, 
                test_if_locked=test_if_locked@entry=18) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/handler.cc:2516
            #11 0x000055c2be5899a2 in open_table_from_share (thd=thd@entry=0x7f2b080009a8, share=share@entry=0x7f2b001b5420, alias=<optimized out>, db_stat=db_stat@entry=33, 
                prgflag=prgflag@entry=8, ha_open_flags=18, outparam=<optimized out>, is_create_table=<optimized out>)
                at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/table.cc:3310
            #12 0x000055c2be4a1645 in open_table (thd=thd@entry=0x7f2b080009a8, table_list=table_list@entry=0x7f2b084765e0, ot_ctx=ot_ctx@entry=0x7f2b74227f30)
                at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_base.cc:1877
            #13 0x000055c2be4a3f03 in open_and_process_table (ot_ctx=0x7f2b74227f30, has_prelocking_list=false, prelocking_strategy=0x7f2b74227fd0, flags=1090, counter=0x7f2b74227fcc, 
                tables=0x7f2b084765e0, lex=0x7f2b74228130, thd=0x7f2b080009a8) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_base.cc:3414
            #14 open_tables (thd=thd@entry=0x7f2b080009a8, options=..., start=start@entry=0x7f2b74227fb8, counter=counter@entry=0x7f2b74227fcc, flags=1090, 
                prelocking_strategy=prelocking_strategy@entry=0x7f2b74227fd0) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_base.cc:3934
            #15 0x000055c2be4a477a in open_tables (prelocking_strategy=0x7f2b74227fd0, flags=<optimized out>, counter=0x7f2b74227fcc, tables=0x7f2b74227fb8, thd=0x7f2b080009a8)
                at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_base.h:236
            #16 open_normal_and_derived_tables (thd=thd@entry=0x7f2b080009a8, tables=tables@entry=0x7f2b084765e0, flags=<optimized out>, dt_phases=dt_phases@entry=34)
                at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_base.cc:4752
            #17 0x000055c2be4a480e in open_tables_only_view_structure (thd=thd@entry=0x7f2b080009a8, table_list=table_list@entry=0x7f2b084765e0, can_deadlock=can_deadlock@entry=false)
                at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_base.cc:4803
            #18 0x000055c2be53d22a in fill_schema_table_by_open (thd=thd@entry=0x7f2b080009a8, is_show_fields_or_keys=is_show_fields_or_keys@entry=false, table=table@entry=0x7f2b0801f6a0, 
                schema_table=schema_table@entry=0x55c2bf3fab80 <schema_tables+1920>, orig_db_name=orig_db_name@entry=0x7f2b080150e8, orig_table_name=orig_table_name@entry=0x7f2b08476578, 
                open_tables_state_backup=0x7f2b74229850, can_deadlock=false) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_show.cc:4358
            #19 0x000055c2be54e494 in get_all_tables (thd=0x7f2b080009a8, tables=0x7f2b0800f398, cond=<optimized out>)
                at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_show.cc:4997
            #20 0x000055c2be54fa5f in get_schema_tables_result (join=join@entry=0x7f2b08011318, executed_place=executed_place@entry=PROCESSED_BY_JOIN_EXEC)
                at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_show.cc:8368
            #21 0x000055c2be5383be in JOIN::exec_inner (this=this@entry=0x7f2b08011318) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_select.cc:3442
            #22 0x000055c2be538a39 in JOIN::exec (this=this@entry=0x7f2b08011318) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_select.cc:3280
            #23 0x000055c2be538b7e in mysql_select (thd=thd@entry=0x7f2b080009a8, tables=0x7f2b0800f398, wild_num=<optimized out>, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, 
                having=0x0, proc_param=0x0, select_options=2684619520, result=0x7f2b080112f8, unit=0x7f2b080043f0, select_lex=0x7f2b08004b30)
                at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_select.cc:3673
            #24 0x000055c2be5394c8 in handle_select (thd=thd@entry=0x7f2b080009a8, lex=lex@entry=0x7f2b08004328, result=result@entry=0x7f2b080112f8, 
                setup_tables_done_option=setup_tables_done_option@entry=0) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_select.cc:373
            #25 0x000055c2be4e18f6 in execute_sqlcom_select (thd=thd@entry=0x7f2b080009a8, all_tables=0x7f2b0800f398)
                at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_parse.cc:6465
            #26 0x000055c2be4edaa0 in mysql_execute_command (thd=thd@entry=0x7f2b080009a8) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_parse.cc:3581
            #27 0x000055c2be4f071d in mysql_parse (thd=0x7f2b080009a8, rawbuf=<optimized out>, length=39, parser_state=0x7f2b7422d0d0, is_com_multi=<optimized out>, 
                is_next_command=<optimized out>) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_parse.cc:7918
            #28 0x000055c2be4f31cd in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f2b080009a8, 
                packet=packet@entry=0x7f2b08006dc9 "SELECT * FROM information_schema.TABLES", packet_length=packet_length@entry=39, is_com_multi=is_com_multi@entry=false, 
                is_next_command=is_next_command@entry=false) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_parse.cc:1817
            #29 0x000055c2be4f3a31 in do_command (thd=0x7f2b080009a8) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_parse.cc:1380
            #30 0x000055c2be5acc34 in do_handle_one_connection (connect=connect@entry=0x55c2c1d9d7b8) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_connect.cc:1354
            #31 0x000055c2be5acda4 in handle_one_connection (arg=arg@entry=0x55c2c1d9d7b8) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_connect.cc:1260
            #32 0x000055c2be809f24 in pfs_spawn_thread (arg=0x55c2c160c628) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/storage/perfschema/pfs.cc:1862
            #33 0x00007f2b7dcb06ba in start_thread (arg=0x7f2b7422e700) at pthread_create.c:333
            #34 0x00007f2b7d1453dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
            

            Note: "create temporary table" is not important for the test case, it just makes things easier for MTR than SELECT which returns result set.

            Test case

            create sequence s1;
             
            --delimiter $$
            create procedure pr1() 
            begin 
                loop 
                    create or replace temporary table tmp as select * from information_schema.tables; 
                end loop; 
            end $$
            create procedure pr2() 
            begin 
                loop 
                    flush tables; 
                end loop; 
            end $$
            --delimiter ;
             
            send call pr1();
             
            --connect (con1,localhost,root,,)
            send call pr1();
             
            --connect (con2,localhost,root,,)
            call pr2();
            

            elenst Elena Stepanova added a comment - 10.3 c431eafd62bae41dd89a6b71e4554facbad1040b debug mysqld: /data/src/10.3/sql/handler.cc:5920: int handler::ha_reset(): Assertion `(uchar*) table->def_read_set.bitmap + table->s->column_bitmap_size == (uchar*) table->def_write_set.bitmap' failed. 170801 0:49:41 [ERROR] mysqld got signal 6 ;   #3 0x00007f4a95997ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6 #4 0x000055c93c35d0de in handler::ha_reset (this=0x7f4a1c0323a8) at /data/src/10.3/sql/handler.cc:5918 #5 0x000055c93c020806 in close_thread_table (thd=0x7f4a1c000b00, table_ptr=0x7f4a1c000bc0) at /data/src/10.3/sql/sql_base.cc:891 #6 0x000055c93c020584 in close_thread_tables (thd=0x7f4a1c000b00) at /data/src/10.3/sql/sql_base.cc:848 #7 0x000055c93c13807d in fill_schema_table_by_open (thd=0x7f4a1c000b00, is_show_fields_or_keys=false, table=0x7f4a1c0348f8, schema_table=0x55c93d4d70c0 <schema_tables+1920>, orig_db_name=0x7f4a1c0bbd30, orig_table_name=0x7f4a1c424698, open_tables_state_backup=0x7f4a8017d020, can_deadlock=false) at /data/src/10.3/sql/sql_show.cc:4417 #8 0x000055c93c1396f5 in get_all_tables (thd=0x7f4a1c000b00, tables=0x7f4a1c01b610, cond=0x0) at /data/src/10.3/sql/sql_show.cc:5000 #9 0x000055c93c149436 in get_schema_tables_result (join=0x7f4a1c057a60, executed_place=PROCESSED_BY_JOIN_EXEC) at /data/src/10.3/sql/sql_show.cc:8351 #10 0x000055c93c0e71e7 in JOIN::exec_inner (this=0x7f4a1c057a60) at /data/src/10.3/sql/sql_select.cc:3454 #11 0x000055c93c0e68a0 in JOIN::exec (this=0x7f4a1c057a60) at /data/src/10.3/sql/sql_select.cc:3285 #12 0x000055c93c0e7a6b in mysql_select (thd=0x7f4a1c000b00, tables=0x7f4a1c01b610, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2684620544, result=0x7f4a1c057a40, unit=0x7f4a1c01d250, select_lex=0x7f4a1c01d990) at /data/src/10.3/sql/sql_select.cc:3685 #13 0x000055c93c0dc390 in handle_select (thd=0x7f4a1c000b00, lex=0x7f4a1c01d188, result=0x7f4a1c057a40, setup_tables_done_option=0) at /data/src/10.3/sql/sql_select.cc:373 #14 0x000055c93c0a8581 in execute_sqlcom_select (thd=0x7f4a1c000b00, all_tables=0x7f4a1c01b610) at /data/src/10.3/sql/sql_parse.cc:6438 #15 0x000055c93c09ecf2 in mysql_execute_command (thd=0x7f4a1c000b00) at /data/src/10.3/sql/sql_parse.cc:3639 #16 0x000055c93c4cd52c in sp_instr_stmt::exec_core (this=0x7f4a1c01bc30, thd=0x7f4a1c000b00, nextp=0x7f4a8017f2a4) at /data/src/10.3/sql/sp_head.cc:3302 #17 0x000055c93c4ccaf7 in sp_lex_keeper::reset_lex_and_exec_core (this=0x7f4a1c01bc78, thd=0x7f4a1c000b00, nextp=0x7f4a8017f2a4, open_tables=false, instr=0x7f4a1c01bc30) at /data/src/10.3/sql/sp_head.cc:3046 #18 0x000055c93c4cd1d7 in sp_instr_stmt::execute (this=0x7f4a1c01bc30, thd=0x7f4a1c000b00, nextp=0x7f4a8017f2a4) at /data/src/10.3/sql/sp_head.cc:3218 #19 0x000055c93c4c782a in sp_head::execute (this=0x7f4a1c01a5e8, thd=0x7f4a1c000b00, merge_da_on_success=true) at /data/src/10.3/sql/sp_head.cc:1202 #20 0x000055c93c4c9ae2 in sp_head::execute_procedure (this=0x7f4a1c01a5e8, thd=0x7f4a1c000b00, args=0x7f4a1c0053b0) at /data/src/10.3/sql/sp_head.cc:2030 #21 0x000055c93c09cc52 in do_execute_sp (thd=0x7f4a1c000b00, sp=0x7f4a1c01a5e8) at /data/src/10.3/sql/sql_parse.cc:2901 #22 0x000055c93c0a5c7f in mysql_execute_command (thd=0x7f4a1c000b00) at /data/src/10.3/sql/sql_parse.cc:5806 #23 0x000055c93c0abfbe in mysql_parse (thd=0x7f4a1c000b00, rawbuf=0x7f4a1c0134a8 "call pr1()", length=10, parser_state=0x7f4a80181250, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7893 #24 0x000055c93c099ee0 in dispatch_command (command=COM_QUERY, thd=0x7f4a1c000b00, packet=0x7f4a1c00ace1 "amic\001\062\001\060\001\060\001\060\001\060\001\060\373\373\373\373\017utf8_general_c", <incomplete sequence \373>, packet_length=10, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1822 #25 0x000055c93c09885a in do_command (thd=0x7f4a1c000b00) at /data/src/10.3/sql/sql_parse.cc:1380 #26 0x000055c93c1e747c in do_handle_one_connection (connect=0x55c93f8c1100) at /data/src/10.3/sql/sql_connect.cc:1354 #27 0x000055c93c1e7209 in handle_one_connection (arg=0x55c93f8c1100) at /data/src/10.3/sql/sql_connect.cc:1260 #28 0x00007f4a978dc494 in start_thread (arg=0x7f4a80182700) at pthread_create.c:333 #29 0x00007f4a95a5493f in clone () from /lib/x86_64-linux-gnu/libc.so.6 Stack trace from the attachment #3 <signal handler called> #4 0x00007f2b7dcb5edc in _xend () at pthread_rwlock_unlock.c:38 #5 __GI___pthread_rwlock_unlock (rwlock=rwlock@entry=0x7f2b001b58e8) at pthread_rwlock_unlock.c:38 #6 0x000055c2be607285 in inline_mysql_rwlock_unlock (that=<optimized out>) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/include/mysql/psi/mysql_thread.h:1055 #7 SEQUENCE::write_unlock (this=this@entry=0x7f2b001b5880, table=<optimized out>) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_sequence.cc:373 #8 0x000055c2be607816 in SEQUENCE::read_initial_values (this=0x7f2b001b5880, table_arg=<optimized out>) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_sequence.cc:457 #9 0x000055c2beb7ceb3 in ha_sequence::open (this=0x7f2b084bb620, name=<optimized out>, mode=<optimized out>, flags=<optimized out>) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/ha_sequence.cc:110 #10 0x000055c2be69752a in handler::ha_open (this=0x7f2b084bb620, table_arg=table_arg@entry=0x7f2b084ba308, name=0x7f2b001b5830 "./test/s1", mode=mode@entry=2, test_if_locked=test_if_locked@entry=18) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/handler.cc:2516 #11 0x000055c2be5899a2 in open_table_from_share (thd=thd@entry=0x7f2b080009a8, share=share@entry=0x7f2b001b5420, alias=<optimized out>, db_stat=db_stat@entry=33, prgflag=prgflag@entry=8, ha_open_flags=18, outparam=<optimized out>, is_create_table=<optimized out>) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/table.cc:3310 #12 0x000055c2be4a1645 in open_table (thd=thd@entry=0x7f2b080009a8, table_list=table_list@entry=0x7f2b084765e0, ot_ctx=ot_ctx@entry=0x7f2b74227f30) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_base.cc:1877 #13 0x000055c2be4a3f03 in open_and_process_table (ot_ctx=0x7f2b74227f30, has_prelocking_list=false, prelocking_strategy=0x7f2b74227fd0, flags=1090, counter=0x7f2b74227fcc, tables=0x7f2b084765e0, lex=0x7f2b74228130, thd=0x7f2b080009a8) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_base.cc:3414 #14 open_tables (thd=thd@entry=0x7f2b080009a8, options=..., start=start@entry=0x7f2b74227fb8, counter=counter@entry=0x7f2b74227fcc, flags=1090, prelocking_strategy=prelocking_strategy@entry=0x7f2b74227fd0) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_base.cc:3934 #15 0x000055c2be4a477a in open_tables (prelocking_strategy=0x7f2b74227fd0, flags=<optimized out>, counter=0x7f2b74227fcc, tables=0x7f2b74227fb8, thd=0x7f2b080009a8) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_base.h:236 #16 open_normal_and_derived_tables (thd=thd@entry=0x7f2b080009a8, tables=tables@entry=0x7f2b084765e0, flags=<optimized out>, dt_phases=dt_phases@entry=34) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_base.cc:4752 #17 0x000055c2be4a480e in open_tables_only_view_structure (thd=thd@entry=0x7f2b080009a8, table_list=table_list@entry=0x7f2b084765e0, can_deadlock=can_deadlock@entry=false) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_base.cc:4803 #18 0x000055c2be53d22a in fill_schema_table_by_open (thd=thd@entry=0x7f2b080009a8, is_show_fields_or_keys=is_show_fields_or_keys@entry=false, table=table@entry=0x7f2b0801f6a0, schema_table=schema_table@entry=0x55c2bf3fab80 <schema_tables+1920>, orig_db_name=orig_db_name@entry=0x7f2b080150e8, orig_table_name=orig_table_name@entry=0x7f2b08476578, open_tables_state_backup=0x7f2b74229850, can_deadlock=false) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_show.cc:4358 #19 0x000055c2be54e494 in get_all_tables (thd=0x7f2b080009a8, tables=0x7f2b0800f398, cond=<optimized out>) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_show.cc:4997 #20 0x000055c2be54fa5f in get_schema_tables_result (join=join@entry=0x7f2b08011318, executed_place=executed_place@entry=PROCESSED_BY_JOIN_EXEC) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_show.cc:8368 #21 0x000055c2be5383be in JOIN::exec_inner (this=this@entry=0x7f2b08011318) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_select.cc:3442 #22 0x000055c2be538a39 in JOIN::exec (this=this@entry=0x7f2b08011318) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_select.cc:3280 #23 0x000055c2be538b7e in mysql_select (thd=thd@entry=0x7f2b080009a8, tables=0x7f2b0800f398, wild_num=<optimized out>, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2684619520, result=0x7f2b080112f8, unit=0x7f2b080043f0, select_lex=0x7f2b08004b30) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_select.cc:3673 #24 0x000055c2be5394c8 in handle_select (thd=thd@entry=0x7f2b080009a8, lex=lex@entry=0x7f2b08004328, result=result@entry=0x7f2b080112f8, setup_tables_done_option=setup_tables_done_option@entry=0) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_select.cc:373 #25 0x000055c2be4e18f6 in execute_sqlcom_select (thd=thd@entry=0x7f2b080009a8, all_tables=0x7f2b0800f398) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_parse.cc:6465 #26 0x000055c2be4edaa0 in mysql_execute_command (thd=thd@entry=0x7f2b080009a8) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_parse.cc:3581 #27 0x000055c2be4f071d in mysql_parse (thd=0x7f2b080009a8, rawbuf=<optimized out>, length=39, parser_state=0x7f2b7422d0d0, is_com_multi=<optimized out>, is_next_command=<optimized out>) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_parse.cc:7918 #28 0x000055c2be4f31cd in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f2b080009a8, packet=packet@entry=0x7f2b08006dc9 "SELECT * FROM information_schema.TABLES", packet_length=packet_length@entry=39, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_parse.cc:1817 #29 0x000055c2be4f3a31 in do_command (thd=0x7f2b080009a8) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_parse.cc:1380 #30 0x000055c2be5acc34 in do_handle_one_connection (connect=connect@entry=0x55c2c1d9d7b8) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_connect.cc:1354 #31 0x000055c2be5acda4 in handle_one_connection (arg=arg@entry=0x55c2c1d9d7b8) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/sql/sql_connect.cc:1260 #32 0x000055c2be809f24 in pfs_spawn_thread (arg=0x55c2c160c628) at /home/hartmut/projects/mariadb/git/mariadb-10.3-1.git/storage/perfschema/pfs.cc:1862 #33 0x00007f2b7dcb06ba in start_thread (arg=0x7f2b7422e700) at pthread_create.c:333 #34 0x00007f2b7d1453dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109 Note: "create temporary table" is not important for the test case, it just makes things easier for MTR than SELECT which returns result set. Test case create sequence s1;   --delimiter $$ create procedure pr1() begin loop create or replace temporary table tmp as select * from information_schema.tables; end loop; end $$ create procedure pr2() begin loop flush tables; end loop; end $$ --delimiter ;   send call pr1();   --connect (con1,localhost,root,,) send call pr1();   --connect (con2,localhost,root,,) call pr2();

            Fix pushed into bb-10.2-ext, to be merged to 10.3 shortly by Bar.

            monty Michael Widenius added a comment - Fix pushed into bb-10.2-ext, to be merged to 10.3 shortly by Bar.

            Related commit is 213af08d9951c340e0db9e3d2802aa112dc47b53

            https://github.com/MariaDB/server/commit/213af08d9951c340e0db9e3d2802aa112dc47b53

            hholzgra Hartmut Holzgraefe added a comment - Related commit is 213af08d9951c340e0db9e3d2802aa112dc47b53 https://github.com/MariaDB/server/commit/213af08d9951c340e0db9e3d2802aa112dc47b53

            People

              monty Michael Widenius
              hholzgra Hartmut Holzgraefe
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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