Chun-Hung Hsiao created MESOS-9098:
--------------------------------------

             Summary: `os::clone` returns `Failed to clone: Success` on error.
                 Key: MESOS-9098
                 URL: https://issues.apache.org/jira/browse/MESOS-9098
             Project: Mesos
          Issue Type: Improvement
          Components: stout
    Affects Versions: 1.7.0
            Reporter: Chun-Hung Hsiao


{{os::clone}} in stout is implemented in a way that when {{::clone}} fails, it 
would call {{::munmap}} to free the allocated stack memory, which would 
overwrite {{errno}}, causing it to return an {{Failed to clone: Success}} error:
[https://github.com/apache/mesos/blob/master/3rdparty/stout/include/stout/os/linux.hpp#L165]
We should preserve {{errno}} before calling {{::munmap}}, and return 
{{::munmap}}'s {{errno}} only if {{::clone}}'s {{errno}} is not zero.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to