php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71437 pcntl_signal(SIGCHLD, SIG_IGN); dont work property
Submitted: 2016-01-23 23:15 UTC Modified: 2021-09-19 04:22 UTC
From: bupycnet at gmail dot com Assigned: cmb (profile)
Status: No Feedback Package: PCNTL related
PHP Version: 7.0.3RC1 OS: ArchLinux
Private report: No CVE-ID: None
 [2016-01-23 23:15 UTC] bupycnet at gmail dot com
Description:
------------
1. If i use it - sleep function dont work.
2. It if use it in class - its not work.



Test script:
---------------
		declare(ticks = 1);
		pcntl_signal(SIGCHLD, SIG_IGN);
		for($i=0;$i<300;$i++){
				$pid = pcntl_fork();
					if ($pid == -1) {
					     die('could not fork');
					} else if ($pid) {
					     	usleep(2500);
					} else {
					     	echo 'Child'.$i."\r\n";
					     	sleep(mt_rand(1,3));

					     	exit;
					}
		}
		echo 'Test123';
		sleep(60);
		echo 'Test456';

Expected result:
----------------
This script work withouts sleep

Actual result:
--------------
Sleep need work.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-07-15 23:15 UTC] dave at mudsite dot com
I'm not quite sure which sleep you're talking about that needs to exist, however, your test script doesn't seem to have any problems to me.  If you're using the sleep(60) to ensure that all children finish, you should be using pcntl_wait(), which will block until all children finish.
 [2016-12-25 20:50 UTC] dave at mudsite dot com
For what it's worth this could be related to Bug #73783 if you had compiled 7.0.3RC1 with zend-signals.  The problem with zend-signals does exist in v7.0.* but since it's an option you'd need to enable at configure time, it's less likely to have shown up.
 [2021-09-09 13:56 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-09-09 13:56 UTC] cmb@php.net
Is this still an issue with any of the actively supported PHP
versions[1]?

[1] <https://www.php.net/supported-versions.php>
 [2021-09-19 04:22 UTC] php-bugs at lists dot php dot net
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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC