Re: [Boost-bugs] [Boost C++ Libraries] #6320: race condition in boost::filesystem::path leads to crash when used in multithreaded programs

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #6320: race condition in boost::filesystem::path leads to crash when used in multithreaded programs
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-11-08 18:09:08


#6320: race condition in boost::filesystem::path leads to crash when used in
multithreaded programs
-------------------------------+-------------------------
  Reporter: aris.basic@… | Owner: bemandawes
      Type: Bugs | Status: reopened
 Milestone: To Be Determined | Component: filesystem
   Version: Boost 1.62.0 | Severity: Showstopper
Resolution: | Keywords:
-------------------------------+-------------------------

Comment (by stl):

 Replying to [comment:23 stl]:
> Some simplified code to reproduce the crash. As concurrency bugs are
 timing dependent, this will crash most of the time, but not always.
>
> {{{
> #include <boost/filesystem.hpp>
> #include <boost/thread.hpp>
>
> void thr()
> {
> boost::filesystem::path file(L"C:\\test");
> boost::this_thread::sleep(boost::posix_time::milliseconds(10));
> std::cout << file.string() << std::endl;
> }
>
>
> int main()
> {
> boost::thread_group tg;
> for (size_t n = 0; n < 5; ++n)
> {
> tg.create_thread(thr);
> }
> tg.join_all();
> return 0;
> }
>
> }}}

 Of course, this code is meant to reproduce the crash on Windows, where
 boost::filesystem::path uses wide characters natively, and thus must
 convert when using string().

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6320#comment:24>
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:20 UTC