Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-815

Race condition in process::ID::generate().

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.15.0
    • Component/s: c++ api
    • Labels:
      None
    • Environment:

      Linux gcc-4.2.1

      Description

      string generate(const string& prefix)
      {
      static map<string, int> prefixes;
      stringstream out;
      out << __sync_add_and_fetch(&prefixes[prefix], 1);
      return prefix + "(" + out.str() + ")";
      }

      This function could be called from multiple threads and the std::map 'prefixes' is not protected by lock, leading to a race condition. This causes framework to segfault.

        Attachments

          Activity

            People

            • Assignee:
              bmahler Benjamin Mahler
              Reporter:
              jieyu Jie Yu
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: