Edit report at http://bugs.php.net/bug.php?id=43588&edit=1
ID: 43588 Comment by: obones at free dot fr Reported by: tstarling at wikimedia dot org Summary: Deadlock-free exec function Status: Open Type: Feature/Change Request Package: Feature/Change Request Operating System: Windows PHP Version: 5.2.5 Block user comment: N Private report: N New Comment: Hello, This would indeed be very convenient as right now it makes it very hard to understand why the server is down. There are numerous reports of the freeze/hands with exec() and Apache under windows, two of which are those: http://bugs.php.net/bug.php?id=44942 http://bugs.php.net/bug.php?id=44994 In my case, it's by using the SourceSVN plugin inside a Mantis installation that I stumbled across this very annoying behavior. While someone imports the latest SVN changes, nobody can work with Apache anymore which is very very annoying, especially the need to force close the server. Previous Comments: ------------------------------------------------------------------------ [2007-12-13 12:34:03] tstarling at wikimedia dot org Description: ------------ I would like to request the addition of a deadlock-free shell execution function to PHP on Windows. PHP already has one of these on the Linux platform, and I think it would be a useful addition to the Windows platform as well. PHP deadlocks whenever an exec function is called, if another thread is waiting for a file lock that the executing thread holds. This is the expected behaviour and is not a bug, see bug 42064. But some applications may benefit from the ability to call a shell execution function during a file-lock-protected critical section without risking a permanent deadlock of the participating threads. That is why I am making this feature request. Reproduce code: --------------- <?php if ( isset( $_REQUEST['f'] ) ) { $f = fopen( 'blah', 'w' ); flock( $f, LOCK_EX ); sleep( 1 ); passthru( "echo Hello" ); } else { $self = $_SERVER['SCRIPT_NAME']; echo <<<EOT <html> <frameset rows="50%, 50%"> <frame src="$self?f=1"/> <frame src="$self?f=2"/> </frameset> </html> EOT; } ?> Expected result: ---------------- The two frames should both display "Hello", after a delay of 2 seconds. Actual result: -------------- The frames take forever to load. Requires a force quit of Apache. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=43588&edit=1
