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

emb_free_embedded_thd is not thread safe

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 5.5.33
    • 5.5.34
    • None
    • None

    Description

      static void emb_free_embedded_thd(MYSQL *mysql)
      {
      THD thd= (THD)mysql->thd;
      thd->clear_data_list();
      thread_count--;
      thd->store_globals();
      thd->unlink();
      delete thd;
      my_pthread_setspecific_ptr(THR_THD, 0);
      mysql->thd=0;
      }

      thread_count is global but it is modified without protection. In a multi-core env this will lead to lost updates or at least, race conditions.

      Attachments

        Activity

          People

            holyfoot Alexey Botchkov
            vilho Vilho Raatikka
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.