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

innochecksum -S crashes for encrypted .ibd tablespace

Details

    Description

      We need a way to get summary of pages by type for the encrypted .ibd file.

      Now we get a crash like this when trying to gte this information for encrypted .ibd file with 10.2.27, for example:

       
      # gdb --args /path/bin/innochecksum -S t.ibd
      GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-120.el7
      Copyright (C) 2013 Free Software Foundation, Inc.
      License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law. Type "show copying"
      and "show warranty" for details.
      This GDB was configured as "x86_64-redhat-linux-gnu".
      For bug reporting instructions, please see:
      <http://www.gnu.org/software/gdb/bugs/>...
      Reading symbols from /path/bin/innochecksum...done.
      (gdb) r
      Starting program: /path/bin/innochecksum -S t.ibd
      [Thread debugging using libthread_db enabled]
      Using host libthread_db library "/lib64/libthread_db.so.1".
       
      Program received signal SIGSEGV, Segmentation fault.
      0x00007f4a7aebc28b in __fprintf_chk () from /lib64/libc.so.6
      Missing separate debuginfos, use: debuginfo-install ...
      (gdb) bt
      #0 0x00007f4a7aebc28b in __fprintf_chk () from /lib64/libc.so.6
      #1 0x00005599d7a2fbcb in fprintf (__fmt=0x5599d7a77998 "#::%llu\t\t|\t\tEncrypted Index page\t\t\t|\tkey_version %u,%s\n", __stream=0x0) at /usr/include/bits/stdio2.h:99
      #2 parse_page (page=page@entry=0x5599d82f0000 "\273\066\314", <incomplete sequence \303>, xdes=xdes@entry=0x7f4a7bfa0000 "\253V\306e", file=file@entry=0x0, page_size=...,
      is_encrypted=is_encrypted@entry=true) at /home/buildbot/buildbot/build/extra/innochecksum.cc:944
      #3 0x00005599d7a2d28c in main (argc=1, argv=0x7ffceb958640) at /home/buildbot/buildbot/build/extra/innochecksum.cc:2018
      (gdb) 
      

      Attachments

        Issue Links

          Activity

            valerii Valerii Kravchuk created issue -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            Field Original Value New Value
            julien.fritsch Julien Fritsch made changes -
            Assignee Marko Mäkelä [ marko ]
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 10.2 [ 14601 ]
            julien.fritsch Julien Fritsch made changes -
            Assignee Marko Mäkelä [ marko ] Valerii Kravchuk [ valerii ]
            Status Open [ 1 ] Needs Feedback [ 10501 ]
            valerii Valerii Kravchuk made changes -
            Description We need a way to get summary of pages by type for the encrypted .ibd file.

            Now we get a crash like this when trying to gte this information for encrypted .ind file with 10.2.27, for example:

            {noformat}

            # gdb --args /path/bin/innochecksum -S t.ibd
            GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-120.el7
            Copyright (C) 2013 Free Software Foundation, Inc.
            License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
            This is free software: you are free to change and redistribute it.
            There is NO WARRANTY, to the extent permitted by law. Type "show copying"
            and "show warranty" for details.
            This GDB was configured as "x86_64-redhat-linux-gnu".
            For bug reporting instructions, please see:
            <http://www.gnu.org/software/gdb/bugs/>...
            Reading symbols from /path/bin/innochecksum...done.
            (gdb) r
            Starting program: /path/bin/innochecksum -S t.ibd
            [Thread debugging using libthread_db enabled]
            Using host libthread_db library "/lib64/libthread_db.so.1".

            Program received signal SIGSEGV, Segmentation fault.
            0x00007f4a7aebc28b in __fprintf_chk () from /lib64/libc.so.6
            Missing separate debuginfos, use: debuginfo-install ...
            (gdb) bt
            #0 0x00007f4a7aebc28b in __fprintf_chk () from /lib64/libc.so.6
            #1 0x00005599d7a2fbcb in fprintf (__fmt=0x5599d7a77998 "#::%llu\t\t|\t\tEncrypted Index page\t\t\t|\tkey_version %u,%s\n", __stream=0x0) at /usr/include/bits/stdio2.h:99
            #2 parse_page (page=page@entry=0x5599d82f0000 "\273\066\314", <incomplete sequence \303>, xdes=xdes@entry=0x7f4a7bfa0000 "\253V\306e", file=file@entry=0x0, page_size=...,
            is_encrypted=is_encrypted@entry=true) at /home/buildbot/buildbot/build/extra/innochecksum.cc:944
            #3 0x00005599d7a2d28c in main (argc=1, argv=0x7ffceb958640) at /home/buildbot/buildbot/build/extra/innochecksum.cc:2018
            (gdb)
            {noformat}
            We need a way to get summary of pages by type for the encrypted .ibd file.

            Now we get a crash like this when trying to gte this information for encrypted .ibd file with 10.2.27, for example:

            {noformat}

            # gdb --args /path/bin/innochecksum -S t.ibd
            GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-120.el7
            Copyright (C) 2013 Free Software Foundation, Inc.
            License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
            This is free software: you are free to change and redistribute it.
            There is NO WARRANTY, to the extent permitted by law. Type "show copying"
            and "show warranty" for details.
            This GDB was configured as "x86_64-redhat-linux-gnu".
            For bug reporting instructions, please see:
            <http://www.gnu.org/software/gdb/bugs/>...
            Reading symbols from /path/bin/innochecksum...done.
            (gdb) r
            Starting program: /path/bin/innochecksum -S t.ibd
            [Thread debugging using libthread_db enabled]
            Using host libthread_db library "/lib64/libthread_db.so.1".

            Program received signal SIGSEGV, Segmentation fault.
            0x00007f4a7aebc28b in __fprintf_chk () from /lib64/libc.so.6
            Missing separate debuginfos, use: debuginfo-install ...
            (gdb) bt
            #0 0x00007f4a7aebc28b in __fprintf_chk () from /lib64/libc.so.6
            #1 0x00005599d7a2fbcb in fprintf (__fmt=0x5599d7a77998 "#::%llu\t\t|\t\tEncrypted Index page\t\t\t|\tkey_version %u,%s\n", __stream=0x0) at /usr/include/bits/stdio2.h:99
            #2 parse_page (page=page@entry=0x5599d82f0000 "\273\066\314", <incomplete sequence \303>, xdes=xdes@entry=0x7f4a7bfa0000 "\253V\306e", file=file@entry=0x0, page_size=...,
            is_encrypted=is_encrypted@entry=true) at /home/buildbot/buildbot/build/extra/innochecksum.cc:944
            #3 0x00005599d7a2d28c in main (argc=1, argv=0x7ffceb958640) at /home/buildbot/buildbot/build/extra/innochecksum.cc:2018
            (gdb)
            {noformat}

            Yes, create any encrypted InnoDB table t, add some data and then stop the instance and run innochecksum -S /path/to/t.ibd, check the results.

            valerii Valerii Kravchuk added a comment - Yes, create any encrypted InnoDB table t, add some data and then stop the instance and run innochecksum -S /path/to/t.ibd, check the results.
            valerii Valerii Kravchuk made changes -
            Assignee Valerii Kravchuk [ valerii ]
            Status Needs Feedback [ 10501 ] Open [ 1 ]
            julien.fritsch Julien Fritsch made changes -
            Assignee Marko Mäkelä [ marko ]
            julien.fritsch Julien Fritsch made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -

            I can repeat this with the following change to an existing test:

            diff --git a/mysql-test/suite/encryption/t/innochecksum.test b/mysql-test/suite/encryption/t/innochecksum.test
            index 5423a70f5d9..79a8bbabe2b 100644
            --- a/mysql-test/suite/encryption/t/innochecksum.test
            +++ b/mysql-test/suite/encryption/t/innochecksum.test
            @@ -70,7 +70,7 @@ shutdown_server;
             
             --echo # Run innochecksum on t1
             -- disable_result_log
            ---exec $INNOCHECKSUM $t1_IBD
            +--exec $INNOCHECKSUM -S $t1_IBD
             
             --echo # Run innochecksum on t2
             
            

            10.2 3fd79a04b69af46eddcdef947bef07b4c139ac75

            CURRENT_TEST: encryption.innochecksum
            mysqltest: At line 73: exec of '/dev/shm/10.2o/extra/innochecksum -S /dev/shm/10.2o/mysql-test/var/mysqld.1/data//test/t1.ibd 2>&1' failed, error: 35584, status: 139, errno: 32
            Output from before failure:
            Segmentation fault
            

            marko Marko Mäkelä added a comment - I can repeat this with the following change to an existing test: diff --git a/mysql-test/suite/encryption/t/innochecksum.test b/mysql-test/suite/encryption/t/innochecksum.test index 5423a70f5d9..79a8bbabe2b 100644 --- a/mysql-test/suite/encryption/t/innochecksum.test +++ b/mysql-test/suite/encryption/t/innochecksum.test @@ -70,7 +70,7 @@ shutdown_server; --echo # Run innochecksum on t1 -- disable_result_log ---exec $INNOCHECKSUM $t1_IBD +--exec $INNOCHECKSUM -S $t1_IBD --echo # Run innochecksum on t2 10.2 3fd79a04b69af46eddcdef947bef07b4c139ac75 CURRENT_TEST: encryption.innochecksum mysqltest: At line 73: exec of '/dev/shm/10.2o/extra/innochecksum -S /dev/shm/10.2o/mysql-test/var/mysqld.1/data//test/t1.ibd 2>&1' failed, error: 35584, status: 139, errno: 32 Output from before failure: Segmentation fault
            marko Marko Mäkelä made changes -
            Assignee Marko Mäkelä [ marko ] Vladislav Lesin [ vlad.lesin ]
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            julien.fritsch Julien Fritsch made changes -
            Priority Major [ 3 ] Critical [ 2 ]

            Repeatable the same way as Marko explained with current 10.5.16 from GitHub:

            Yuliyas-MacBook-Air:mysql-test Valerii$ pwd
            /Users/Valerii/dbs/maria10.5/mysql-test
            Yuliyas-MacBook-Air:mysql-test Valerii$ ./mtr encryption.innochecksum
            Logging: ./mtr  encryption.innochecksum
            VS config: 
            vardir: /Users/Valerii/dbs/maria10.5/mysql-test/var
            Removing old var directory...
            Creating var directory '/Users/Valerii/dbs/maria10.5/mysql-test/var'...
            Checking supported features...
            MariaDB Version 10.5.16-MariaDB
             - SSL connections supported
             - binaries built with wsrep patch
            Collecting tests...
            Installing system database...
             
            ==============================================================================
             
            TEST                                      RESULT   TIME (ms) or COMMENT
            --------------------------------------------------------------------------
             
            worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019
            encryption.innochecksum '16k,cbc,crc32,innodb' [ fail ]
                    Test ended at 2022-03-15 19:43:39
             
            CURRENT_TEST: encryption.innochecksum
            sh: line 1: 51763 Segmentation fault: 11  /Users/Valerii/dbs/maria10.5/bin/innochecksum -S /Users/Valerii/dbs/maria10.5/mysql-test/var/mysqld.1/data//test/t1.ibd 2>&1
            mysqltest: At line 63: exec of '/Users/Valerii/dbs/maria10.5/bin/innochecksum -S /Users/Valerii/dbs/maria10.5/mysql-test/var/mysqld.1/data//test/t1.ibd 2>&1' failed, error: 35584, status: 139, errno: 22
            Output from before failure:
            # Run innochecksum on t1
            ...
            

            valerii Valerii Kravchuk added a comment - Repeatable the same way as Marko explained with current 10.5.16 from GitHub: Yuliyas-MacBook-Air:mysql-test Valerii$ pwd /Users/Valerii/dbs/maria10.5/mysql-test Yuliyas-MacBook-Air:mysql-test Valerii$ ./mtr encryption.innochecksum Logging: ./mtr encryption.innochecksum VS config: vardir: /Users/Valerii/dbs/maria10.5/mysql-test/var Removing old var directory... Creating var directory '/Users/Valerii/dbs/maria10.5/mysql-test/var'... Checking supported features... MariaDB Version 10.5.16-MariaDB - SSL connections supported - binaries built with wsrep patch Collecting tests... Installing system database...   ==============================================================================   TEST RESULT TIME (ms) or COMMENT --------------------------------------------------------------------------   worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019 encryption.innochecksum '16k,cbc,crc32,innodb' [ fail ] Test ended at 2022-03-15 19:43:39   CURRENT_TEST: encryption.innochecksum sh: line 1: 51763 Segmentation fault: 11 /Users/Valerii/dbs/maria10.5/bin/innochecksum -S /Users/Valerii/dbs/maria10.5/mysql-test/var/mysqld.1/data//test/t1.ibd 2>&1 mysqltest: At line 63: exec of '/Users/Valerii/dbs/maria10.5/bin/innochecksum -S /Users/Valerii/dbs/maria10.5/mysql-test/var/mysqld.1/data//test/t1.ibd 2>&1' failed, error: 35584, status: 139, errno: 22 Output from before failure: # Run innochecksum on t1 ...
            valerii Valerii Kravchuk made changes -
            Affects Version/s 10.5.16 [ 27508 ]
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 10.5 [ 23123 ]
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            vlad.lesin Vladislav Lesin made changes -
            Status Confirmed [ 10101 ] In Progress [ 3 ]
            vlad.lesin Vladislav Lesin made changes -
            Fix Version/s 10.2.44 [ 27514 ]
            Fix Version/s 10.3.35 [ 27512 ]
            Fix Version/s 10.4.25 [ 27510 ]
            Fix Version/s 10.5.16 [ 27508 ]
            Fix Version/s 10.6.8 [ 27506 ]
            Fix Version/s 10.7.4 [ 27504 ]
            Fix Version/s 10.8.3 [ 27502 ]
            Fix Version/s 10.9.1 [ 27114 ]
            Fix Version/s 10.2 [ 14601 ]
            Fix Version/s 10.5 [ 23123 ]
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            mariadb-jira-automation Jira Automation (IT) made changes -
            Zendesk Related Tickets 201658 173800
            Zendesk active tickets 201658

            People

              vlad.lesin Vladislav Lesin
              valerii Valerii Kravchuk
              Votes:
              0 Vote for this issue
              Watchers:
              6 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.