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

too early pthread_mutex_unlock in TC_LOG_MMAP::log_xid

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.5.28, 5.3.9, 5.2.12, 5.1.62
    • Fix Version/s: 5.5.28a, 5.3.11, 5.2.13, 5.1.66
    • Component/s: None
    • Labels:
      None

      Description

      In this code:

      5660 int TC_LOG_MMAP::log_xid(THD *thd, my_xid xid)
      5661 {
      ...
      5713     for (;;)
      5714     {
      5715       int not_dirty = p->state != DIRTY;
      5716       pthread_mutex_unlock(&p->lock);
      5717       if (not_dirty || !syncing)
      5718         break;
      ...
      5733     pthread_mutex_unlock(&p->lock);

      the mutex on the line 5716 is unlocked too early. After the break on the line 5718 the loop with end with the mutex being unlocked, while the code below assumes that it is locked.

        Attachments

          Activity

            People

            Assignee:
            serg Sergei Golubchik
            Reporter:
            serg Sergei Golubchik
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: