Subject: [Boost-bugs] [Boost C++ Libraries] #11166: boost::filesystem::remove is racy
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-04-03 19:52:14
#11166: boost::filesystem::remove is racy
-----------------------------------+------------------------
Reporter: Jeff Epler <jepler@â¦> | Owner: bemandawes
Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
Version: Boost 1.57.0 | Severity: Problem
Keywords: |
-----------------------------------+------------------------
As the attached program demonstrates (typically in way under 1s here), if
two threads or processes attempt to remove the same file, one of the
removers can get an exception because 'no such file or directory', even
though not existing at the time of the call is *not* an error condition
for remove.
I have only verified this bug to exist in 1.49 and 1.53, but I glanced at
github's boostorg/filesystem/blob/master/src/operations.cpp and it looks
like the same problem is likely to exist--namely, that remove_file can
fail because somebody else removed the file we were about to remove, after
we verified that the file existed via query_file_type.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11166> 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 : 2017-02-16 18:50:18 UTC