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

Crash in SHOW ENGINE INNODB STATUS with innodb_force_recovery=5

    Details

      Description

      The following test crashes the server:

      --source include/have_innodb.inc
      --let $restart_parameters= --innodb-force-recovery=5
      --source include/restart_mysqld.inc
      SHOW ENGINE INNODB STATUS;
      

      In innodb_force_recovery=5 mode, no undo logs will be parsed, and purge_sys will not be initialized. The fix is simple:

      --- a/storage/innobase/lock/lock0lock.cc
      +++ b/storage/innobase/lock/lock0lock.cc
      @@ -4689,7 +4689,8 @@ struct lock_print_info
         void operator()(const trx_t* trx) const
         {
           ut_ad(mutex_own(&trx_sys.mutex));
      -    if (trx == purge_sys.query->trx)
      +    if (UNIV_LIKELY(purge_sys.query != NULL) &&
      +        UNIV_UNLIKELY(trx == purge_sys.query->trx))
             return;
           lock_trx_print_wait_and_mvcc_state(file, trx, now);
       
      

      The crash was introduced by the merge of MDEV-18429 from 10.2. 10.2 itself is not affected.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                marko Marko Mäkelä
                Reporter:
                marko Marko Mäkelä
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: