Boost C++ Libraries: Ticket #6737: static boost::filesystem::path crashes with Debug mode https://svn.boost.org/trac10/ticket/6737 <pre class="wiki">static boost::filesystem::path FilePath = "FilePath"; </pre><p> When filesystem::path is used with static, application crashes on runtime. Release mode works correct. Using VS2010. Boost compiled with debug, static, multithread. </p> <p> It crashes with <strong>codecvt to wstring</strong> on <strong>xlocale</strong>. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6737 Trac 1.4.3 Beman Dawes Wed, 28 Mar 2012 12:06:18 GMT status changed https://svn.boost.org/trac10/ticket/6737#comment:1 https://svn.boost.org/trac10/ticket/6737#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> The problem also seems to involve other some uses of filesystem with static builds. As a first step to solving the problem, I'll expand testing to cover both your specific example and static builds in general. </p> <p> Thanks, </p> <p> --Beman </p> Ticket mjklaim@… Sun, 15 Apr 2012 09:39:46 GMT <link>https://svn.boost.org/trac10/ticket/6737#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6737#comment:2</guid> <description> <p> I have apparently the same problem using this line: </p> <pre class="wiki">const bfs::path AOSL_XSD_FILE = bfs::current_path() / "aosl.xsd"; </pre><p> With bfs namespace being boost::filesystem namespace. </p> <p> Full source is available there: <a class="ext-link" href="http://code.google.com/p/art-of-sequence/source/browse/tools/aosdesigner/Paths.cpp?r=d51b374de600ecc4f8829b5aeb9cfdcd50335096"><span class="icon">​</span>http://code.google.com/p/art-of-sequence/source/browse/tools/aosdesigner/Paths.cpp?r=d51b374de600ecc4f8829b5aeb9cfdcd50335096</a> </p> <p> Also, is it normal behavior that current_path() returns and empty string? Not sure if it's related. </p> </description> <category>Ticket</category> </item> <item> <author>mjklaim@…</author> <pubDate>Sun, 15 Apr 2012 09:45:23 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6737#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6737#comment:3</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/6737#comment:2" title="Comment 2">mjklaim@…</a>: </p> <p> Actually, in my case the same problem occurs in Debug and Release mode too, using VS2010, with static/multithreaded boost libraries. </p> </description> <category>Ticket</category> </item> <item> <author>mjklaim@…</author> <pubDate>Sun, 15 Apr 2012 09:54:01 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6737#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6737#comment:4</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/6737#comment:2" title="Comment 2">mjklaim@…</a>: </p> <p> In fact my problem is better described by <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6690" title="#6690: Bugs: access violation using global path object (closed: fixed)">#6690</a> . I'm trying to hunt why the codecvt() function returns a null object. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Beman Dawes</dc:creator> <pubDate>Sun, 15 Apr 2012 10:28:22 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6737#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6737#comment:5</guid> <description> <p> I'm working this issue today. Plan is to (1) revert 76303 and verify that fixes the initialization problems, and then (2) work on fixes to <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4889" title="#4889: Bugs: path locale-related functions are not thread-safe (closed: fixed)">#4889</a>, <a class="reopened ticket" href="https://svn.boost.org/trac10/ticket/6320" title="#6320: Bugs: race condition in boost::filesystem::path leads to crash when used in ... (reopened)">#6320</a>, codecvt_facet not thread safe on Windows, which will be reintroduced when 76303 is reverted. </p> <p> --Beman </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Beman Dawes</dc:creator> <pubDate>Sun, 15 Apr 2012 20:34:21 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/6737#comment:6 https://svn.boost.org/trac10/ticket/6737#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/78000" title="Fix #6690 and #6737, resolving static linking related problems with ...">[78000]</a>) Fix <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6690" title="#6690: Bugs: access violation using global path object (closed: fixed)">#6690</a> and <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6737" title="#6737: Bugs: static boost::filesystem::path crashes with Debug mode (closed: fixed)">#6737</a>, resolving static linking related problems with VC++ 8 through 11. Note that this fix may reintroduce codecvt thread safety problems <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4889" title="#4889: Bugs: path locale-related functions are not thread-safe (closed: fixed)">#4889</a>, <a class="reopened ticket" href="https://svn.boost.org/trac10/ticket/6320" title="#6320: Bugs: race condition in boost::filesystem::path leads to crash when used in ... (reopened)">#6320</a>, for these compilers if static linking is used. </p> Ticket erik.l.nelson@… Tue, 19 Jun 2012 21:25:35 GMT <link>https://svn.boost.org/trac10/ticket/6737#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6737#comment:7</guid> <description> <p> I'm running into this... will this make it into 1.50? Is the thread safety problem (<a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4889" title="#4889: Bugs: path locale-related functions are not thread-safe (closed: fixed)">#4889</a>, <a class="reopened ticket" href="https://svn.boost.org/trac10/ticket/6320" title="#6320: Bugs: race condition in boost::filesystem::path leads to crash when used in ... (reopened)">#6320</a>) re-fixed in 1.50? </p> </description> <category>Ticket</category> </item> <item> <author>henry@…</author> <pubDate>Fri, 06 Jul 2012 13:12:49 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6737#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6737#comment:8</guid> <description> <p> I am using 1.50 and vs2010 and am still seeing this problem. I may need to pull boost out of my project if I can't get past this very soon </p> </description> <category>Ticket</category> </item> <item> <author>raad@…</author> <pubDate>Mon, 27 Jun 2016 13:09:51 GMT</pubDate> <title>cc set https://svn.boost.org/trac10/ticket/6737#comment:9 https://svn.boost.org/trac10/ticket/6737#comment:9 <ul> <li><strong>cc</strong> <span class="trac-author">raad@…</span> added </li> </ul> Ticket