Boost C++ Libraries: Ticket #8930: boost::path::root_directory() throws locale::facet::_S_create_c_locale name not valid https://svn.boost.org/trac10/ticket/8930 <p> On Arch Linux with boost 1.54.0, I'm getting locale::facet::_S_create_c_locale name not valid when calling boost::path::root_directory() while LANG is set to a locale which is unlisted in locale -a. </p> <p> boost_file_system_test.cpp: </p> <pre class="wiki">#include &lt;boost/filesystem.hpp&gt; int main() { boost::filesystem::path("/abc").root_directory(); } </pre><p> Compiling, running and backtrace: </p> <pre class="wiki">$ g++ -std=c++0x -I/usr/include -lboost_filesystem -lboost_system -o boost_filesystem_test boost_file_system_test.cpp $ LANG=foo gdb boost_file_system_test ... terminate called after throwing an instance of 'std::runtime_error' what(): locale::facet::_S_create_c_locale name not valid Program received signal SIGABRT, Aborted. 0xb7fdd424 in __kernel_vsyscall () (gdb) bt #0 0xb7fdd424 in __kernel_vsyscall () #1 0xb7cbf256 in raise () from /usr/lib/libc.so.6 #2 0xb7cc09e3 in abort () from /usr/lib/libc.so.6 #3 0xb7eeb615 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/libstdc++.so.6 #4 0xb7ee9283 in ?? () from /usr/lib/libstdc++.so.6 #5 0xb7ee92bf in std::terminate() () from /usr/lib/libstdc++.so.6 #6 0xb7ee951e in __cxa_throw () from /usr/lib/libstdc++.so.6 #7 0xb7f41842 in std::__throw_runtime_error(char const*) () from /usr/lib/libstdc++.so.6 #8 0xb7f08138 in std::locale::facet::_S_create_c_locale(__locale_struct*&amp;, char const*, __locale_struct*) () from /usr/lib/libstdc++.so.6 #9 0xb7efc759 in std::locale::_Impl::_Impl(char const*, unsigned int) () from /usr/lib/libstdc++.so.6 #10 0xb7efd95a in std::locale::locale(char const*) () from /usr/lib/libstdc++.so.6 #11 0xb7f98e67 in boost::filesystem::path::codecvt() () from /usr/lib/libboost_filesystem.so.1.54.0 #12 0xb7f9ab4d in boost::filesystem::path::root_directory() const () from /usr/lib/libboost_filesystem.so.1.54.0 #13 0x08048ec7 in main () </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8930 Trac 1.4.3 Yaohan Chen <yaohan.chen@…> Fri, 26 Jul 2013 13:42:59 GMT component changed; owner set https://svn.boost.org/trac10/ticket/8930#comment:1 https://svn.boost.org/trac10/ticket/8930#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Beman Dawes</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">filesystem</span> </li> </ul> Ticket viboes Tue, 08 Oct 2013 17:44:30 GMT <link>https://svn.boost.org/trac10/ticket/8930#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8930#comment:2</guid> <description> <p> Is this related to <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8352" title="#8352: Bugs: Boost-filesystem std::runtime_error: locale::facet::_S_create_c_locale ... (closed: fixed)">#8352</a> Boost-filesystem std::runtime_error: locale::facet::_S_create_c_locale name not valid failure on OpenBSD? </p> </description> <category>Ticket</category> </item> <item> <author>Arseniy Ankudinov <afalin@…></author> <pubDate>Thu, 29 May 2014 12:51:01 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8930#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8930#comment:3</guid> <description> <p> Seems to be related to this on FreeBSD with LC_ALL!=C, boost-1_55_0 <br /> </p> <p> test.cpp: </p> <pre class="wiki">#include &lt;boost/filesystem.hpp&gt; int main() { const char *c = "/tmp/file"; boost::filesystem::path path(c,c+4); return 0; } </pre><p> Backtrace: </p> <pre class="wiki">#0 0x0000000801073a0c in kill () from /lib/libc.so.7 #1 0x000000080107263b in abort () from /lib/libc.so.7 #2 0x00000008012d0ea4 in __gnu_cxx::__verbose_terminate_handler () from /usr/lib/libsupc++.so.1 #3 0x00000008012d53a3 in std::set_unexpected () from /usr/lib/libsupc++.so.1 #4 0x00000008012d53e3 in std::terminate () from /usr/lib/libsupc++.so.1 #5 0x00000008012d534a in __cxa_throw () from /usr/lib/libsupc++.so.1 #6 0x00000008008fb8e2 in std::__throw_runtime_error () from /usr/lib/libstdc++.so.6 #7 0x00000008008fa96d in std::locale::facet::_S_create_c_locale () from /usr/lib/libstdc++.so.6 #8 0x0000000800882fdc in std::locale::_Impl::_Impl () from /usr/lib/libstdc++.so.6 #9 0x0000000800884ce9 in std::locale::locale () from /usr/lib/libstdc++.so.6 #10 0x00000000004061cc in boost::filesystem::path::codecvt () at libs/filesystem/src/path.cpp:911 #11 0x0000000000402d3a in boost::filesystem::path::path&lt;char const*&gt; (this=0x7fffffffdb58, begin=0x408d20 "/tmp/file", end=0x408d24 "/file") at path.hpp:167 #12 0x0000000000402bf5 in boost::filesystem::path::path&lt;char const*&gt; (this=0x7fffffffdb58, begin=0x408d20 "/tmp/file", end=0x408d24 "/file") at path.hpp:169 #13 0x0000000000402965 in main () at test.cpp:4 </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Beman Dawes</dc:creator> <pubDate>Thu, 29 May 2014 19:34:41 GMT</pubDate> <title>status changed https://svn.boost.org/trac10/ticket/8930#comment:4 https://svn.boost.org/trac10/ticket/8930#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> Just to be sure, does this also fail: </p> <blockquote> <p> #include &lt;boost/filesystem.hpp&gt; </p> </blockquote> <blockquote> <p> int main() { </p> <blockquote> <p> boost::filesystem::path path("/tmp"); </p> </blockquote> </blockquote> <blockquote> <blockquote> <p> return 0; </p> </blockquote> <p> } </p> </blockquote> <p> Thanks, </p> <p> --Beman </p> Ticket Arseniy Ankudinov <afalin@…> Fri, 30 May 2014 06:20:50 GMT <link>https://svn.boost.org/trac10/ticket/8930#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8930#comment:5</guid> <description> <p> No, this case passed successful on the same system. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Beman Dawes</dc:creator> <pubDate>Wed, 29 Oct 2014 13:15:43 GMT</pubDate> <title>status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/8930#comment:6 https://svn.boost.org/trac10/ticket/8930#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> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.57.0</span> </li> </ul> <p> Fixed for 1.57. Note that the fix was not in 1.57 beta 1, but should be in the final release. </p> <p> Thanks, </p> <p> --Beman </p> Ticket