Re: [Boost-bugs] [Boost C++ Libraries] #11873: boost::filesystem does not work on windows when multiple processes access the same junction (directory)

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #11873: boost::filesystem does not work on windows when multiple processes access the same junction (directory)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2018-06-08 15:45:39


#11873: boost::filesystem does not work on windows when multiple processes access
the same junction (directory)
-------------------------------+----------------------------------------
  Reporter: stsoe <stsoe@…> | Owner: Beman Dawes
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: filesystem
   Version: Boost 1.60.0 | Severity: Regression
Resolution: | Keywords: symlink, junction, windows
-------------------------------+----------------------------------------

Comment (by emenchen@…):

 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:

 {{{
 std::atomic<int> boostResult(0);

 void boostThread(const std::string& _path)
 {
   try {
     boost::filesystem::path boostPath(_path);
     boost::filesystem::path canonicalFile =
 boost::filesystem::canonical(boostPath);
     std::string canonicalPath = canonicalFile.string();
     //std::cout << "canonicalPath: " << canonicalPath << std::endl;
   } catch (boost::filesystem::filesystem_error &e) {
     std::cerr << e.what() << ", failed to resolve path" << std::endl;
     ++boostResult;
   } catch (std::exception &e) {
     std::cerr << e.what() << ", failed to resolve path" << std::endl;
     ++boostResult;
   }
 }

 int testBoost(const std::string& _path)
 {
   std::cout << "Testing path: " << _path << std::endl;

   static const int numThreads(100);
   std::thread t[numThreads];

   for (int i = 0; i < numThreads; ++i)
     t[i] = std::thread(boostThread, _path);

   for (int i = 0; i < numThreads; ++i)
     t[i].join();

   std::cout << "Boost result: " << boostResult << std::endl;
   return boostResult;
 }
 }}}

 I did 5 runs and had between 8 and 14 failures each time.

-- 
Ticket URL: <https://svn.boost.org/trac10/ticket/11873#comment:2>
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 : 2018-06-08 15:51:19 UTC