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

SIGSEGV in spider_check_and_set_trx_isolation and I_P_List_iterator from THD::drop_temporary_table (10.5.3 opt only) on ALTER

    XMLWordPrintable

    Details

      Description

      INSTALL PLUGIN spider SONAME 'ha_spider.so';
      CREATE TABLE t (c INT) ENGINE=SPIDER PARTITION BY LIST COLUMNS (c) (PARTITION p DEFAULT ENGINE=SPIDER);
      INSERT INTO t VALUES (1);
      ALTER TABLE t CHECK PARTITION ALL;
      

      Leads to:

      10.7.0 1bc82aaf0a7746c0921a94034aff2d51f0d75cd0 (Debug)

      Core was generated by `/test/MD040921-mariadb-10.7.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  spider_check_and_set_trx_isolation (conn=0x1464b008e868, 
          need_mon=<optimized out>) at /test/10.7_dbg/storage/spider/spd_trx.cc:1698
      1698      if (thd->system_thread == SYSTEM_THREAD_SLAVE_SQL)
      [Current thread is 1 (Thread 0x1464fc5ad700 (LWP 3331251))]
      (gdb) bt
      #0  spider_check_and_set_trx_isolation (conn=0x1464b008e868, need_mon=<optimized out>) at /test/10.7_dbg/storage/spider/spd_trx.cc:1698
      #1  0x00001464c3b51bdf in ha_spider::dml_init (this=this@entry=0x1464b007c610) at /test/10.7_dbg/storage/spider/ha_spider.cc:16563
      #2  0x00001464c3b55785 in ha_spider::rnd_init (this=0x1464b007c610, scan=<optimized out>) at /test/10.7_dbg/storage/spider/ha_spider.cc:7336
      #3  0x000055b0885681f9 in handler::ha_rnd_init (scan=true, this=0x1464b007c610) at /test/10.7_dbg/sql/handler.h:3535
      #4  ha_partition::check_misplaced_rows (this=this@entry=0x1464b002fc20, read_part_id=read_part_id@entry=0, do_repair=do_repair@entry=false) at /test/10.7_dbg/sql/ha_partition.cc:11089
      #5  0x000055b088568b8a in ha_partition::handle_opt_part (this=this@entry=0x1464b002fc20, thd=thd@entry=0x1464b0000db8, check_opt=check_opt@entry=0x1464b00063b8, part_id=part_id@entry=0, flag=flag@entry=3) at /test/10.7_dbg/sql/ha_partition.cc:1378
      #6  0x000055b088568e5e in ha_partition::handle_opt_partitions (this=this@entry=0x1464b002fc20, thd=thd@entry=0x1464b0000db8, check_opt=check_opt@entry=0x1464b00063b8, flag=flag@entry=3) at /test/10.7_dbg/sql/ha_partition.cc:1548
      #7  0x000055b08856916c in ha_partition::check (this=0x1464b002fc20, thd=0x1464b0000db8, check_opt=0x1464b00063b8) at /test/10.7_dbg/sql/ha_partition.cc:1280
      #8  0x000055b088298ad1 in handler::ha_check (this=0x1464b002fc20, thd=0x1464b0000db8, check_opt=0x1464b00063b8) at /test/10.7_dbg/sql/handler.cc:4922
      #9  0x000055b08811b020 in mysql_admin_table (thd=thd@entry=0x1464b0000db8, tables=tables@entry=0x1464b0013d68, check_opt=check_opt@entry=0x1464b00063b8, operator_name=operator_name@entry=0x55b08934ac60 <msg_check>, lock_type=lock_type@entry=TL_READ_NO_INSERT, org_open_for_modify=org_open_for_modify@entry=false, repair_table_use_frm=false, extra_open_options=32, prepare_func=0x0, operator_func=(int (handler::*)(handler * const, THD *, HA_CHECK_OPT *)) 0x55b088298a6a <handler::ha_check(THD*, st_ha_check_opt*)>, view_operator_func=0x55b0880b1f32 <view_check(THD*, TABLE_LIST*, st_ha_check_opt*)>, is_cmd_replicated=false) at /test/10.7_dbg/sql/sql_admin.cc:919
      #10 0x000055b08811d47e in Sql_cmd_check_table::execute (this=this@entry=0x1464b0014450, thd=thd@entry=0x1464b0000db8) at /test/10.7_dbg/sql/sql_admin.cc:1517
      #11 0x000055b088108abc in Sql_cmd_alter_table_check_partition::execute (this=0x1464b0014450, thd=0x1464b0000db8) at /test/10.7_dbg/sql/sql_partition_admin.cc:790
      #12 0x000055b087f99029 in mysql_execute_command (thd=thd@entry=0x1464b0000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.7_dbg/sql/sql_parse.cc:5997
      #13 0x000055b087f7fccb in mysql_parse (thd=thd@entry=0x1464b0000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1464fc5ac400) at /test/10.7_dbg/sql/sql_parse.cc:8036
      #14 0x000055b087f8e8d0 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1464b0000db8, packet=packet@entry=0x1464b000b739 "", packet_length=packet_length@entry=33, blocking=blocking@entry=true) at /test/10.7_dbg/sql/sql_class.h:1358
      #15 0x000055b087f91cd6 in do_command (thd=0x1464b0000db8, blocking=blocking@entry=true) at /test/10.7_dbg/sql/sql_parse.cc:1404
      #16 0x000055b0881080c8 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55b08c1831d8, put_in_cache=put_in_cache@entry=true) at /test/10.7_dbg/sql/sql_connect.cc:1418
      #17 0x000055b0881086cd in handle_one_connection (arg=arg@entry=0x55b08c1831d8) at /test/10.7_dbg/sql/sql_connect.cc:1312
      #18 0x000055b088571ade in pfs_spawn_thread (arg=0x55b08c082348) at /test/10.7_dbg/storage/perfschema/pfs.cc:2201
      #19 0x000014650067a609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #20 0x0000146500268293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.5.13 (dbg), 10.5.13 (opt), 10.6.5 (dbg), 10.6.5 (opt), 10.7.0 (dbg), 10.7.0 (opt)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.2.41 (dbg), 10.2.41 (opt), 10.3.32 (dbg), 10.3.32 (opt), 10.4.22 (dbg), 10.4.22 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.35 (dbg), 5.7.35 (opt), 8.0.26 (dbg), 8.0.26 (opt)

      10.4 Works correctly:

      10.4.22 46c3e7e3537c31a94289033bfeccf3faf8d4069e (Debug)

      10.4.22-dbg>ALTER TABLE t CHECK PARTITION ALL;
      +--------+-------+----------+----------+
      | Table  | Op    | Msg_type | Msg_text |
      +--------+-------+----------+----------+
      | test.t | check | status   | OK       |
      +--------+-------+----------+----------+
      1 row in set (0.000 sec)
      

      OR (Alternative testcase):

      INSTALL PLUGIN spider SONAME 'ha_spider.so';
      CREATE TABLE t (c INT) ENGINE=SPIDER PARTITION BY LIST COLUMNS (c) (PARTITION p DEFAULT ENGINE=SPIDER);
      SELECT * FROM t;
      ALTER TABLE t ENGINE=MEMORY;
      

      Leads to:

      10.7.0 1bc82aaf0a7746c0921a94034aff2d51f0d75cd0 (Debug)

      Core was generated by `/test/MD040921-mariadb-10.7.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  spider_check_and_set_trx_isolation (conn=0x15532008e868, 
          need_mon=<optimized out>) at /test/10.7_dbg/storage/spider/spd_trx.cc:1698
      1698	  if (thd->system_thread == SYSTEM_THREAD_SLAVE_SQL)
      [Current thread is 1 (Thread 0x1553749e0700 (LWP 1456230))]
      (gdb) bt
      #0  spider_check_and_set_trx_isolation (conn=0x15532008e868, need_mon=<optimized out>) at /test/10.7_dbg/storage/spider/spd_trx.cc:1698
      #1  0x00001553602a3bdf in ha_spider::dml_init (this=this@entry=0x15532007c610) at /test/10.7_dbg/storage/spider/ha_spider.cc:16563
      #2  0x00001553602a7785 in ha_spider::rnd_init (this=0x15532007c610, scan=<optimized out>) at /test/10.7_dbg/storage/spider/ha_spider.cc:7336
      #3  0x00005575f65721a6 in handler::ha_rnd_init (scan=true, this=0x15532007c610) at /test/10.7_dbg/sql/handler.h:3535
      #4  ha_partition::rnd_init (this=0x15532002fc20, scan=true) at /test/10.7_dbg/sql/ha_partition.cc:5133
      #5  0x00005575f62a3435 in handler::ha_rnd_init (scan=true, this=0x15532002fc20) at /test/10.7_dbg/sql/handler.h:3535
      #6  handler::ha_rnd_init_with_error (this=0x15532002fc20, scan=scan@entry=true) at /test/10.7_dbg/sql/handler.cc:3614
      #7  0x00005575f5e96f79 in init_read_record (info=info@entry=0x1553749dc080, thd=thd@entry=0x155320000db8, table=table@entry=0x15532002f348, select=select@entry=0x0, filesort=filesort@entry=0x0, use_record_cache=use_record_cache@entry=1, print_error=true, disable_rr_cache=false) at /test/10.7_dbg/sql/records.cc:328
      #8  0x00005575f608f1ce in copy_data_between_tables (alter_ctx=0x1553749dd6b0, keys_onoff=<optimized out>, deleted=<synthetic pointer>, copied=<synthetic pointer>, order=<optimized out>, order_num=<optimized out>, ignore=<optimized out>, create=@0x1553749dd960: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x0, last = 0x2f747365742f2e00, elements = 1919299188}, <No data fields>}, to=0x1553200ccff8, from=0x15532002f348, thd=0x155320000db8) at /test/10.7_dbg/sql/sql_table.cc:11000
      #9  mysql_alter_table (thd=thd@entry=0x155320000db8, new_db=new_db@entry=0x1553200059b8, new_name=new_name@entry=0x155320005dd0, create_info=create_info@entry=0x1553749de4d0, table_list=<optimized out>, table_list@entry=0x155320013d60, alter_info=alter_info@entry=0x1553749de3e0, order_num=<optimized out>, order=<optimized out>, ignore=<optimized out>, if_exists=<optimized out>) at /test/10.7_dbg/sql/sql_table.cc:10356
      #10 0x00005575f611d0bb in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x155320000db8) at /test/10.7_dbg/sql/structs.h:568
      #11 0x00005575f5fa6029 in mysql_execute_command (thd=thd@entry=0x155320000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.7_dbg/sql/sql_parse.cc:5997
      #12 0x00005575f5f8cccb in mysql_parse (thd=thd@entry=0x155320000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1553749df400) at /test/10.7_dbg/sql/sql_parse.cc:8036
      #13 0x00005575f5f9b8d0 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x155320000db8, packet=packet@entry=0x15532000b739 "ALTER TABLE t ENGINE=MEMORY", packet_length=packet_length@entry=27, blocking=blocking@entry=true) at /test/10.7_dbg/sql/sql_class.h:1358
      #14 0x00005575f5f9ecd6 in do_command (thd=0x155320000db8, blocking=blocking@entry=true) at /test/10.7_dbg/sql/sql_parse.cc:1404
      #15 0x00005575f61150c8 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5575f98d2078, put_in_cache=put_in_cache@entry=true) at /test/10.7_dbg/sql/sql_connect.cc:1418
      #16 0x00005575f61156cd in handle_one_connection (arg=arg@entry=0x5575f98d2078) at /test/10.7_dbg/sql/sql_connect.cc:1312
      #17 0x00005575f657eade in pfs_spawn_thread (arg=0x5575f97d12b8) at /test/10.7_dbg/storage/perfschema/pfs.cc:2201
      #18 0x0000155377aad609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #19 0x000015537769b293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.5.13 (dbg), 10.5.13 (opt), 10.6.5 (dbg), 10.6.5 (opt), 10.7.0 (dbg), 10.7.0 (opt)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.2.41 (dbg), 10.2.41 (opt), 10.3.32 (dbg), 10.3.32 (opt), 10.4.22 (dbg), 10.4.22 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.35 (dbg), 5.7.35 (opt), 8.0.26 (dbg), 8.0.26 (opt)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              nayuta-yanagisawa Nayuta Yanagisawa
              Reporter:
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration