From:             php at alishabeth dot com
Operating system: Ubuntu 9.04
PHP version:      5.2.9
PHP Bug Type:     Filesystem function related
Bug description:  flock blocks within function regardless of operation

Description:
------------
Placing flock() calls within a function seems to result in blocking
regardless of the operations specified.  The same exact code outside a
function behaves correctly.

This bug report wouldn't let me select the PHP version I'm running. 
Wasn't an option

Reproduce code:
---------------
http://alishabeth.com/lock-test.php.txt

Reproduced in the following builds:
$ php -v
PHP 5.1.6 (cli) (built: Apr  7 2009 08:00:18) 
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
    with eAccelerator v0.9.5.2, Copyright (c) 2004-2006 eAccelerator, by
eAccelerator


$ php -v
PHP 5.2.6-3ubuntu4.1 with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 23 2009
14:37:14) 
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
    with Xdebug v2.0.3, Copyright (c) 2002-2007, by Derick Rethans


Expected result:
----------------
Using the function always blocks

Actual result:
--------------
Flock should behave correctly within the function

-- 
Edit bug report at http://bugs.php.net/?id=48321&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=48321&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=48321&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=48321&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=48321&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=48321&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=48321&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=48321&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=48321&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=48321&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=48321&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=48321&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=48321&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=48321&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=48321&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=48321&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=48321&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=48321&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=48321&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=48321&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=48321&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=48321&r=mysqlcfg

Reply via email to