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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • None
    • None
    • None

    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);

      Attachments

        Activity

          People

            wlad Vladislav Vaintroub
            wlad Vladislav Vaintroub
            Votes:
            0 Vote for this issue
            Watchers:
            0 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.