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

SIGSEGV in MDL_lock::incompatible_granted_types_bitmap on HANDLER OPEN w/ duplicate table creation

    XMLWordPrintable

Details

    Description

      CREATE TABLE t1 (a VARCHAR(10)) ENGINE=InnoDB;
      SET AUTOCOMMIT=0;
      CREATE TABLE t3 (f1 INT) ENGINE=InnoDB;
      ALTER TABLE t1 ADD c2 MEDIUMINT NOT NULL FIRST;
      SET SESSION wsrep_trx_fragment_size=100;
      HANDLER t3 OPEN;
      INSERT INTO t1 VALUES (2,1),(NULL, 8);
      CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
      

      Leads to:

      10.4.21 aafb88865796bf5d3aa8f131aba67adbec3694ce (Debug)

      Core was generated by `/test/GAL_MD220721-mariadb-10.4.21-linux-x86_64-dbg/bin/mysqld --defaults-file='.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=11)
          at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      [Current thread is 1 (Thread 0x152d48131700 (LWP 610257))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      #1  0x0000559fbd60063d in my_write_core (sig=sig@entry=11) at /test/10.4_dbg/mysys/stacktrace.c:386
      #2  0x0000559fbcce3be6 in handle_fatal_signal (sig=11) at /test/10.4_dbg/sql/signal_handler.cc:356
      #3  <signal handler called>
      #4  0x0000559fbcb62444 in MDL_lock::incompatible_granted_types_bitmap (this=0x152cd839e170) at /test/10.4_dbg/sql/mdl.cc:569
      #5  MDL_lock::has_pending_conflicting_lock (this=0x152cd839e170, type=MDL_SHARED_READ) at /test/10.4_dbg/sql/mdl.cc:1879
      #6  0x0000559fbcb62ce4 in MDL_ticket::has_pending_conflicting_lock (this=<optimized out>) at /test/10.4_dbg/sql/mdl.cc:3029
      #7  0x0000559fbc9bf967 in mysql_ha_flush (thd=thd@entry=0x152cd8000d90) at /test/10.4_dbg/sql/sql_handler.cc:1175
      #8  0x0000559fbc9826f8 in open_tables (thd=thd@entry=0x152cd8000d90, options=@0x152d4812ea00: {m_options = DDL_options_st::OPT_NONE}, start=start@entry=0x152d4812e5c8, counter=counter@entry=0x152d4812e5dc, flags=flags@entry=0, prelocking_strategy=prelocking_strategy@entry=0x152d4812e678) at /test/10.4_dbg/sql/sql_base.cc:4297
      #9  0x0000559fbc98366f in open_and_lock_tables (thd=thd@entry=0x152cd8000d90, options=@0x152d4812ea00: {m_options = DDL_options_st::OPT_NONE}, tables=<optimized out>, tables@entry=0x152cd8013380, derived=derived@entry=false, flags=flags@entry=0, prelocking_strategy=prelocking_strategy@entry=0x152d4812e678) at /test/10.4_dbg/sql/sql_base.cc:5307
      #10 0x0000559fbcadb34b in open_and_lock_tables (flags=0, derived=false, tables=0x152cd8013380, options=@0x152d4812ea00: {m_options = DDL_options_st::OPT_NONE}, thd=0x152cd8000d90) at /test/10.4_dbg/sql/sql_base.h:495
      #11 mysql_create_table (thd=thd@entry=0x152cd8000d90, create_table=create_table@entry=0x152cd8013380, create_info=create_info@entry=0x152d4812e810, alter_info=alter_info@entry=0x152d4812e750) at /test/10.4_dbg/sql/sql_table.cc:5301
      #12 0x0000559fbcadce40 in Sql_cmd_create_table_like::execute (this=0x152cd8013320, thd=0x152cd8000d90) at /test/10.4_dbg/sql/sql_table.cc:11593
      #13 0x0000559fbca0f71f in mysql_execute_command (thd=thd@entry=0x152cd8000d90) at /test/10.4_dbg/sql/sql_parse.cc:6189
      #14 0x0000559fbca11cf6 in mysql_parse (thd=thd@entry=0x152cd8000d90, rawbuf=rawbuf@entry=0x152cd8013248 "CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY) ENGINE=InnoDB", length=length@entry=58, parser_state=parser_state@entry=0x152d48130490, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.4_dbg/sql/sql_parse.cc:7992
      #15 0x0000559fbca12dab in wsrep_mysql_parse (thd=thd@entry=0x152cd8000d90, rawbuf=0x152cd8013248 "CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY) ENGINE=InnoDB", length=58, parser_state=parser_state@entry=0x152d48130490, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.4_dbg/sql/sql_parse.cc:7796
      #16 0x0000559fbca14714 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x152cd8000d90, packet=packet@entry=0x152cd801b681 "CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY) ENGINE=InnoDB", packet_length=packet_length@entry=58, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.4_dbg/sql/sql_class.h:1184
      #17 0x0000559fbca17fa4 in do_command (thd=0x152cd8000d90) at /test/10.4_dbg/sql/sql_parse.cc:1373
      #18 0x0000559fbcb56d83 in do_handle_one_connection (connect=connect@entry=0x559fc14e1a40) at /test/10.4_dbg/sql/sql_connect.cc:1412
      #19 0x0000559fbcb56ea2 in handle_one_connection (arg=0x559fc14e1a40) at /test/10.4_dbg/sql/sql_connect.cc:1316
      #20 0x0000152d59986609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #21 0x0000152d59575293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.4.21 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.2.40 (dbg), 10.3.31 (dbg), 10.5.12 (dbg), 10.6.4 (dbg)

      Attachments

        Activity

          People

            janlindstrom Jan Lindström
            ramesh Ramesh Sivaraman
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.