apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 51254] New: apr_dir_make_recursive can return "file exists"
Date Tue, 24 May 2011 08:49:22 GMT

             Bug #: 51254
           Summary: apr_dir_make_recursive can return "file exists"
           Product: APR
           Version: HEAD
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: APR
        AssignedTo: bugs@apr.apache.org
        ReportedBy: william.lee@rainstor.com
    Classification: Unclassified

Created attachment 27050
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27050
Proposed patch

If there are two calls to apr_dir_make_recursive happening on the same
non-existent path, at the same time, it can be that both instances call the
apr_dir_make function.  e.g.

thread 1 calls apr_dir_make_recursive on parent
thread 2 calls apr_dir_make_recursive on parent
thread 1 calls apr_dir_make (returns APR_SUCCESS)
thread 2 calls apr_dir_make (returns EEXIST)

In this case the second thread is returned EEXIST despite the documented
behaviour for the function being "No error will be reported if PATH already

This is a timing issue and so is relatively rare but has been observed within
our product during testing.  The problem can affect both simultaneous threads
or simultaneous processes and due to the nature of the code could happen on any

A proposed patch is attached.

Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org

View raw message