apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Ruppert ...@myarm.com>
Subject Re: Deadlock with apr_file_open(APR_FOPEN_APPEND) and apr_file_lock() under Windows
Date Fri, 08 Oct 2010 12:21:11 GMT
Hi all,

I have filed a bug in bugzilla for this issue:

https://issues.apache.org/bugzilla/show_bug.cgi?id=50058

and added a patch which simple removes the calls to apr_file_lock() and 
apr_file_unlock()!

Please can some test this!?

Also I have found some more issues with apr_file_*() functions under 
Windows. I'll describe it in another mail.

Regards,
Stefan


Stefan Ruppert wrote:
> Hi all,
> 
> yesterday I ran into the following problem. I use the apr_file_lock() 
> function in conjunction with the APR_FOPEN_APPEND flag and 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.
> 
> First 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!
> 
> Any comments? Should I file a bug report?
> 
> Regards,
> Stefan
> 


Mime
View raw message