#39138 [Opn->Fbk]: LOCK_NB for flock() does not work
| From: | tony2001@php.net | Date: | Fri, 13 Oct 2006 13:43:17 +0000 |
| Subject: | #39138 [Opn->Fbk]: LOCK_NB for flock() does not work | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-103517@lists.php.net to get a copy of this message | ||
ID: 39138
Updated by: tony2001@php.net
Reported By: php at koterov dot ru
-Status: Open
+Status: Feedback
Bug Type: Filesystem function related
Operating System: Windows, Linux
PHP Version: 5.1.6
New Comment:
What kind of Server API do you use and is your web-server threaded or
not?
Where can I see the results? (as I'm unable to reproduce it locally)
Previous Comments:
------------------------------------------------------------------------
[2006-10-13 13:38:31] php at koterov dot ru
PHP 5.2.0RC6-dev (cli) (built: Oct 13 2006 12:22:44)
Bug is reproducible.
------------------------------------------------------------------------
[2006-10-13 08:34:14] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
------------------------------------------------------------------------
[2006-10-13 06:47:58] php at koterov dot ru
Ah, on Linux bug is reproducible at version 5.1.1. Sorry, I do not have
more recent test machine. On Windows - I've tested 5.1.6, bug is
reproducible.
------------------------------------------------------------------------
[2006-10-12 14:44:12] tony2001@php.net
Not reproducible on Linux.
------------------------------------------------------------------------
[2006-10-12 14:19:19] php at koterov dot ru
Description:
------------
<?php
@session_write_close(); // be on the safe side
$f = fopen('/tmp/f.lck', 'a+');
var_dump(flock($f, LOCK_EX | LOCK_NB, $w));
var_dump($w);
sleep(5);
?>
When I run this script concurrently, all results are same: "bool(true)
int(0)". Seems LOCK_NB simply ignored.
P.S.
There is a lot of same bugs (e.g., http://bugs.php.net/bug.php?id=31363
etc.), but they are closed or outdated.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39138&edit=1