Edit report at https://bugs.php.net/bug.php?id=63172&edit=1

 ID:                 63172
 Updated by:         yohg...@php.net
 Reported by:        r...@php.net
 Summary:            Script hangs after max_execution_time (tzset)
 Status:             Open
 Type:               Bug
 Package:            Unknown/Other Function
 Operating System:   GNU/Linux
 PHP Version:        5.4.7
 Block user comment: N
 Private report:     N

 New Comment:

It seems this is fixed in 5.5, but not in 5.4.


Previous Comments:
------------------------------------------------------------------------
[2012-09-27 14:30:09] r...@php.net

Description:
------------
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:
---------------
<?php
ini_set('max_execution_time', '1');
echo "Playing with env. and tzset";
$tabs = timezone_identifiers_list();

while (true) {
        foreach ($tabs as $tab) {
                putenv("TZ=$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..."


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=63172&edit=1

Reply via email to