Bug #21513 [Com]: shutdown functions not executed if timed out
Edit report at http://bugs.php.net/bug.php?id=21513&edit=1 ID: 21513 Comment by: reidrac at usebox dot net Reported by: ceeam at mail dot ru Summary: shutdown functions not executed if timed out Status: Closed Type: Bug Package: Scripting Engine problem Operating System: win32 (only) PHP Version: 4CVS, 5CVS Assigned To: zeev New Comment: I'm having the freeze problem in PHP 5.3.2 (was PASS in 5.3.1). Previous Comments: [2004-02-12 13:07:46] xuefer at 21cn dot com compiled under cygwin [Xuefer php4]$ ./sapi/cli/php.exe -v PHP 4.3.5RC3-dev (cli) (built: Feb 13 2004 01:29:25) Copyright (c) 1997-2004 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies [Xuefer php4]$ make test . PASS Testing register_shutdown_function() [tests/func/005.phpt] <<- freeze here it's running 005a.phpt [Xuefer php4]$ sapi/cli/php -d max_execution_time=1 -r 'set_time_limit(1); for(;;) {}' [Xuefer php4]$ sapi/cli/php test/func/005a.phpt both is frozen [2004-01-19 04:52:58] z...@php.net This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. [2003-08-04 00:24:07] wmeler at wp-sa dot pl This is related to http://bugs.php.net/bug.php?id=16820 (see comment from 21 Jul 2:46am CDT) You can find my patch at http://strony.wp.pl/wp/wmeler/. These are old issues ... [2003-01-22 22:44:36] sni...@php.net I can not reproduce this with PHP CGI/CLI/Apache DSO, but Steph tested the script under windows and got the same results as ce...@mail.ru did so this is definately a windows-only bug. [2003-01-22 02:09:49] ceeam at mail dot ru sni...@php.net: > This script works just fine for me (using CLI): > [skipped] I tested your script. The output is: PHP Fatal error: Maximum execution time of 1 second exceeded in c:\exp.php on line 16 PHP Fatal error: Maximum execution time of 1 second exceeded in c:\exp.php on line 7 "test.log" contains only one "Start" line. I tried with both my own (pretty much cleaned up) php.ini and "recommended" php.ini. I suspect it is only Windows-related problem. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/bug.php?id=21513 -- Edit this bug report at http://bugs.php.net/bug.php?id=21513&edit=1
#21513 [Com]: shutdown functions not executed if timed out
ID: 21513 Comment by: xuefer at 21cn dot com Reported By: ceeam at mail dot ru Status: Closed Bug Type: Scripting Engine problem Operating System: win32 (only) PHP Version: 4CVS, 5CVS Assigned To: zeev New Comment: compiled under cygwin [Xuefer php4]$ ./sapi/cli/php.exe -v PHP 4.3.5RC3-dev (cli) (built: Feb 13 2004 01:29:25) Copyright (c) 1997-2004 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies [Xuefer php4]$ make test . PASS Testing register_shutdown_function() [tests/func/005.phpt] <<- freeze here it's running 005a.phpt [Xuefer php4]$ sapi/cli/php -d max_execution_time=1 -r 'set_time_limit(1); for(;;) {}' [Xuefer php4]$ sapi/cli/php test/func/005a.phpt both is frozen Previous Comments: [2004-01-19 04:52:58] [EMAIL PROTECTED] This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. [2003-08-04 00:24:07] wmeler at wp-sa dot pl This is related to http://bugs.php.net/bug.php?id=16820 (see comment from 21 Jul 2:46am CDT) You can find my patch at http://strony.wp.pl/wp/wmeler/. These are old issues ... [2003-01-22 22:44:36] [EMAIL PROTECTED] I can not reproduce this with PHP CGI/CLI/Apache DSO, but Steph tested the script under windows and got the same results as [EMAIL PROTECTED] did so this is definately a windows-only bug. [2003-01-22 02:09:49] ceeam at mail dot ru [EMAIL PROTECTED]: > This script works just fine for me (using CLI): > [skipped] I tested your script. The output is: PHP Fatal error: Maximum execution time of 1 second exceeded in c:\exp.php on line 16 PHP Fatal error: Maximum execution time of 1 second exceeded in c:\exp.php on line 7 "test.log" contains only one "Start" line. I tried with both my own (pretty much cleaned up) php.ini and "recommended" php.ini. I suspect it is only Windows-related problem. [2003-01-20 22:47:06] [EMAIL PROTECTED] And this is related to http://bugs.php.net/bug.php?id=14542 (and maybe to http://bugs.php.net/bug.php?id=14251 ?) The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/21513 -- Edit this bug report at http://bugs.php.net/?id=21513&edit=1
#21513 [Com]: shutdown functions not executed if timed out
ID: 21513 Comment by: jsphp at kanargh dot force9 dot co dot uk Reported By: ceeam at mail dot ru Status: Assigned Bug Type: Scripting Engine problem Operating System: win32 (only) PHP Version: 4CVS, 5CVS Assigned To: zeev New Comment: HUP. Just came across this today. As the leading comment says, this is really bad for DB transactions. I had originally assumed that when a page dies for whatever reason, in the middle of an uncommitted transaction on a non-persistent pgsql connection, the transaction would be rolled back - but in fact it is implicitly committed. (So a series of many INSERTs will be half-complete, and you can't just hit Back and try again 'cos you'll get duplication.) This is bad enough - unclosed transactions ought not to be committed if you don't know whether they were complete or not - in fact only an explicitly coded COMMIT statement should change the database state. So I looked through the help and found register_shutdown_function, implemented one and relaxed again. Only to find that the timeout causes the shutdown function to abort too, so there doesn't appear to be any way to not balls up the database :-( Does PHP itself complete the transaction, or is it likely that PostgreSQL is doing this itself when the connection is dropped? If the former this is another bug in PHP, if the latter (which given the lack of PHP API support for transactions seems likely) I may well throw it over to their bugtracker too. But the register_shutdown_function issue does need fixing. Apache/2.0.48 (Win32) PHP/4.3.4 PostgreSQL 7.4.1 Previous Comments: [2003-08-04 00:24:07] wmeler at wp-sa dot pl This is related to http://bugs.php.net/bug.php?id=16820 (see comment from 21 Jul 2:46am CDT) You can find my patch at http://strony.wp.pl/wp/wmeler/. These are old issues ... [2003-01-22 22:44:36] [EMAIL PROTECTED] I can not reproduce this with PHP CGI/CLI/Apache DSO, but Steph tested the script under windows and got the same results as [EMAIL PROTECTED] did so this is definately a windows-only bug. [2003-01-22 02:09:49] ceeam at mail dot ru [EMAIL PROTECTED]: > This script works just fine for me (using CLI): > [skipped] I tested your script. The output is: PHP Fatal error: Maximum execution time of 1 second exceeded in c:\exp.php on line 16 PHP Fatal error: Maximum execution time of 1 second exceeded in c:\exp.php on line 7 "test.log" contains only one "Start" line. I tried with both my own (pretty much cleaned up) php.ini and "recommended" php.ini. I suspect it is only Windows-related problem. [2003-01-20 22:47:06] [EMAIL PROTECTED] And this is related to http://bugs.php.net/bug.php?id=14542 (and maybe to http://bugs.php.net/bug.php?id=14251 ?) [2003-01-20 22:44:38] [EMAIL PROTECTED] This script works just fine for me (using CLI): In test.log I have now: cut Start Shutdown - function 'foo' cut Which is the expected output. Can you try this script? The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/21513 -- Edit this bug report at http://bugs.php.net/?id=21513&edit=1
#21513 [Com]: shutdown functions not executed if timed out
ID: 21513 Comment by: wmeler at wp-sa dot pl Reported By: ceeam at mail dot ru Status: Assigned Bug Type: Scripting Engine problem Operating System: windows (only) PHP Version: 4.3.2 Assigned To: zeev New Comment: This is related to http://bugs.php.net/bug.php?id=16820 (see comment from 21 Jul 2:46am CDT) You can find my patch at http://strony.wp.pl/wp/wmeler/. These are old issues ... Previous Comments: [2003-06-15 17:52:24] [EMAIL PROTECTED] Seems to happen with PHP 5 too. :) [2003-06-15 17:47:06] sergio at libero dot it This bug is still present in version 4.3.2 :-( [2003-05-06 02:34:18] nut at tutu dot com Somebody DO FINALLY SOMETHING WITH THIS! Please! [2003-03-24 17:58:04] prac1 at dynawest dot cz The bug appears for both timeouts - by set_time_limit() and php.ini's max_execution_time. [2003-03-24 17:18:23] prac1 at dynawest dot cz I have Win2000 SP2, Apache 1.3.27, PHP 4.2.2 and 4.3.0, and using this the problem appears too. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/21513 -- Edit this bug report at http://bugs.php.net/?id=21513&edit=1
#21513 [Com]: shutdown functions not executed if timed out
ID: 21513 Comment by: sergio at libero dot it Reported By: ceeam at mail dot ru Status: Verified Bug Type: Scripting Engine problem Operating System: windows (only) PHP Version: 4.3.0 New Comment: This bug is still present in version 4.3.2 :-( Previous Comments: [2003-05-06 02:34:18] nut at tutu dot com Somebody DO FINALLY SOMETHING WITH THIS! Please! [2003-03-24 17:58:04] prac1 at dynawest dot cz The bug appears for both timeouts - by set_time_limit() and php.ini's max_execution_time. [2003-03-24 17:18:23] prac1 at dynawest dot cz I have Win2000 SP2, Apache 1.3.27, PHP 4.2.2 and 4.3.0, and using this the problem appears too. [2003-02-02 15:33:25] [EMAIL PROTECTED] tests/func/005a.phpt also failed with latestest win32 snap on W2k server. [2003-01-22 22:44:36] [EMAIL PROTECTED] I can not reproduce this with PHP CGI/CLI/Apache DSO, but Steph tested the script under windows and got the same results as [EMAIL PROTECTED] did so this is definately a windows-only bug. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/21513 -- Edit this bug report at http://bugs.php.net/?id=21513&edit=1
#21513 [Com]: shutdown functions not executed if timed out
ID: 21513 Comment by: prac1 at dynawest dot cz Reported By: ceeam at mail dot ru Status: Verified Bug Type: Scripting Engine problem Operating System: windows (only) PHP Version: 4.3.0 New Comment: The bug appears for both timeouts - by set_time_limit() and php.ini's max_execution_time. Previous Comments: [2003-03-24 17:18:23] prac1 at dynawest dot cz I have Win2000 SP2, Apache 1.3.27, PHP 4.2.2 and 4.3.0, and using this the problem appears too. [2003-02-02 15:33:25] [EMAIL PROTECTED] tests/func/005a.phpt also failed with latestest win32 snap on W2k server. [2003-01-22 22:44:36] [EMAIL PROTECTED] I can not reproduce this with PHP CGI/CLI/Apache DSO, but Steph tested the script under windows and got the same results as [EMAIL PROTECTED] did so this is definately a windows-only bug. [2003-01-22 02:09:49] ceeam at mail dot ru [EMAIL PROTECTED]: > This script works just fine for me (using CLI): > [skipped] I tested your script. The output is: PHP Fatal error: Maximum execution time of 1 second exceeded in c:\exp.php on line 16 PHP Fatal error: Maximum execution time of 1 second exceeded in c:\exp.php on line 7 "test.log" contains only one "Start" line. I tried with both my own (pretty much cleaned up) php.ini and "recommended" php.ini. I suspect it is only Windows-related problem. [2003-01-20 22:47:06] [EMAIL PROTECTED] And this is related to http://bugs.php.net/bug.php?id=14542 (and maybe to http://bugs.php.net/bug.php?id=14251 ?) The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/21513 -- Edit this bug report at http://bugs.php.net/?id=21513&edit=1
#21513 [Com]: shutdown functions not executed if timed out
ID: 21513 Comment by: prac1 at dynawest dot cz Reported By: ceeam at mail dot ru Status: Verified Bug Type: Scripting Engine problem Operating System: windows (only) PHP Version: 4.3.0 New Comment: I have Win2000 SP2, Apache 1.3.27, PHP 4.2.2 and 4.3.0, and using this the problem appears too. Previous Comments: [2003-02-02 15:33:25] [EMAIL PROTECTED] tests/func/005a.phpt also failed with latestest win32 snap on W2k server. [2003-01-22 22:44:36] [EMAIL PROTECTED] I can not reproduce this with PHP CGI/CLI/Apache DSO, but Steph tested the script under windows and got the same results as [EMAIL PROTECTED] did so this is definately a windows-only bug. [2003-01-22 02:09:49] ceeam at mail dot ru [EMAIL PROTECTED]: > This script works just fine for me (using CLI): > [skipped] I tested your script. The output is: PHP Fatal error: Maximum execution time of 1 second exceeded in c:\exp.php on line 16 PHP Fatal error: Maximum execution time of 1 second exceeded in c:\exp.php on line 7 "test.log" contains only one "Start" line. I tried with both my own (pretty much cleaned up) php.ini and "recommended" php.ini. I suspect it is only Windows-related problem. [2003-01-20 22:47:06] [EMAIL PROTECTED] And this is related to http://bugs.php.net/bug.php?id=14542 (and maybe to http://bugs.php.net/bug.php?id=14251 ?) [2003-01-20 22:44:38] [EMAIL PROTECTED] This script works just fine for me (using CLI): In test.log I have now: cut Start Shutdown - function 'foo' cut Which is the expected output. Can you try this script? The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/21513 -- Edit this bug report at http://bugs.php.net/?id=21513&edit=1
#21513 [Com]: shutdown functions not executed if timed out
ID: 21513 Comment by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Feedback Bug Type: Scripting Engine problem Operating System: WinXP PHP Version: 4.3.0 New Comment: [EMAIL PROTECTED]: > This script works just fine for me (using CLI): > [skipped] I tested your script. The output is: PHP Fatal error: Maximum execution time of 1 second exceeded in c:\exp.php on line 16 PHP Fatal error: Maximum execution time of 1 second exceeded in c:\exp.php on line 7 "test.log" contains only one "Start" line. I tried with both my own (pretty much cleaned up) php.ini and "recommended" php.ini. I suspect it is only Windows-related problem. Previous Comments: [2003-01-20 22:47:06] [EMAIL PROTECTED] And this is related to http://bugs.php.net/bug.php?id=14542 (and maybe to http://bugs.php.net/bug.php?id=14251 ?) [2003-01-20 22:44:38] [EMAIL PROTECTED] This script works just fine for me (using CLI): In test.log I have now: cut Start Shutdown - function 'foo' cut Which is the expected output. Can you try this script? [2003-01-08 02:53:17] [EMAIL PROTECTED] This problem is absolutely critical if you do DB cleanups, transactions processing or other similar things in shutdown functions. Can be especially bad if you need to commit/rollback transactions with persistent DB connections. -- -- Error message: Fatal error: Maximum execution time of 3 seconds exceeded in c:\exp.php on line 10 Fatal error: Maximum execution time of 3 seconds exceeded in c:\exp.php on line 4 Does not depend on whether we run script as CGI/SAPI or CLI. Report #14542 looks similar but is different IMHO. -- Edit this bug report at http://bugs.php.net/?id=21513&edit=1