Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > #35340 : Apache2 needs 100% CPU when passed a float
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 10th June 07:56
php-bugs@lists.php.net (gggiuly at gmail dot
External User
 
Posts: 1
Default #35340 : Apache2 needs 100% CPU when passed a float



From: gggiuly at gmail dot com
Operating system: GNU/Linux
PHP version: 4.4.1
PHP Bug Type: Performance problem
Bug description: Apache2 needs 100% CPU when passed a float

Description:
------------
THe CPU-Usage raises to 98% when a float was passed to this function,
which definitifely shouldn't happen.

Can be fixed with stars((int) 4.7) but shouldn't

Reproduce code:
---------------
function stars($full) {
for($i=0; $i<$full; $i++)
$toRet .= '<img src="images/star1.gif" width="10" height="10"
border="0">';

for($i=$full;$i<5;$i++)
$toRet .= '<img src="images/star2.gif" width="10" height="10"
border="0">';

return $toRet;
}

stars(3.4);

Expected result:
----------------
4x star1.gif, 1x star2.gif

Actual result:
--------------
Apache raises CPU-Usage at 98%

--
Edit bug report at http://bugs.php.net/?id=35340&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=35340&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=35340&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=35340&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=35340&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=35340&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35340&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35340&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35340&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35340&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35340&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=35340&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=35340&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35340&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35340&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35340&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35340&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35340&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35340&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35340&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35340&r=mysqlcfg
  Reply With Quote


  sponsored links


2 10th June 07:56
tony2001
External User
 
Posts: 1
Default #35340 : Apache2 needs 100% CPU when passed a float



ID: 35340
Updated by: tony2001@php.net
Reported By: gggiuly at gmail dot com
-Status: Open
+Status: Feedback
-Bug Type: Performance problem
+Bug Type: Unknown/Other Function
Operating System: GNU/Linux
PHP Version: 4.4.1
New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.

Can't reproduce.


Previous Comments:
------------------------------------------------------------------------

[2005-11-22 21:38:03] gggiuly at gmail dot com

Description:
------------
THe CPU-Usage raises to 98% when a float was passed to this function,
which definitifely shouldn't happen.

Can be fixed with stars((int) 4.7) but shouldn't

Reproduce code:
---------------
function stars($full) {
for($i=0; $i<$full; $i++)
$toRet .= '<img src="images/star1.gif" width="10" height="10"
border="0">';

for($i=$full;$i<5;$i++)
$toRet .= '<img src="images/star2.gif" width="10" height="10"
border="0">';

return $toRet;
}

stars(3.4);

Expected result:
----------------
4x star1.gif, 1x star2.gif

Actual result:
--------------
Apache raises CPU-Usage at 98%


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


--
Edit this bug report at http://bugs.php.net/?id=35340&edit=1
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666