#19480 [Com]: register_shutdown_function causes Apache to hang

From: Date: Mon, 23 Sep 2002 17:25:58 +0000
Subject: #19480 [Com]: register_shutdown_function causes Apache to hang
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-20121@lists.php.net to get a copy of this message
ID: 19480 Comment by: colin@easydns.com Reported By: colin@easydns.com Status: Feedback Bug Type: Scripting Engine problem Operating System: Linux 2.4.6 PHP Version: 4CVS-2002-09-18 New Comment: Yeah, the current CVS seems to have fixed it. Dunno if this is important but ... when I stop the script in my browser, it's counted up to 568247, yet the email I get says it's counted to 584359. I don't have output buffering enabled. Previous Comments: ------------------------------------------------------------------------ [2002-09-22 14:53:24] iliaa@php.net Please try using this CVS snapshot: http://snaps.php.net/php4-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-latest.zip Unable to replicate on latest CVS w/ Apache 1.3.26. ------------------------------------------------------------------------ [2002-09-18 14:48:41] colin@easydns.com Take this script: <? function aborted() { global $i; mail('user@example.com', '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 this bug report at http://bugs.php.net/?id=19480&edit=1

« previous php.bugs (#20121) next »