Bug #18542: Apache2 with ZTS produce weird result in rand() function

From: Date: Wed, 24 Jul 2002 15:49:19 +0000
Subject: Bug #18542: Apache2 with ZTS produce weird result in rand() function
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-15058@lists.php.net to get a copy of this message
From: kehchen@cyber-village.net Operating system: Solaris PHP version: 4CVS-2002-07-24 PHP Bug Type: Apache2 related Bug description: Apache2 with ZTS produce weird result in rand() function I tried the php4-STABLE-200207240000 snapshot version in Solaris 8 with Apache 2.0.39. I have tried both apache2filter & cgi method, different result in below example: $randval = rand(1,1000); echo $randval . "\n"; in "cgi" mod, the result is always correct, return number between 1 - 1000, in "apache2filter" mod, the result always return 1. After doing some debug, found the problem in "rand.c" under "php_rand" function. In "apache2filter" mod, "ZTS" is defined and always call php_rand_r(). If I comment out and prevent calling php_rand_r(), the result is correct. -- Edit bug report at http://bugs.php.net/?id=18542&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=18542&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=18542&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=18542&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=18542&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=18542&r=support Expected behavior: http://bugs.php.net/fix.php?id=18542&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=18542&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=18542&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=18542&r=globals

« previous php.bugs (#15058) next »