You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by "Benjamin Mahler (JIRA)" <ji...@apache.org> on 2013/11/17 01:37:21 UTC

[jira] [Assigned] (MESOS-815) Race condition in process::ID::generate().

     [ https://issues.apache.org/jira/browse/MESOS-815?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Mahler reassigned MESOS-815:
-------------------------------------

    Assignee: Benjamin Mahler  (was: Jie Yu)

> Race condition in process::ID::generate().
> ------------------------------------------
>
>                 Key: MESOS-815
>                 URL: https://issues.apache.org/jira/browse/MESOS-815
>             Project: Mesos
>          Issue Type: Bug
>          Components: c++ api
>         Environment: Linux gcc-4.2.1
>            Reporter: Jie Yu
>            Assignee: Benjamin Mahler
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.1#6144)