develooper Front page | perl.perl5.porters | Postings from May 2002

[PATCH] Math/BigInt/t/mbi_rand.t problems @16918

Thread Next
From:
Andy Dougherty
Date:
May 31, 2002 11:24
Subject:
[PATCH] Math/BigInt/t/mbi_rand.t problems @16918
Message ID:
Pine.SOL.4.10.10205311404400.11745-100000@maxwell.phys.lafayette.edu
On Solaris 8, with gcc-2.8.1, -Duse64bitint, I get failures for
lib/Math/BigInt/t/mbi_rand.t about 1/3 of the time.  (myconfig is below)

Every failure looks something like the following:

# seed: 24791
# Test 187 got: 'NaN' (../lib/Math/BigInt/t/mbi_rand.t at line 53 fail #94)
#     Expected: ''
# 7 23 23 23 7 9999999
# Test 188 got: 'NaN' (../lib/Math/BigInt/t/mbi_rand.t at line 58 fail #94)
#     Expected: '5353539497262626262626262626262626267979797979797979797979791313848484848484848484848484848484'
# 7 23 23 23 7 9999999

With the following patch, I can actually do the tests suggested by the
test script, though I haven't figured out what to do with the results
yet :-).

diff -r -u perl-current/lib/Math/BigInt/t/mbi_rand.t perl-andy/lib/Math/BigInt/t/mbi_rand.t
--- perl-current/lib/Math/BigInt/t/mbi_rand.t	Thu May 30 17:42:09 2002
+++ perl-andy/lib/Math/BigInt/t/mbi_rand.t	Fri May 31 13:44:55 2002
@@ -25,7 +25,8 @@
 # If you get a failure here, please re-run the test with the printed seed
 # value as input: perl t/mbi_rand.t seed
 
-my $seed = int(rand(65537)); print "# seed: $seed\n"; srand($seed);
+my $seed = ($#ARGV == 0) ? $ARGV[0] : int(rand(65537));
+print "# seed: $seed\n"; srand($seed);
 
 my ($A,$B,$As,$Bs,$ADB,$AMB,$la,$lb);
 my $two = Math::BigInt->new(2);


With that in place, I am running a more exhaustive test, but it's quite
slow :-(.  So far, for seeds of 0 through 245, I get that sort of failure 
for seeds of

3 7 38 40 54 55 79 85 94 99 100 102 120 128 175 179 189 203 226 234 241 244

Summary of my perl5 (revision 5.0 version 8 subversion 0 patch 16892) configuration:
  Platform:
    osname=solaris, osvers=2.8, archname=sun4-solaris-64int
    uname='sunos xxx 5.8 generic_108528-12 sun4u sparc sunw,ultra-5_10 '
    config_args='-Dprefix=/home/doughera/perl -Dusedevel -des -Dcc=gcc -Duse64bitint'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=define use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags ='-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O',
    cppflags='-I/usr/local/include'
    ccversion='', gccversion='2.8.1', gccosandvers='solaris2.6'
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=87654321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -lgdbm -ldl -lm -lc
    perllibs=-lsocket -lnsl -ldl -lm -lc
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'


-- 
    Andy Dougherty		doughera@lafayette.edu
    Dept. of Physics
    Lafayette College, Easton PA 18042


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About