The same bug with rand(10000000) function call who returned only 32768
various values.
See that http://bugs.activestate.com/show_bug.cgi?id=84937
Describe the bug:
rand(10000000) generate only 32768 various results.
Steps to reproduce this bug:
1. generate .pl script like that:
#!/usr/bin/perl
#12-10-2009 13-02
while (1){
if (time() eq "1255338173"){
last;
}else {
#print(time()."\n");
}
}
$tm=time();
while ($tm eq time()) {
print (rand(10000000)."\n");
}
2. Set your system time to 12-10-2009 13-02 and run .pl script with
redirect output stream to file. (C:\Straw-Perl\bin\perl.exe test.pl >>
C:\perl-rand\output.txt)
3. Count various results in output file. If you doubt repeat step 2.
Tested on Active Perl 1006, 638 and v5.10.0 built for MSWin32-x86-multi-
thread, Strawberry Perl v5.10.0 built for MSWin32-x86-multi-thread
(Filename strawberry-perl-5.10.0.6.msi)
!Cygwin perl is correct!
--
Best regards!
Vladimir Vorontsov
ONsec.ru:turn on security. Russian security team.
http://onsec.ru
Subject: | out-rand-undub.txt |
Message body is not shown because it is too large.