Re: [Boost-bugs] [Boost C++ Libraries] #6320: creation of path from std::string on Windows (VC10) crashes (access error)

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #6320: creation of path from std::string on Windows (VC10) crashes (access error)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-11-07 16:57:26


#6320: creation of path from std::string on Windows (VC10) crashes (access error)
-------------------------------+------------------------
  Reporter: aris.basic@… | Owner: bemandawes
      Type: Bugs | Status: reopened
 Milestone: To Be Determined | Component: filesystem
   Version: Boost 1.60.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+------------------------

Comment (by stl):

 Just had 1.61.0 crash due to this issue and investigated a bit. The root
 of the problem is the initialization of a local static inside
 path_locale().

 See path.cpp line 925:

 {{{
 static std::locale loc(default_locale());
 }}}

 This obviously leads to a race between threads with compilers that do not
 implement thread-safe initialization of local statics. BTW, none of the
 MSVC compilers before VC2015 do implement this feature, which Microsoft
 likes to call "magic statics".

 So I did some tests with Visual Studio 2015 Update 3. I tested with the
 default v140 toolset and with the XP-compatibility toolset v140_xp. Here
 are the rather interesting results:

 v140 toolset: works fine.
 v140_xp toolset: race, crash and burn.

 If you step through the code compiled with v140, you can see the thread
 sync stubs that are automatically inserted by v140. Step through the same
 code compiled with v140_xp -> no thread sync stubs.

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