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 50058] New: Deadlock with apr_file_open(APR_FOPEN_APPEND) and apr_file_lock() under Windows
Date Fri, 08 Oct 2010 11:25:15 GMT

           Summary: Deadlock with apr_file_open(APR_FOPEN_APPEND) and
                    apr_file_lock() under Windows
           Product: APR
           Version: HEAD
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: major
          Priority: P2
         Component: APR
        AssignedTo: bugs@apr.apache.org
        ReportedBy: sr@myarm.com

Created an attachment (id=26137)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26137)
Example code to reproduce behavior under Windows

I ran into the following problem. I use the apr_file_lock() function in
conjunction with the APR_FOPEN_APPEND flag under Windwos and Linux. Under Linux
everything is fine.

Under Windows any attempt to write to the opened and locked file I get a
deadlock. This is due the fact that apr_file_write() creates an own lock with
apr_file_lock() if the file was opened with the APR_FOPEN_APPEND flag.

IMHO this is inconsistent through different operating systems Unix does not
lock, Windows does lock the file in append mode. However, I think the locking
in the Windows implementation is wrong. The user has to choose if he wants to
lock the file or not!

To reproduce the behavior please compile and test the attached example!

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