|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63172 Script hangs after max_execution_time (tzset)
Submitted: 2012-09-27 14:30 UTC Modified: 2018-01-13 11:41 UTC
From: Assigned: nikic (profile)
Status: Closed Package: Unknown/Other Function
PHP Version: 5.4.7 OS: GNU/Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
28 - 14 = ?
Subscribe to this entry?

 [2012-09-27 14:30 UTC]
As tzset functions is not async-signal-safe, nor safe to be longjmp'ed out, If a timeout occurs during soem glib call, with a lock set, the PHP script will hangs.

tzset should not be called during timeout management.

Attached patch solves this.

Test script:
ini_set('max_execution_time', '1');
echo "Playing with env. and tzset";
$tabs = timezone_identifiers_list();

while (true) {
	foreach ($tabs as $tab) {
	echo ".";

Must be run various time to reproduce

Expected result:
Script output "PHP Fatal error:  Maximum execution time of 1 second exceeded in..." and exit.

Actual result:
Script hangs after "PHP Fatal error:  Maximum execution time of 1 second exceeded in..."


tzset.patch (last revision 2012-09-27 14:30 UTC by remi)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-07-31 02:52 UTC]
It seems this is fixed in 5.5, but not in 5.4.
 [2018-01-13 11:41 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: nikic
 [2018-01-13 11:41 UTC]
If this hasn't been fixed by something else already, this problem should definitely be resolved in PHP 7.1, as PHP will no longer interrupt internal function calls on timeout.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 28 08:01:29 2024 UTC