php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42381 Double-flock()ing a file crashes
Submitted: 2007-08-22 15:13 UTC Modified: 2007-08-23 01:00 UTC
From: phpbugs dot 20 dot zsh at spamgourmet dot com Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 5.2.3 OS: Windows XP
Private report: No CVE-ID: None
 [2007-08-22 15:13 UTC] phpbugs dot 20 dot zsh at spamgourmet dot com
Description:
------------
Double-flock()ing a file with different handles crashes. 

Reproduce code:
---------------
<?php
$fp = fopen('generic-textfile.txt', 'w');
flock($fp, LOCK_EX);
$fp2 = fopen('generic-textfile.txt', 'w');
flock($fp2, LOCK_EX);
echo 'Dun!';
?>

Expected result:
----------------
Dun!

Actual result:
--------------
Nothing

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-23 01:00 UTC] stas@php.net
Can't reproduce ceashing. What you probably seeing is php waiting on flock until it's killed by the timeout thread. 
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Nov 30 11:00:02 2025 UTC