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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: polone at townnews dot com
New email:
PHP Version: OS:

 

 [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: Sun Dec 22 02:01:28 2024 UTC