From: jbparsons at ucdavis dot edu Operating system: "unslung" - www.nslu2-linux.org PHP version: 5.0.4 PHP Bug Type: Reproducible crash Bug description: zend_strtod() broken on big-endian arm
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 bug report at http://bugs.php.net/?id=33227&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33227&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33227&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33227&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=33227&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=33227&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=33227&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=33227&r=needscript Try newer version: http://bugs.php.net/fix.php?id=33227&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=33227&r=support Expected behavior: http://bugs.php.net/fix.php?id=33227&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=33227&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=33227&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=33227&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33227&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=33227&r=dst IIS Stability: http://bugs.php.net/fix.php?id=33227&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=33227&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=33227&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=33227&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=33227&r=mysqlcfg