From: tim at digicol dot de
Operating system: Linux 2.4 (SuSE SLES 8.1)
PHP version: 5.2.0
PHP Bug Type: Variables related
Bug description: is_numeric() timeout/infinite loop on long numeric strings
Description:
------------
Hi,
the example code is taking forever (i.e., not terminating at all) on one
of our Linux boxes:
uname -a
Linux dc5test 2.4.21-241-smp #1 SMP Tue Aug 10 15:55:34 UTC 2004 i686
unknown
cat /etc/SuSE-release
SuSE SLES-8 (i386)
VERSION = 8.1
php -i | grep configure
./configure --with-libxml-dir=/services/usr/bin
--prefix=/services/webserver/php/php-5.2.0
--with-db4=/services/database/db4/active --with-sqlite --enable-dba
--with-apxs2=/services/webserver/apache/active/bin/apxs --with-bz2
--with-dom --with-gd --with-iconv --enable-sockets --with-zlib
--disable-debug --enable-inline-optimization --enable-memory-limit
--enable-magic-quotes --enable-safe-mode --enable-sigchild --enable-pcntl
--with-oci8=/opt/oracle/product/9.2.0 --disable-ctype --without-mysql
--enable-cli --with-pear --enable-exif --enable-ftp --enable-mbstring
--with-libxml-dir=/services/usr
Changes compared to php.ini-recommended:
short_open_tag = On
memory_limit = 82M
error_log = /dot/dc/logs/php4_error.log
post_max_size = 64M
date.timezone = Europe/Berlin
browscap = /dot/dc/system/install/init/browscap.ini
session.save_path = "/tmp"
session.gc_divisor = 100
session.gc_maxlifetime = 43200
url_rewriter.tags = ""
mbstring.internal_encoding = UTF-8
The funny thing is that the same code runs fine on our other servers
(which run various 32bit and 64bit SuSE versions, but Linux 2.6 instead of
2.4).
I can work around this problem (and I don't really care whether
is_numeric() returns true or false in this case), but I thought you might
be interested anyway.
Thanks for your attention,
Tim
Reproduce code:
---------------
php -r 'echo is_numeric("16743175142160148228252851852361751021052084") .
"\n";'
Expected result:
----------------
1
Actual result:
--------------
[no result, script runs forever]
--
Edit bug report at http://bugs.php.net/?id=39814&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=39814&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=39814&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=39814&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=39814&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=39814&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=39814&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=39814&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=39814&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=39814&r=support
Expected behavior: http://bugs.php.net/fix.php?id=39814&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=39814&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=39814&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=39814&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39814&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=39814&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=39814&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=39814&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=39814&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=39814&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=39814&r=mysqlcfg