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

Server crashes when executing DML with innodb_checksum_algorithm set to strict_innodb

    XMLWordPrintable

Details

    Description

      PS : Use MariaDB cli to reproduce the issue. MTR test fails due to encryption plugin error

      CREATE TABLE tbl1 (a INT,b INT,KEY(b)) ENGINE=INNODB;
      CREATE TABLE tbl2 (f INT KEY) ENGINE=INNODB;
      SELECT SLEEP (1);
      SLEEP (1)
      0
      SET GLOBAL innodb_checksum_algorithm=3;
      Warnings:
      Warning	138	Setting innodb_checksum_algorithm to values other than crc32, full_crc32, strict_crc32 or strict_full_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6.
      CREATE TEMPORARY TABLE t (f INT) ENGINE=InnoDB;
      INSERT INTO tbl2 SELECT SEQ FROM seq_1_to_3000;
      INSERT INTO tbl1 VALUES (+1,0);
      INSERT INTO tbl1 VALUES (+1,0);
      SET GLOBAL innodb_lru_scan_depth=10000;
      INSERT INTO t SELECT 1 FROM tbl2 AS t,tbl2 AS t2;
       
      main.mytest 'innodb'                     [ fail ]
              Test ended at 2024-02-07 05:07:23
       
      CURRENT_TEST: main.mytest
      mysqltest: At line 13: query 'INSERT INTO t SELECT 1 FROM tbl2 AS t,tbl2 AS t2' failed: 1296: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
      

      Testcase

      CREATE TABLE tbl1 (a INT,b INT,KEY(b));
      CREATE TABLE tbl2 (f INT KEY);
      SELECT SLEEP (1);
      SET GLOBAL innodb_checksum_algorithm=strict_innodb;
      CREATE TEMPORARY TABLE t (f INT);
      INSERT INTO tbl2 SELECT SEQ FROM seq_1_to_3000;
      INSERT INTO tbl1 VALUES (+1,0);
      INSERT INTO tbl1 VALUES (+1,0);
      SET GLOBAL innodb_lru_scan_depth=10000;
      INSERT INTO t SELECT 1 FROM tbl2 AS t,tbl2 AS t2;
      

      Leads to:

      10.4.33 f4ee7c110cd6faee3fa80b61ae572f471341c906 (Debug)

      Core was generated by `/test/MD010224-mariadb-10.4.33-linux-x86_64-dbg/bin/mariadbd --no-defaults --ma'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  mach_read_from_4 (b=<optimized out>)
          at /test/10.4_dbg/storage/innobase/include/mach0data.inl:358
      [Current thread is 1 (Thread 0x14c96d12a700 (LWP 195410))]
      (gdb) bt
      #0  mach_read_from_4 (b=<optimized out>) at /test/10.4_dbg/storage/innobase/include/mach0data.inl:358
      #1  mach_read_from_8 (b=0x32 <error: Cannot access memory at address 0x32>) at /test/10.4_dbg/storage/innobase/include/mach0data.inl:358
      #2  fseg_inode_try_get (header=header@entry=0x14c970644054 "", space=space@entry=5, zip_size=0, mtr=mtr@entry=0x14c96d129040, block=block@entry=0x0) at /test/10.4_dbg/storage/innobase/fsp/fsp0fsp.cc:1668
      #3  0x000055ae7cc8aa6f in fseg_inode_get (header=header@entry=0x14c970644054 "", space=space@entry=5, zip_size=<optimized out>, mtr=mtr@entry=0x14c96d129040, block=block@entry=0x0) at /test/10.4_dbg/storage/innobase/fsp/fsp0fsp.cc:1695
      #4  0x000055ae7cc8c7a1 in fseg_n_reserved_pages (header=header@entry=0x14c970644054 "", used=used@entry=0x14c96d128e18, mtr=mtr@entry=0x14c96d129040) at /test/10.4_dbg/storage/innobase/include/fil0fil.h:370
      #5  0x000055ae7cb45a02 in btr_get_size (index=index@entry=0x14c930022030, flag=flag@entry=2, mtr=mtr@entry=0x14c96d129040) at /test/10.4_dbg/storage/innobase/btr/btr0btr.cc:636
      #6  0x000055ae7cc554a9 in dict_stats_analyze_index (index=index@entry=0x14c930022030) at /test/10.4_dbg/storage/innobase/dict/dict0stats.cc:1941
      #7  0x000055ae7cc57fd0 in dict_stats_update_persistent (table=0x14c93001ee60) at /test/10.4_dbg/storage/innobase/dict/dict0stats.cc:2246
      #8  dict_stats_update (table=table@entry=0x14c93001ee60, stats_upd_option=stats_upd_option@entry=DICT_STATS_RECALC_PERSISTENT) at /test/10.4_dbg/storage/innobase/dict/dict0stats.cc:3221
      #9  0x000055ae7cc5be8f in dict_stats_process_entry_from_recalc_pool () at /test/10.4_dbg/storage/innobase/dict/dict0stats_bg.cc:431
      #10 dict_stats_thread () at /test/10.4_dbg/storage/innobase/dict/dict0stats_bg.cc:515
      #11 0x000014c994ce4609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #12 0x000014c9948d0133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.4.33 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.4.33 (opt), 10.5.24 (dbg), 10.5.24 (opt), 10.6.17 (dbg), 10.6.17 (opt), 10.11.7 (dbg), 10.11.7 (opt), 11.0.5 (dbg), 11.0.5 (opt), 11.1.4 (dbg), 11.1.4 (opt), 11.2.3 (dbg), 11.2.3 (opt), 11.3.2 (dbg), 11.3.2 (opt), 11.4.0 (dbg), 11.4.0 (opt)

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              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.