Boost C++ Libraries: Ticket #1701: boost::filesystem::remove_all - segmentation fault with wpath on Linux https://svn.boost.org/trac10/ticket/1701 <p> Hi, </p> <p> I came across unexpectedly on the problem with boost::filesystem::remove_all and widechar-strings on the Linux and GCC. </p> <p> My compilation environment: </p> <ul><li>Fedora7; </li><li>gcc version 4.1.2 20070925 (Red Hat 4.1.2-27); </li><li>boost 1.34.1. </li></ul><p> The following test program leads segmentation fault at the line marked with "Boom!!!" comment. </p> <pre class="wiki">#include &lt;iostream&gt; #include &lt;boost/filesystem.hpp&gt; int main( int argc, char const * argv[] ) { namespace fs = boost::filesystem; // This doesn't work fs::wpath tempRoot = L"./temp1/temp2"; fs::wpath root = L"./temp1"; // This works. //fs::path tempRoot = "./temp1/temp2"; //fs::path root = "./temp1"; try { std::cerr &lt;&lt; "--- boost filesystem test --- " &lt;&lt; std::endl; bool bRes = fs::create_directories( tempRoot ); std::cerr &lt;&lt; "bRes: " &lt;&lt; bRes &lt;&lt; std::endl; if ( bRes ) { unsigned long n = fs::remove_all( root ); // &lt;- Boom!!! std::cerr &lt;&lt; "n: " &lt;&lt; n &lt;&lt; std::endl; } } catch ( std::exception const &amp; ex ) { std::cerr &lt;&lt; "Exception: " &lt;&lt; ex.what() &lt;&lt; std::endl; } return 0; } </pre><p> The source was compiled with following options: g++ -g boost_fs.cpp -I/usr/local/include/boost-1_34_1 -lboost_filesystem-gcc41-1_34_1 -o boost_fs.exe </p> <p> Note, the problem arises if Unicode string is used. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1701 Trac 1.4.3 Beman Dawes Tue, 29 Jun 2010 12:04:19 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1701#comment:1 https://svn.boost.org/trac10/ticket/1701#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> Filesystem Version 3 is a much better solution for internationalization problems, so I'm closing this ticket since it applies to version 2. </p> <p> Version 3 is scheduled to ship with 1.44, and is available in the trunk now. </p> <p> Please give version 3 a try, and report any problems. </p> <p> Thanks, </p> <p> --Beman </p> <p> </p> Ticket anonymous Tue, 29 Jun 2010 12:08:28 GMT <link>https://svn.boost.org/trac10/ticket/1701#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1701#comment:2</guid> <description> <p> Hm, I guess it's worth to make unit-test with mentioned above problem for version 3 as well... </p> </description> <category>Ticket</category> </item> </channel> </rss>