From:             [EMAIL PROTECTED]
Operating system: Linux 2.4.6
PHP version:      4CVS-2002-09-18
PHP Bug Type:     Scripting Engine problem
Bug description:  register_shutdown_function causes Apache to hang

Take this script:

<?

function aborted() {
        global $i;
        mail('[EMAIL PROTECTED]', 'aborted',
                'conn_status: ' . (int)connection_status() .
                "\nI counted to $i"
        );
        exit;
}

# register_shutdown_function('aborted');



$i = 0;
while (true) {
        echo $i++ . "\n";
        flush();
}

?>


If run as is, it works as expected: happily counting away until it times
out, or you abort the script.

If you uncomment the register_shutdown_function line and abort the script
part-way through, Apache doesn't seem to close the connection.  And, in
fact, all other Apache processes get "hung" up waiting for it.  Running
<i>apachectl server-status</i> shows this.

Let me know if you need more info.

(This was actually tested on 4.3.0-dev, built Aug 27 2002.  I'm getting
the current CVS version now, but I understand from other people that this
will still not function.)

- Colin
-- 
Edit bug report at http://bugs.php.net/?id=19480&edit=1
-- 
Try a CVS snapshot:  http://bugs.php.net/fix.php?id=19480&r=trysnapshot
Fixed in CVS:        http://bugs.php.net/fix.php?id=19480&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=19480&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=19480&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=19480&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=19480&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=19480&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=19480&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=19480&r=submittedtwice
register_globals:    http://bugs.php.net/fix.php?id=19480&r=globals

Reply via email to