From:             tstarling at wikimedia dot org
Operating system: Windows
PHP version:      5.2.5
PHP Bug Type:     Feature/Change Request
Bug description:  Deadlock-free exec function

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

Reply via email to