[Boost-bugs] [Boost C++ Libraries] #7464: BOOST_TEST(n_alive == 1); fails due to race condition in a regression test tool

Subject: [Boost-bugs] [Boost C++ Libraries] #7464: BOOST_TEST(n_alive == 1); fails due to race condition in a regression test tool
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-10-03 18:50:40


#7464: BOOST_TEST(n_alive == 1); fails due to race condition in a regression test
tool
----------------------------------------------+-----------------------------
 Reporter: greg.nowakowski@… | Owner: grafik
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: Regression Testing
  Version: Boost 1.51.0 | Severity: Regression
 Keywords: thread,regression,race condition |
----------------------------------------------+-----------------------------
 This problem is at least from boost_1_50_0
 Using gcc-4.1.2, but it has nothing to do with the bug.
 Platform Linux.

 All libs/thread/test modules that test n_avail are having race condition
 which make cause regression test to fail here :

 {{{
   void operator()()
   {
     BOOST_TEST(alive_ == 1);
     BOOST_TEST(n_alive == 1); // race condition error
     op_run = true;
   }
 }}}

 Rationale:

 When the G() object is being passed, copy constructor is used to copy the
 object. Then boost::detail::thread_data<G>::run() is executed and
 G::operator()() called.
 If this operator is called before the main thread calls ~G(), n_avail may
 be 2. It is a very rare case to have the new thread execute operator()()
 before the main thread, and that is why it is so difficult to catch it.

 Blessings,
 Greg.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7464>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:10 UTC