[ https://issues.apache.org/jira/browse/THRIFT-4106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16155734#comment-16155734 ]
ASF GitHub Bot commented on THRIFT-4106: ---------------------------------------- GitHub user jeking3 opened a pull request: https://github.com/apache/thrift/pull/1343 THRIFT-4106: fix errors concurrency_test was identifying I found a serious issue hiding in the thread implementation which was exposed by some of the tests. In particular, tests that use detached threads will typically construct a shared_ptr<Runnable> followed by a shared_ptr<Thread>, and then make a thread with a thread manager, then call start(). The stack frame ends without the caller saving off the shared pointers, so they start destructing however the thread may not have gotten far enough along to reference the Runnable yet, and you have a race. I am fixing this by ensuring thread start() does not return until the thread's state is changed to started by the C style threadMain function. I also was able to run clean with valgrind for the first time on this test. All three thread implementations were susceptible. You can merge this pull request into a Git repository by running: $ git pull https://github.com/jeking3/thrift THRIFT-4106 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/thrift/pull/1343.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1343 ---- commit 7a41e7ede1bb295ba0452d7e0f2f0415b5cc36a1 Author: James E. King, III <jk...@apache.org> Date: 2017-09-06T17:12:02Z THRIFT-4106: fix errors concurrency_test was identifying Client: C++ ---- > concurrency_test fails randomly > ------------------------------- > > Key: THRIFT-4106 > URL: https://issues.apache.org/jira/browse/THRIFT-4106 > Project: Thrift > Issue Type: Bug > Components: C++ - Library > Affects Versions: 0.10.0 > Environment: MinGW (appveyor), travis CI > Reporter: James E. King, III > Assignee: James E. King, III > Priority: Critical > > While adding Appveyor build support for MinGW (THRIFT-4081), this test failed > periodically. It would throw an exception in ThreadFactoryTest reapTest > where it calls monitor.wait(1000). It is reproducible locally as well if you > have msys2/mingw64 and can use the instructions in the msys2 readme in > build/cmake. The test has been disabled in mingw appveyor builds for now > (those builds are new...) > Travis CI builds are also showing an occasional failure in the test. > Need to root cause, fix, and re-enable in any CI builds where it was disabled. -- This message was sent by Atlassian JIRA (v6.4.14#64029)