|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57830 wrong storage class for variable in C function gsrgs()
Submitted: 2007-09-09 08:04 UTC Modified: 2016-05-28 05:21 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: hans at origin dot edvz dot uni-linz dot ac dot at Assigned: uchiyama (profile)
Status: Closed Package: stats (PECL)
PHP Version: 4.4.5 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
48 - 38 = ?
Subscribe to this entry?

 [2007-09-09 08:04 UTC] hans at origin dot edvz dot uni-linz dot ac dot at
in the sources of the PECL extension stats 1.0.2 we
need a 'static' storage class for the variable qinit:

File: stats-1.0.2/randlib.c
Function: void gsrgs(long getset,long *qvalue)

Original Code:
long qinit = 0;

Fixed Code:
/*MeJ: use static storage class ... otherwise 
       the value assigned to qinit gets lost upon
       return from function gsrgs()
static long qinit = 0;

Reproduce code:
stats_rand_setall ( 4711, 88888);
$val = stats_rand_gen_gamma ( 0.6, 0.1 );

Expected result:
$val should be assigned a random float value 

Actual result:
X-Powered-By: PHP/4.4.5
Content-type: text/html

 INITGN called before random number generator  initialized -- abort!


fix_randlib.c_add_static (last revision 2013-11-01 10:09 UTC by dev at example dot org)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-05-28 00:23 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: uchiyama
 [2016-05-28 05:21 UTC]
-Status: Assigned +Status: Closed
 [2016-05-28 05:21 UTC]
Fixed in version 1.0.4/2.0.2
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Nov 29 18:01:27 2023 UTC