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

Connect: SIGSEGV in CntCloseTable on ALTER

    XMLWordPrintable

Details

    • Can result in hang or crash

    Description

      While this issue has the same stack as MDEV-29079, the testcase is very different and partitioning is required. Likely a different bug.

      --source include/have_partition.inc
      SET sql_mode='';
      INSTALL SONAME 'ha_connect';
      CREATE TABLE t (c INT NOT NULL,KEY(c)) ENGINE=Connect PARTITION BY KEY(c) PARTITIONS 9;
      LOCK TABLES t WRITE;
      INSERT INTO t VALUES ();
      ALTER TABLE t CHANGE c c INT UNSIGNED NOT NULL;
      

      Leads to:

      CS 12.2.0 fd15fd2765b53d0c070dd01d86fb231024b8f284 (Debug, Clang 21.1.3-20250923) Build 10/11/2025

      Core was generated by `/test/MD101125-mariadb-12.2.0-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x00007dc29e905e50 in CntCloseTable (g=0x7dc1d4059a70, tdbp=0x7dc1cfe00418, nox=false, abort=false)at /test/12.2_dbg/storage/connect/connect.cc:550
       
      [Current thread is 1 (LWP 3193831)]
      (gdb) bt
      #0  0x00007dc29e905e50 in CntCloseTable (g=0x7dc1d4059a70, tdbp=0x7dc1cfe00418, nox=false, abort=false)at /test/12.2_dbg/storage/connect/connect.cc:550
      #1  0x00007dc29e8efe8f in ha_connect::CloseTable (this=0x7dc1d4046538, g=0x7dc1d4059a70) at /test/12.2_dbg/storage/connect/ha_connect.cc:2147
      #2  0x00007dc29e8f7d51 in ha_connect::external_lock (this=0x7dc1d4046538, thd=0x7dc1d4000d58, lock_type=2)at /test/12.2_dbg/storage/connect/ha_connect.cc:4992
      #3  0x000057401a3b4c38 in handler::ha_external_lock (this=0x7dc1d4046538, thd=0x7dc1d4000d58, lock_type=2) at /test/12.2_dbg/sql/handler.cc:7758
      #4  0x000057401ac99bb1 in ha_partition::external_lock (this=0x7dc1d4045218, thd=0x7dc1d4000d58, lock_type=2) at /test/12.2_dbg/sql/ha_partition.cc:4354
      #5  0x000057401a3b4c38 in handler::ha_external_lock (this=0x7dc1d4045218, thd=0x7dc1d4000d58, lock_type=2) at /test/12.2_dbg/sql/handler.cc:7758
      #6  0x000057401a3c9542 in handler::ha_external_unlock (this=0x7dc1d4045218, thd=0x7dc1d4000d58) at /test/12.2_dbg/sql/handler.h:3621
      #7  0x000057401a3d004f in unlock_external (thd=0x7dc1d4000d58, table=0x7dc1d4021978, count=1) at /test/12.2_dbg/sql/lock.cc:791
      #8  0x000057401a3d011e in mysql_unlock_tables (thd=0x7dc1d4000d58, sql_lock=0x7dc1d40218c8, free_lock=false) at /test/12.2_dbg/sql/lock.cc:482
      #9  0x000057401a3d02fe in mysql_unlock_some_tables (thd=0x7dc1d4000d58, table=0x7dc30412c0f8, count=1, flag=0) at /test/12.2_dbg/sql/lock.cc:512
      #10 0x000057401a3d0687 in mysql_lock_remove (thd=0x7dc1d4000d58, locked=0x7dc1d405d958, table=0x7dc1d40511f8)at /test/12.2_dbg/sql/lock.cc:611
      #11 0x000057401a6b7f02 in Locked_tables_list::reopen_tables (this=0x7dc1d4004f88, thd=0x7dc1d4000d58, need_reopen=true)at /test/12.2_dbg/sql/sql_base.cc:2993
      #12 0x000057401a823d33 in mysql_execute_command (thd=0x7dc1d4000d58, is_called_from_prepared_stmt=false) at /test/12.2_dbg/sql/sql_parse.cc:5897
      #13 0x000057401a814cf8 in mysql_parse (thd=0x7dc1d4000d58, rawbuf=0x7dc1d4019ee0 "ALTER TABLE t CHANGE c c INT UNSIGNED NOT NULL", length=46, parser_state=0x7dc30412da00)at /test/12.2_dbg/sql/sql_parse.cc:7888
      #14 0x000057401a8124d9 in dispatch_command (command=COM_QUERY, thd=0x7dc1d4000d58, packet=0x7dc1d400b239 "ALTER TABLE t CHANGE c c INT UNSIGNED NOT NULL", packet_length=46, blocking=true) at /test/12.2_dbg/sql/sql_parse.cc:1878
      #15 0x000057401a81577a in do_command (thd=0x7dc1d4000d58, blocking=true)at /test/12.2_dbg/sql/sql_parse.cc:1417
      #16 0x000057401aa08afe in do_handle_one_connection (connect=0x57401ccb9088, put_in_cache=true) at /test/12.2_dbg/sql/sql_connect.cc:1503
      #17 0x000057401aa088e1 in handle_one_connection (arg=0x57401cbf8868)at /test/12.2_dbg/sql/sql_connect.cc:1415
      #18 0x00007dc30569ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #19 0x00007dc305729c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Bug Detection Matrix

          Rel    o/d  Build   Commit                                    UniqueID observed             
      CS  10.6   dbg  101125  759e3523e3d832b174cf0a612704da38b2557b40  SIGSEGV|CntCloseTable|ha_connect::CloseTable|ha_connect::external_lock|handler::ha_external_lock
      CS  10.6   opt  101125  759e3523e3d832b174cf0a612704da38b2557b40  SIGSEGV|CntCloseTable|ha_connect::CloseTable|ha_connect::external_lock|handler::ha_external_lock
      CS  10.11  dbg  101125  536cd151f0370216d9ba4c15f40c7037060972a5  SIGSEGV|CntCloseTable|ha_connect::CloseTable|ha_connect::external_lock|handler::ha_external_lock
      CS  10.11  opt  101125  536cd151f0370216d9ba4c15f40c7037060972a5  SIGSEGV|CntCloseTable|ha_connect::CloseTable|ha_connect::external_lock|handler::ha_external_lock
      CS  11.4   dbg  101125  a1bb5c94fda453baa99e57e3927eaa7cd3c8bafe  SIGSEGV|CntCloseTable|ha_connect::CloseTable|ha_connect::external_lock|handler::ha_external_lock
      CS  11.4   opt  101125  a1bb5c94fda453baa99e57e3927eaa7cd3c8bafe  SIGSEGV|CntCloseTable|ha_connect::CloseTable|ha_connect::external_lock|handler::ha_external_lock
      CS  11.8   dbg  101125  e0428264d0095472c015eb58c46be68ca1a320ee  SIGSEGV|CntCloseTable|ha_connect::CloseTable|ha_connect::external_lock|handler::ha_external_lock
      CS  11.8   opt  101125  e0428264d0095472c015eb58c46be68ca1a320ee  SIGSEGV|CntCloseTable|ha_connect::CloseTable|ha_connect::external_lock|handler::ha_external_lock
      CS  12.1   dbg  101125  ba00960fdaee67a4efff6866e31f446bf486a1c2  SIGSEGV|CntCloseTable|ha_connect::CloseTable|ha_connect::external_lock|handler::ha_external_lock
      CS  12.1   opt  101125  ba00960fdaee67a4efff6866e31f446bf486a1c2  SIGSEGV|CntCloseTable|ha_connect::CloseTable|ha_connect::external_lock|handler::ha_external_lock
      CS  12.2   dbg  101125  fd15fd2765b53d0c070dd01d86fb231024b8f284  SIGSEGV|CntCloseTable|ha_connect::CloseTable|ha_connect::external_lock|handler::ha_external_lock
      CS  12.2   opt  101125  fd15fd2765b53d0c070dd01d86fb231024b8f284  SIGSEGV|CntCloseTable|ha_connect::CloseTable|ha_connect::external_lock|handler::ha_external_lock
      ES  10.6   dbg  101125  f0d4d34fb0314b03fddb71fb9dbde372744a8c13  SIGSEGV|CntCloseTable|ha_connect::CloseTable|ha_connect::external_lock|handler::ha_external_lock
      ES  10.6   opt  101125  f0d4d34fb0314b03fddb71fb9dbde372744a8c13  SIGSEGV|CntCloseTable|ha_connect::CloseTable|ha_connect::external_lock|handler::ha_external_lock
      ES  11.4   dbg  101125  b81ec4b57a5ddce88b8e2b2d16b64625ffdaa0e6  SIGSEGV|CntCloseTable|ha_connect::CloseTable|ha_connect::external_lock|handler::ha_external_lock
      ES  11.4   opt  101125  b81ec4b57a5ddce88b8e2b2d16b64625ffdaa0e6  SIGSEGV|CntCloseTable|ha_connect::CloseTable|ha_connect::external_lock|handler::ha_external_lock
      ES  11.8   dbg  101125  db36e8fb3bcdae26dd0acdcb2b52f7f4eb014df6  SIGSEGV|CntCloseTable|ha_connect::CloseTable|ha_connect::external_lock|handler::ha_external_lock
      ES  11.8   opt  101125  db36e8fb3bcdae26dd0acdcb2b52f7f4eb014df6  SIGSEGV|CntCloseTable|ha_connect::CloseTable|ha_connect::external_lock|handler::ha_external_lock
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Roel Roel Van de Paar
              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.