[
https://issues.apache.org/jira/browse/MESOS-3330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14739515#comment-14739515
]
Neil Conway commented on MESOS-3330:
------------------------------------
Having spent some time looking into this, initial conclusions:
* A lot of the reported errors seem to be caused by the fact that libstdc++
before GCC 5.1 uses copy-on-write (COW) for its std::string implementation.
This means the std::string copy constructor doesn't do a true copy, so a
subsequent modification to the string modifies the input to the copy
constructor. Basically, libstdc++ sucks. Not 100% clear to me why tsan would
complain about this or if there's actually a possible bug (the COW refcounts
_should_ be modified in a thread-safe/atomic way), but hopefully this will be
resolved when using GCC 5.1+. I'll retest with GCC 5.1+ when I get a chance.
* There do seem to be some infelicities in libprocess -- for example,
ProcessManager::resume() looks at process->state without holding the process's
mutex, which seems wrong, strictly speaking. However, I didn't see a "smoking
gun" among the reported errors I looked at.
> Investigate ThreadSanitizer errors
> ----------------------------------
>
> Key: MESOS-3330
> URL: https://issues.apache.org/jira/browse/MESOS-3330
> Project: Mesos
> Issue Type: Bug
> Reporter: Neil Conway
> Assignee: Neil Conway
> Attachments: thread_sanitizer_errors.txt.gz
>
>
> Running ThreadSanitizer (http://clang.llvm.org/docs/ThreadSanitizer.html)
> over "make check" yields ~262 warnings/errors (data races, use-after-free,
> and similar).
> Notes on running tsan:
> * CXXFLAGS="-fsanitize=thread" LDFLAGS="-fsanitize=thread"
> * This creates an additional thread, which breaks a few (fragile) tests; will
> be reported separately
> * I ran into some problems using tsan w/ GCC 4.9; using clang 3.6 worked fine.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)