Bug #79755 [Fbk->NoF]: Php process might hang on fatal error if proc from proc_open is not closed
| From: | php-bugs at lists dot php dot net | Date: | Sun, 12 Jul 2020 04:22:04 +0000 |
| Subject: | Bug #79755 [Fbk->NoF]: Php process might hang on fatal error if proc from proc_open is not closed | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-227976@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79755&edit=1
ID: 79755
Updated by: php-bugs@lists.php.net
Reported by: michael dot vorisek at email dot cz
Summary: Php process might hang on fatal error if proc from
proc_open is not closed
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: Scripting Engine problem
Operating System: Windows
PHP Version: 7.4.7
Assigned To: cmb
Private report: N
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2020-06-30 10:50:24] cmb@php.net
Well, without more detailed information this is unlikely
to be actionable. I mean there are certainly ways to
cause a the parent process to hang, which would not be a bug
in PHP, but rather in the userland script, e.g.
<?php
$descs = [['pipe', 'r'], ['pipe', 'w'], ['pipe',
'w']];
$proc = proc_open('php -r "echo str_repeat(\'*\', 10000);"', $descs,
$pipes);
set_error_handler(function () use ($pipes) {
fwrite($pipes[0], str_repeat('*', 10000));
});
trigger_error('error', E_USER_ERROR);
?>
The point is that anonymous pipes are always blocking on Windows,
what manifests if there is more data in the pipe than the pipe
manager is able to buffer[1].
[1] <https://devblogs.microsoft.com/oldnewthing/20110707-00/?p=10223>
------------------------------------------------------------------------
[2020-06-28 13:57:51] michael dot vorisek at email dot cz
Description:
------------
reproducible with quote complex code on Windows platform with PHP 7.4.7 NTS
issue has gone if processes were stopped properly in the script before a fatal error is thrown
php code needs to be checked, it seems, that after a fatal error not all child processes are
terminated properly
Test script:
---------------
// start several processes with proc_open and keep them running
// now throw some fatal error like with class with invalid method signature
// notice, that PHP process will not finish
Expected result:
----------------
php process finishes and there are no child processes left
Actual result:
--------------
php process hang
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79755&edit=1