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

LP:782435 - xt_exit_row_locks() tries to release unallocated locks

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      Sometimes (e.g during table creation), xt_exit_row_locks() is called without the corresponding xt_init_row_locks() .
      This leads to at attempt to release unallocated locks in
      xt_spinlock_free(NULL, &rl->rl_groups[i].lg_lock);

      This makes Windows application verifier unhappy on x64.

      Quick fix:
      == verändert Datei storage/pbxt/src/lock_xt.cc
      — storage/pbxt/src/lock_xt.cc 2011-04-07 16:28:52 +0000
      +++ storage/pbxt/src/lock_xt.cc 2011-05-13 22:56:00 +0000
      @@ -726,11 +726,15 @@
      rl->rl_groups[i].lg_list_in_use = 0;
      rl->rl_groups[i].lg_list = NULL;
      }
      + rl->valid = 1;
      return OK;
      }

      void xt_exit_row_locks(XTRowLocksPtr rl)
      {
      + if (!rl->valid)
      + return;
      +
      for (int i=0; i<XT_ROW_LOCK_GROUP_COUNT; i++)

      { xt_spinlock_free(NULL, &rl->rl_groups[i].lg_lock); rl->rl_groups[i].lg_wait_queue = NULL; @@ -741,6 +745,7 @@ rl->rl_groups[i].lg_list = NULL; }

      }
      + rl->valid = 0;
      }

      /*

      === verändert Datei storage/pbxt/src/lock_xt.h
      — storage/pbxt/src/lock_xt.h 2010-05-06 12:57:15 +0000
      +++ storage/pbxt/src/lock_xt.h 2011-05-13 22:51:41 +0000
      @@ -658,6 +658,7 @@
      struct XTLockWait;

      typedef struct XTRowLocks {
      + int valid;
      XTLockGroupRec rl_groups[XT_ROW_LOCK_GROUP_COUNT];

      void xt_cancel_temp_lock(XTLockWaitPtr lw);

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            wlad Vladislav Vaintroub added a comment -

            Re: xt_exit_row_locks() tries to release unallocated locks
            Fixed in MariaDB 5.2.7

            Show
            wlad Vladislav Vaintroub added a comment - Re: xt_exit_row_locks() tries to release unallocated locks Fixed in MariaDB 5.2.7
            Hide
            ratzpo Rasmus Johansson added a comment -

            Launchpad bug id: 782435

            Show
            ratzpo Rasmus Johansson added a comment - Launchpad bug id: 782435

              People

              • Assignee:
                wlad Vladislav Vaintroub
                Reporter:
                wlad Vladislav Vaintroub
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: