#23647 [NEW]: pcntl_fork() reruns forked script

From: Date: Thu, 15 May 2003 21:31:33 +0000
Subject: #23647 [NEW]: pcntl_fork() reruns forked script
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-39735@lists.php.net to get a copy of this message
From:             polone at townnews dot com
Operating system: Linux
PHP version:      4.3.1
PHP Bug Type:     Unknown/Other Function
Bug description:  pcntl_fork() reruns forked script

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?
-- 
Edit bug report at http://bugs.php.net/?id=23647&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=23647&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=23647&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=23647&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=23647&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=23647&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=23647&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=23647&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=23647&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=23647&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=23647&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23647&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=23647&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=23647&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=23647&r=gnused



Thread (3 messages)

« previous php.bugs (#39735) next »