php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23647 pcntl_fork() reruns forked script
Submitted: 2003-05-15 16:31 UTC Modified: 2003-05-15 18:10 UTC
From: polone at townnews dot com Assigned:
Status: Closed Package: *Extensibility Functions
PHP Version: 4.3.1 OS: Linux
Private report: No CVE-ID: None
 [2003-05-15 16:31 UTC] polone at townnews dot com
The following script:

<?php

echo "Hello!";
if (pcntl_fork()) {

   exit;

}

?>

Should produce only one "Hello!". The problem is that it appears to restart execution of the script, causing the text "Hello!" to appear twice.

This is _NOT_ how fork() works. The process should continue executing from where the pcntl_fork() function call was issued, and exit the parent process.

Is this related to SA_RESTART and changes made to restart signal handlers in PHP 4.3.0?

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-15 17:51 UTC] sniper@php.net
Seems to be fixed in CVS. (verify by trying the latest stable 
snapshot from http://snaps.php.net)

 [2003-05-15 18:10 UTC] polone at townnews dot com
Verified. This is working 4.3.2RC2.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 07 03:01:28 2024 UTC