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

SIGSEGV in spider_db_mbase::fin_loop_check on I_S SELECT

    XMLWordPrintable

Details

    Description

      The testcase is 50/50 sporadic. The 'spider_spider' table name in the final table may be required.

      INSTALL PLUGIN Spider SONAME 'ha_spider.so';
      CREATE USER Spider@localhost IDENTIFIED BY '';
      CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET '../socket.sock',DATABASE 'test',user 'Spider',PASSWORD '');
      SET GLOBAL table_open_cache=1;
      CREATE TABLE t (c INT) ENGINE=InnoDB;
      CREATE TABLE t1 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"';
      CREATE TABLE t2 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"';
      CREATE TABLE t3 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"';
      SELECT * FROM information_schema.key_column_usage;
      CREATE TABLE t4 (c INT) ENGINE=Spider;
      INSERT INTO t4 VALUES (0);
      CREATE TABLE t5 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"';
      CREATE TABLE spider_spider (a INT) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"';
      SELECT * FROM information_schema.tables;
      

      Leads to:

      10.11.1 50c5743adc87e1cdec1431a02558f6540fe5a6d5 (Debug)

      Core was generated by `/test/MD221022-mariadb-10.11.1-linux-x86_64-dbg/bin/mysqld --no-defaults --core'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  spider_db_mbase::fin_loop_check (this=0x152f000e0d30)
          at /test/10.11_dbg/storage/spider/spd_db_mysql.cc:3370
      [Current thread is 1 (Thread 0x152f7012d700 (LWP 2627900))]
      (gdb) bt
      #0  spider_db_mbase::fin_loop_check (this=0x152f000e0d30) at /test/10.11_dbg/storage/spider/spd_db_mysql.cc:3370
      #1  0x0000152f69f15b89 in spider_db_conn_queue_action (conn=conn@entry=0x152f001bcba8) at /test/10.11_dbg/storage/spider/spd_db_conn.cc:568
      #2  0x0000152f69f1bf35 in spider_db_before_query (conn=conn@entry=0x152f001bcba8, need_mon=need_mon@entry=0x152f001571b0) at /test/10.11_dbg/storage/spider/spd_db_conn.cc:586
      #3  0x0000152f69f1c3b5 in spider_db_query (conn=conn@entry=0x152f001bcba8, query=0x152f000aef48 "show table status from `test` like 't'", length=length@entry=38, quick_mode=quick_mode@entry=-1, need_mon=need_mon@entry=0x152f001571b0) at /test/10.11_dbg/storage/spider/spd_db_conn.cc:653
      #4  0x0000152f69f9e31e in spider_mbase_handler::show_table_status (this=0x152f00157300, link_idx=0, sts_mode=<optimized out>, flag=<optimized out>) at /test/10.11_dbg/storage/spider/spd_db_mysql.cc:13548
      #5  0x0000152f69f21bce in spider_db_show_table_status (spider=spider@entry=0x152f00062df0, link_idx=link_idx@entry=0, sts_mode=<optimized out>, sts_mode@entry=1, flag=flag@entry=88) at /test/10.11_dbg/storage/spider/spd_db_conn.cc:5225
      #6  0x0000152f69f4d793 in spider_get_sts (share=share@entry=0x152f0005a2d8, link_idx=0, tmp_time=tmp_time@entry=1668482404, spider=spider@entry=0x152f00062df0, sts_interval=sts_interval@entry=10, sts_mode=sts_mode@entry=1, sts_sync=sts_sync@entry=0, sts_sync_level=1, flag=88) at /test/10.11_dbg/storage/spider/spd_table.cc:7152
      #7  0x0000152f69f5668a in spider_get_share (table_name=<optimized out>, table_name@entry=0x152f001445e0 "./test/spider_spider", table=0x55aaf0bae778, thd=thd@entry=0x152f00000d48, spider=spider@entry=0x152f00062df0, error_num=error_num@entry=0x152f70127340) at /test/10.11_dbg/storage/spider/spd_table.cc:5047
      #8  0x0000152f69f7ddce in ha_spider::open (this=0x152f00062df0, name=0x152f001445e0 "./test/spider_spider", mode=<optimized out>, test_if_locked=<optimized out>) at /test/10.11_dbg/storage/spider/ha_spider.cc:291
      #9  0x000055aaed6a9f6d in handler::ha_open (this=0x152f00062df0, table_arg=table_arg@entry=0x55aaf0bae778, name=0x152f001445e0 "./test/spider_spider", mode=mode@entry=2, test_if_locked=test_if_locked@entry=18, mem_root=mem_root@entry=0x0, partitions_to_open=0x0) at /test/10.11_dbg/sql/handler.cc:3331
      #10 0x000055aaed4e3e03 in open_table_from_share (thd=thd@entry=0x152f00000d48, share=share@entry=0x152f00144010, alias=alias@entry=0x152f000af120, db_stat=db_stat@entry=33, prgflag=prgflag@entry=8, ha_open_flags=18, outparam=0x55aaf0bae778, is_create_table=false, partitions_to_open=0x0) at /test/10.11_dbg/sql/table.cc:4451
      #11 0x000055aaed3433ff in open_table (thd=thd@entry=0x152f00000d48, table_list=table_list@entry=0x152f000af100, ot_ctx=ot_ctx@entry=0x152f70127cd0) at /test/10.11_dbg/sql/sql_base.cc:2180
      #12 0x000055aaed347903 in open_and_process_table (ot_ctx=0x152f70127cd0, has_prelocking_list=false, prelocking_strategy=0x152f70127d68, flags=1090, counter=0x152f70127d64, tables=0x152f000af100, thd=0x152f00000d48) at /test/10.11_dbg/sql/sql_base.cc:4111
      #13 open_tables (thd=thd@entry=0x152f00000d48, options=@0x152f701295c0: {m_options = DDL_options_st::OPT_NONE}, start=start@entry=0x152f70127d58, counter=counter@entry=0x152f70127d64, flags=1090, prelocking_strategy=prelocking_strategy@entry=0x152f70127d68) at /test/10.11_dbg/sql/sql_base.cc:4598
      #14 0x000055aaed3489ed in open_tables (prelocking_strategy=0x152f70127d68, flags=<optimized out>, counter=0x152f70127d64, tables=0x152f70127d58, thd=0x152f00000d48) at /test/10.11_dbg/sql/sql_base.h:266
      #15 open_normal_and_derived_tables (thd=thd@entry=0x152f00000d48, tables=<optimized out>, tables@entry=0x152f000af100, flags=<optimized out>, dt_phases=dt_phases@entry=3) at /test/10.11_dbg/sql/sql_base.cc:5636
      #16 0x000055aaed348ae0 in open_tables_only_view_structure (thd=thd@entry=0x152f00000d48, table_list=table_list@entry=0x152f000af100, can_deadlock=can_deadlock@entry=false) at /test/10.11_dbg/sql/sql_base.cc:5686
      #17 0x000055aaed458a53 in fill_schema_table_by_open (thd=thd@entry=0x152f00000d48, mem_root=mem_root@entry=0x152f70129da0, is_show_fields_or_keys=is_show_fields_or_keys@entry=false, table=table@entry=0x152f000c88d0, schema_table=schema_table@entry=0x55aaee846c80 <schema_tables+2368>, orig_db_name=orig_db_name@entry=0x152f00126260, orig_table_name=0x152f00126290, open_tables_state_backup=0x152f70129de0, can_deadlock=false) at /test/10.11_dbg/sql/sql_show.cc:4717
      #18 0x000055aaed47c263 in get_all_tables (thd=0x152f00000d48, tables=0x152f000138c8, cond=<optimized out>) at /test/10.11_dbg/sql/sql_show.cc:5388
      #19 0x000055aaed47d6d4 in get_schema_tables_result (join=join@entry=0x152f00015468, executed_place=executed_place@entry=PROCESSED_BY_JOIN_EXEC) at /test/10.11_dbg/sql/sql_show.cc:9043
      #20 0x000055aaed451b8b in JOIN::exec_inner (this=this@entry=0x152f00015468) at /test/10.11_dbg/sql/sql_string.h:698
      #21 0x000055aaed45269e in JOIN::exec (this=this@entry=0x152f00015468) at /test/10.11_dbg/sql/sql_select.cc:4591
      #22 0x000055aaed450652 in mysql_select (thd=thd@entry=0x152f00000d48, tables=0x152f000138c8, fields=@0x152f00013578: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x152f00013868, last = 0x152f00123978, elements = 23}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2701396736, result=0x152f00015440, unit=0x152f00004f88, select_lex=0x152f000132d8) at /test/10.11_dbg/sql/sql_select.cc:5071
      #23 0x000055aaed450dc5 in handle_select (thd=thd@entry=0x152f00000d48, lex=lex@entry=0x152f00004eb0, result=result@entry=0x152f00015440, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.11_dbg/sql/sql_select.cc:582
      #24 0x000055aaed3bead5 in execute_sqlcom_select (thd=thd@entry=0x152f00000d48, all_tables=0x152f000138c8) at /test/10.11_dbg/sql/sql_parse.cc:6261
      #25 0x000055aaed3cabd2 in mysql_execute_command (thd=thd@entry=0x152f00000d48, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.11_dbg/sql/sql_parse.cc:3945
      #26 0x000055aaed3b8f90 in mysql_parse (thd=thd@entry=0x152f00000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x152f7012c300) at /test/10.11_dbg/sql/sql_parse.cc:8023
      #27 0x000055aaed3c64ac in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x152f00000d48, packet=packet@entry=0x152f0000af09 "SELECT * FROM information_schema.tables", packet_length=packet_length@entry=39, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_class.h:1346
      #28 0x000055aaed3c88f4 in do_command (thd=0x152f00000d48, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_parse.cc:1407
      #29 0x000055aaed525067 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55aaf0b71f28, put_in_cache=put_in_cache@entry=true) at /test/10.11_dbg/sql/sql_connect.cc:1416
      #30 0x000055aaed525536 in handle_one_connection (arg=0x55aaf0b71f28) at /test/10.11_dbg/sql/sql_connect.cc:1318
      #31 0x0000152f945d2609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #32 0x0000152f941be133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.5.18 (dbg), 10.6.10 (dbg), 10.7.6 (dbg), 10.8.5 (dbg), 10.9.3 (dbg), 10.10.2 (dbg), 10.11.1 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.4.27 (dbg), 10.4.27 (opt), 10.5.18 (opt), 10.6.10 (opt), 10.7.6 (opt), 10.8.5 (opt), 10.9.3 (opt), 10.10.2 (opt), 10.11.1 (opt)

      Attachments

        Issue Links

          Activity

            People

              holyfoot Alexey Botchkov
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.