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

From: Date: Thu, 25 Jul 2002 05:35:14 +0000
Subject: Bug #18542 Updated: Apache2 with ZTS produce weird result in rand() function
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-15123@lists.php.net to get a copy of this message
ID: 18542 Updated by: derick@php.net Reported By: kehchen@cyber-village.net Status: Feedback Bug Type: Apache2 related Operating System: Solaris PHP Version: 4.2.3-dev New Comment: No, you should try apache 2.0.40-cvs and the latest NON-stable snapshot (http://snaps.php.net/php4-latest.tar.gz). Derick Previous Comments: ------------------------------------------------------------------------ [2002-07-24 21:27:00] kehchen@cyber-village.net This php-latest snapshot is for Apache >= 2.0.40 Should I try php4-STABLE-latest.tar.gz? ------------------------------------------------------------------------ [2002-07-24 20:13:57] sniper@php.net Please try this snapshot: http://snaps.php.net/php4-latest.tar.gz ------------------------------------------------------------------------ [2002-07-24 11:49:18] kehchen@cyber-village.net 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 this bug report at http://bugs.php.net/?id=18542&edit=1

« previous php.bugs (#15123) next »