Boost C++ Libraries: Ticket #11873: boost::filesystem does not work on windows when multiple processes access the same junction (directory) https://svn.boost.org/trac10/ticket/11873 <p> Hi, </p> <p> I just upgraded to boost_1_60_0 ran into a regression on windows only, which I think is related to issue 9016. My windows tests are failing sporadically with the error: </p> <pre class="wiki">boost::filesystem::read_symlink: The process cannot access the file because it is being used by another process: "r:/data" </pre><p> Debugging this by comparing 1_60_0 to the earlier 1_56_0 I finally narrowed the difference to <code>operations.cpp: bool is_reparse_point_a_symlink</code>, which returns true in 1_60_0 but false in 1_56_0. The return value triggers <code>canonical</code> to call <code>detail::read_symlink</code>, which in turn ends up calling <code>::CreateFileW</code> with <code>dwShareMode</code> set to 0 so that the file/directory is locked and cannot be opened by another process. </p> <p> I am running my tests on LSF and many many processes end up accessing the same file / directory at the same time, thus leading the the above error message. </p> <p> I have not debugged enough to be able to suggest a fix or a work-around, but this bug currently prevents me from upgrading to boost_1_60_0. I am thinking that I can maybe revert the change to <code>is_reparse_point_a_symlink</code> in my installation so I can proceed with the upgrade, but I am worried that other changes have been made that depend on the current behavior. </p> <p> Thanks, </p> <p> Soren Soe </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11873 Trac 1.4.3 stsoe <stsoe@…> Sat, 26 Dec 2015 05:25:24 GMT version changed https://svn.boost.org/trac10/ticket/11873#comment:1 https://svn.boost.org/trac10/ticket/11873#comment:1 <ul> <li><strong>version</strong> <span class="trac-field-old">Boost 1.61.0</span> → <span class="trac-field-new">Boost 1.60.0</span> </li> </ul> Ticket emenchen@… Fri, 08 Jun 2018 15:45:39 GMT <link>https://svn.boost.org/trac10/ticket/11873#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11873#comment:2</guid> <description> <p> This problem still exists in 1.64. Make a link in Windows, and pass a path that includes the link to testBoost in the following: </p> <pre class="wiki">std::atomic&lt;int&gt; boostResult(0); void boostThread(const std::string&amp; _path) { try { boost::filesystem::path boostPath(_path); boost::filesystem::path canonicalFile = boost::filesystem::canonical(boostPath); std::string canonicalPath = canonicalFile.string(); //std::cout &lt;&lt; "canonicalPath: " &lt;&lt; canonicalPath &lt;&lt; std::endl; } catch (boost::filesystem::filesystem_error &amp;e) { std::cerr &lt;&lt; e.what() &lt;&lt; ", failed to resolve path" &lt;&lt; std::endl; ++boostResult; } catch (std::exception &amp;e) { std::cerr &lt;&lt; e.what() &lt;&lt; ", failed to resolve path" &lt;&lt; std::endl; ++boostResult; } } int testBoost(const std::string&amp; _path) { std::cout &lt;&lt; "Testing path: " &lt;&lt; _path &lt;&lt; std::endl; static const int numThreads(100); std::thread t[numThreads]; for (int i = 0; i &lt; numThreads; ++i) t[i] = std::thread(boostThread, _path); for (int i = 0; i &lt; numThreads; ++i) t[i].join(); std::cout &lt;&lt; "Boost result: " &lt;&lt; boostResult &lt;&lt; std::endl; return boostResult; } </pre><p> I did 5 runs and had between 8 and 14 failures each time. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Fri, 08 Jun 2018 15:52:45 GMT</pubDate> <title>version changed https://svn.boost.org/trac10/ticket/11873#comment:3 https://svn.boost.org/trac10/ticket/11873#comment:3 <ul> <li><strong>version</strong> <span class="trac-field-old">Boost 1.60.0</span> → <span class="trac-field-new">Boost 1.64.0</span> </li> </ul> Ticket emenchen@… Fri, 08 Jun 2018 17:11:06 GMT <link>https://svn.boost.org/trac10/ticket/11873#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11873#comment:4</guid> <description> <p> And the code is the same in 1.67 as well. </p> </description> <category>Ticket</category> </item> </channel> </rss>