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

Race conditions in SHOW ENGINE INNODB MUTEX

    XMLWordPrintable

    Details

      Description

      The function innodb_show_mutex_status() is the only ultimate caller of LatchCounter::iterate() via MutexMonitor::iterate(). Because the call is not protected by LatchCounter::m_mutex, any mutex_create() or mutex_free() that is invoked concurrently during the execution, bad things such as a crash could happen.

      I think that the most likely way for this to happen is buffer pool resizing, which could cause buf_block_t::mutex (which existed before MDEV-15053) to be created or freed. We could also register InnoDB mutexes in TrxFactory::init() if trx_pools needs to grow.

      The view INFORMATION_SCHEMA.INNODB_MUTEXES is not affected, because it only displays information about rw-locks, not mutexes.

        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: