ID: 33227
Updated by: [EMAIL PROTECTED]
Reported By: jbparsons at ucdavis dot edu
-Status: Open
+Status: Feedback
Bug Type: Reproducible crash
Operating System: "unslung" - www.nslu2-linux.org
PHP Version: 5.0.4
New Comment:
See lines 126-133 in zend_strtod.c
Previous Comments:
------------------------------------------------------------------------
[2005-06-03 03:44:43] jbparsons at ucdavis dot edu
Description:
------------
On big-endian arm systems, php sometimes crashes (infinite loop) inside
zend_strtod().
The problem seems to be the code at line 261 of zend_strtod.c, which
apparently assumes that every arm system has little-endian integers:
#if defined(IEEE_LITTLE_ENDIAN) + defined(VAX) + defined(__arm__)
#define Storeinc(a,b,c) (((unsigned short *)a)[1] = (unsigned short)b,
\
((unsigned short *)a)[0] = (unsigned short)c, a++)
#else
#define Storeinc(a,b,c) (((unsigned short *)a)[0] = (unsigned short)b,
\
((unsigned short *)a)[1] = (unsigned short)c, a++)
#endif
Reproduce code:
---------------
<?php
echo "start";
if ("79e88e6db0c25ca1ee5e2aac35a24d6c"
== "79e88e6db0c25ca1ee5e2aac35a24d6c")
{
echo "passed";
}
echo "end";
?>
Expected result:
----------------
startend
Actual result:
--------------
(gdb) run
Starting program: /share/hdd/data/home/jp30/t/php foo.php
start
[...minutes pass, then Ctrl-C is pressed...]
Program received signal SIGINT, Interrupt.
0x00146528 in zend_strtod ()
(gdb) bt
#0 0x00146528 in zend_strtod ()
Cannot access memory at address 0x4
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33227&edit=1