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

emb_free_embedded_thd is not thread safe

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 5.5.33
    • Fix Version/s: 5.5.34
    • Component/s: None
    • Labels:
      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.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            holyfoot Alexey Botchkov added a comment -

            As I understand that was closed as a part of this one:
            https://mariadb.atlassian.net/browse/MDEV-5131

            Show
            holyfoot Alexey Botchkov added a comment - As I understand that was closed as a part of this one: https://mariadb.atlassian.net/browse/MDEV-5131

              People

              • Assignee:
                holyfoot Alexey Botchkov
                Reporter:
                vilho Vilho Raatikka
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: