php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25949 var_dump endless loops with NAN or INF float
Submitted: 2003-10-22 06:17 UTC Modified: 2003-10-22 09:40 UTC
From: alefor at gmx dot de Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.3.3 OS: Debian/unstable r3.01 GNU/Linux
Private report: No CVE-ID: None
 [2003-10-22 06:17 UTC] alefor at gmx dot de
Description:
------------
var_dump a float with inf/nan value lead to an endless loop.
Same result for cli php and for apache module.
GDB backtrace follows, taken suspending the endless loop execution.
(gdb) bt
#0  0x0810bd85 in ap_php_cvt ()
#1  0x0810bfd6 in ap_php_ecvt ()
#2  0x0810c05d in ap_php_gcvt ()
#3  0x0810c86a in ap_php_gcvt ()
#4  0x0810ccd6 in vspprintf ()
#5  0x08108ef8 in php_printf ()
#6  0x080e7507 in php_var_dump ()
#7  0x080e77a5 in zif_var_dump ()
#8  0x081400e7 in execute ()
#9  0x08133349 in zend_execute_scripts ()
#10 0x0810b5fd in php_execute_script ()

ap_php_cvt family is in main/snprintf.c file.

Reproduce code:
---------------
$str = "inf ";
$f = (float)$str;
var_dump($f);

Expected result:
----------------
Don't know. Maybe "float(INF)" ?

Actual result:
--------------
Endless loop. No output.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-22 06:29 UTC] alefor at gmx dot de
Simpler test code: var_dump((float)inf);
 [2003-10-22 09:40 UTC] sniper@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, 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/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Nov 27 18:01:25 2020 UTC