PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Date and Time » Date » Bug #9417

Date::Date_Span infinite loop PHP 5.1.6

Details

Submitted2006-11-22 18:26 UTC
Frombrian at icweb dot com
Assignedfirman
StatusClosed
PackageDate
PHP Version5.1.6
OSOpenSuse 10.0
Roadmaps(Not assigned)

Comments

[2006-11-22 18:26 UTC] brian at icweb dot com

Description:
------------
Here is a link to a page that displays phpinfo() so that you have all the server info as far as kernel version, apache, php, zend optimizer and all the configure options when I installed php. http://zeus.truck.net/indextest.php
BTw: I started with php 5.1.2 upgraded to 5.1.6 and problem still persisted then upgraded PEAR to 1.4.7 and problem continued. I modified the code to follow it because this is a production server so I have to kill the httpd process before it eats all the memory and crashes the server (HD crashed on dev machine :( otherwise would be using it)

Anyway, short test script that uses Date::addSeconds to add 10 seconds. It does that but then keeps calling Date_Span(0,) over and over again until I kill the httpd process or it kills my server.

Note: if I place an exit(); statement after $this->set($time, $format); in Span::Date_Span it will not loop - but of course stops script execution
Count does not increase so I believe that it is creating copies of the class in a loop for one reason or another - guess due to changes in PHP5 Objects

Anyway hope you can help in some fashion.

Test script:
---------------
<?php
ini_set('include_path', '/home/www/Date-1.4.7/');
require_once 'Date.php';
$oStart = new Date();
echo ' oStart obj set'."<br>";
echo ' next calling oStart->addSeconds with val of 10'."<br>";
$oStart->addSeconds(10);
echo ' After the addSeconds process'
?>

Placed modified package at: http://zeus.truck.net/Date-1.4.7_mod.zip

so you can see where I placed the echo statements to follow the process.

Expected result:
----------------
with my half-brained debug echo's it should be -

oStart obj set
next calling oStart->addSeconds with val of 10
addSeconds(10) called
Calling $this->addSpan(new Date_Span($sec));
Date_Span(10, ) function called
Count: 1
After the addSeconds process

Actual result:
--------------
oStart obj set
next calling oStart->addSeconds with val of 10
addSeconds(10) called
Calling $this->addSpan(new Date_Span($sec));
Date_Span(10, ) function called
Count: 1
back at Date_Span function -
Date_Span(0, ) function called
Count: 1
back at Date_Span function -
Date_Span(0, ) function called
Count: 1
back at Date_Span function -
Date_Span(0, ) function called
Count: 1
back at Date_Span function -
Date_Span(0, ) function called
Count: 1
back at Date_Span function -
Date_Span(0, ) function called
Count: 1
back at Date_Span function -
Date_Span(0, ) function called
Count: 1
back at Date_Span function -
Date_Span(0, ) function called
Count: 1

and keeps going until killed or kills server (runs out of memory)

[2006-11-22 23:08 UTC] brian at icweb dot com

ok, I will try to rebuild my development machine and see if I can duplicate this issue on it.

If I can then I will try to do a backtrace as well.

Holiday weekend, but will let you know as soon as I find something out.

Thanks for looking into it.

Brian

[2006-11-27 17:43 UTC] brian at icweb dot com

Ok in php.ini I changed:
zend.ze1_compatibility_mode = On
to:
zend.ze1_compatibility_mode = Off

and my test script no longer appears to loop.

[2006-11-27 18:55 UTC] brian at icweb dot com

Problem appears to resolve when 4.0 compatibility is turned off in php.ini

Thanks for looking into it.

Brian