php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18542 Apache2 with ZTS produce weird result in rand() function
Submitted: 2002-07-24 11:49 UTC Modified: 2002-09-11 11:45 UTC
From: kehchen at cyber-village dot net Assigned:
Status: No Feedback Package: Apache2 related
PHP Version: 4.2.3-dev OS: Solaris
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: kehchen at cyber-village dot net
New email:
PHP Version: OS:

 

 [2002-07-24 11:49 UTC] kehchen at cyber-village dot 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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-24 20:13 UTC] sniper@php.net
Please try this snapshot:

http://snaps.php.net/php4-latest.tar.gz

 [2002-07-24 21:27 UTC] kehchen at cyber-village dot net
This php-latest snapshot is for Apache >= 2.0.40
  Should I try php4-STABLE-latest.tar.gz?
 [2002-07-25 01:35 UTC] derick@php.net
No, you should try apache 2.0.40-cvs and the latest NON-stable snapshot (http://snaps.php.net/php4-latest.tar.gz).

Derick
 [2002-09-11 11:45 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 01:01:30 2024 UTC