Skip Menu |

This queue is for tickets about the Crypt-Random CPAN distribution.

Report information
The Basics
Id: 6505
Status: resolved
Worked: 1 min
Priority: 0/
Queue: Crypt-Random

People
Owner: VIPUL [...] cpan.org
Requestors: cpan [...] niley.net
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.23
Fixed in: (no value)



Subject: make test fails on forbidden division t_REAL % t_INT
The following error occurs when i attempt to install Crypt::Random my perl version is v5.6.1, running on FreeBSD 4.10-PRERELEASE (Also tested on Debian (2.4.18-1-k7) with same results). Math::Pari is bang up to date. Running make test PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/local/lib/perl5/5.6.1/mach -I/usr/local/lib/perl5/5.6.1/BSDPAN -e 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t t/generator.........ok 1/18PARI: *** forbidden division t_REAL % t_INT. at /usr/local/lib/perl5/site_perl/5.6.1/mach/Math/Pari.pm line 978. t/generator.........dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 4-18 Failed 15/18 tests, 16.67% okay t/makerandom_itv....PARI: *** forbidden division t_REAL % t_INT. at /usr/local/lib/perl5/site_perl/5.6.1/mach/Math/Pari.pm line 978. t/makerandom_itv....dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 1-5 Failed 5/5 tests, 0.00% okay t/octet_string......ok t/pari_misfeature...PARI: *** forbidden division t_REAL % t_INT. at /usr/local/lib/perl5/site_perl/5.6.1/mach/Math/Pari.pm line 978. t/pari_misfeature...dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED test 1 Failed 1/1 tests, 0.00% okay t/random............ok Failed Test Status Wstat Total Fail Failed List of Failed -------------------------------------------------------------------------------- t/generator.t 255 65280 18 15 83.33% 4-18 t/makerandom_itv.t 255 65280 5 5 100.00% 1-5 t/pari_misfeature.t 255 65280 1 1 100.00% 1 Failed 3/5 test scripts, 40.00% okay. 21/27 subtests failed, 22.22% okay. *** Error code 2 Stop in /root/.cpan/build/Crypt-Random-1.23. /usr/bin/make test -- NOT OK Running make install make test had returned bad status, won't install without force
From: lakuehn [...] us.ibm.com
I get the same errors on Solaris 5.7 with perl 5.6.1 and Math::Pari up to date and configured with "machine=none". PERL_DL_NONLAZY=1 /usr/local/bin/perl -Iblib/arch -Iblib/lib -I/usr/local/lib/perl5/5.6.1/sun4-solaris -I/usr/local/lib/perl5/5.6.1 -e 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t t/generator..........ok 3/18PARI: *** forbidden division t_REAL % t_INT. at /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/Math/Pari.pm line 978. t/generator..........dubious Test returned status 9 (wstat 2304, 0x900) DIED. FAILED tests 4-18 Failed 15/18 tests, 16.67% okay t/makerandom_itv.....PARI: *** forbidden division t_REAL % t_INT. at /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/Math/Pari.pm line 978. t/makerandom_itv.....dubious Test returned status 9 (wstat 2304, 0x900) DIED. FAILED tests 1-5 Failed 5/5 tests, 0.00% okay t/octet_string.......ok t/pari_misfeature....PARI: *** forbidden division t_REAL % t_INT. at /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/Math/Pari.pm line 978. t/pari_misfeature....dubious Test returned status 9 (wstat 2304, 0x900) DIED. FAILED test 1 Failed 1/1 tests, 0.00% okay t/random.............ok Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------------- t/generator.t 9 2304 18 30 166.67% 4-18 t/makerandom_itv.t 9 2304 5 10 200.00% 1-5 t/pari_misfeature.t 9 2304 1 2 200.00% 1 Failed 3/5 test scripts, 40.00% okay. 21/27 subtests failed, 22.22% okay. *** Error code 11 make: Fatal error: Command failed for target `test_dynamic' [guest - Thu Jun 3 19:04:29 2004]: Show quoted text
> The following error occurs when i attempt to install Crypt::Random > my perl version is v5.6.1, running on FreeBSD 4.10-PRERELEASE (Also > tested on Debian (2.4.18-1-k7) with same results). Math::Pari is bang > up to date. > > Running make test > PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib > -I/usr/local/lib/perl5/5.6.1/mach -I/usr/local/lib/perl5/5.6.1/BSDPAN > -e 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests > @ARGV;' t/*.t > t/generator.........ok 1/18PARI: *** forbidden division t_REAL % > t_INT. at /usr/local/lib/perl5/site_perl/5.6.1/mach/Math/Pari.pm line > 978. > t/generator.........dubious > Test returned status 255 (wstat 65280, 0xff00) > DIED. FAILED tests 4-18 > Failed 15/18 tests, 16.67% okay > t/makerandom_itv....PARI: *** forbidden division t_REAL % t_INT. > at /usr/local/lib/perl5/site_perl/5.6.1/mach/Math/Pari.pm line 978. > t/makerandom_itv....dubious > Test returned status 255 (wstat 65280, 0xff00) > DIED. FAILED tests 1-5 > Failed 5/5 tests, 0.00% okay > t/octet_string......ok > t/pari_misfeature...PARI: *** forbidden division t_REAL % t_INT. > at /usr/local/lib/perl5/site_perl/5.6.1/mach/Math/Pari.pm line 978. > t/pari_misfeature...dubious > Test returned status 255 (wstat 65280, 0xff00) > DIED. FAILED test 1 > Failed 1/1 tests, 0.00% okay > t/random............ok > Failed Test Status Wstat Total Fail Failed List of Failed >
-------------------------------------------------------------------------------- Show quoted text
> t/generator.t 255 65280 18 15 83.33% 4-18 > t/makerandom_itv.t 255 65280 5 5 100.00% 1-5 > t/pari_misfeature.t 255 65280 1 1 100.00% 1 > Failed 3/5 test scripts, 40.00% okay. 21/27 subtests failed, 22.22% > okay. > *** Error code 2 > > Stop in /root/.cpan/build/Crypt-Random-1.23. > /usr/bin/make test -- NOT OK > Running make install > make test had returned bad status, won't install without force >
From: ian [...] znark.com
I have the same test errors on RHAS 2.1, with perl 5.6.1, Math::Pari 2.010501, and pari 2.1.5. Following the idea in bug #7247, I removed int() from makerandom_itv. This fixed the test errors. I have attached the patch.
diff -ubr Crypt-Random-1.23.bak/lib/Crypt/Random.pm Crypt-Random-1.23/lib/Crypt/Random.pm --- Crypt-Random-1.23.bak/lib/Crypt/Random.pm Thu Oct 21 15:44:47 2004 +++ Crypt-Random-1.23/lib/Crypt/Random.pm Thu Oct 21 15:45:30 2004 @@ -90,8 +90,9 @@ my $size = length ( $itv ) * 5; my $random = makerandom %params, Size => $size; + my $limit = PARI(2)**$size; do { $random = makerandom %params, Size => $size } - while ( $random >= int(PARI(2)**$size) - (int(PARI(2)**$size) % lift($b-$a))); + while ( $random >= $limit - ($limit % lift($b-$a))); $itv += $random; my $r = PARI ( lift ( $itv ) + $a );