Skip Menu |

This queue is for tickets about the Math-GMP CPAN distribution.

Report information
The Basics
Id: 5960
Status: resolved
Priority: 0/
Queue: Math-GMP

People
Owner: Nobody in particular
Requestors: jussi_mononen_ctl [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 2.03
Fixed in: 2.05



Subject: Math::GMP tests fail on 64-bit platforms
PERL_DL_NONLAZY=1 /vobs/prod/opensource/perl/SunOS/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/gmppm....ok 258/349# Test 277 got: '9999999999' (t/gmppm.t at line 117 fail #277) # Expected: '1410065407' # t/gmppm.t line 117 is: print "# Tried '$try'\n" if !ok("$ans1",$ans); # need "$ans1" due to bug t/gmppm....ok 259/349# Test 278 got: '99999999999' (t/gmppm.t at line 117 fail #278) # Expected: '1215752191' # Test 279 got: '999999999999' (t/gmppm.t at line 117 fail #279) # Expected: '3567587327' t/gmppm....ok 264/349# Test 284 got: '9999999999' (t/gmppm.t at line 117 fail #284) # Expected: '1410065407' t/gmppm....FAILED tests 277-279, 284 Failed 4/349 tests, 98.85% okay Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------------- t/gmppm.t 349 4 1.15% 277-279 284 Failed 1/1 test scripts, 0.00% okay. 4/349 subtests failed, 98.85% okay. To me it seems that the tests are desinged for 32-bit systems and the accuracy of 64-bit systems is too high, thus the expected and got results do not match. The library functions correctly at least when I need it. I'm using MAth::GMP as a part of Net::SFTP. --- I'm using : SunOS sol8dev 5.8 Generic_108528-14 sun4u sparc SUNW,Sun-Fire and my perl is: Summary of my perl5 (revision 5.0 version 8 subversion 3) configuration: Platform: osname=solaris, osvers=2.8, archname=sun4-solaris-thread-multi-64 uname='sunos sol8dev 5.8 generic_108528-14 sun4u sparc sunw,sun-fire ' config_args='-Dcc=cc -Duse64bitall -Dprefix=/vobs/prod/opensource/perl/SunOS' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=define use64bitall=define uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-D_REENTRANT -xarch=v9 -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O', cppflags='-D_REENTRANT -xarch=v9 -I/usr/local/include' ccversion='Sun WorkShop 6 update 1 C 5.2 2000/09/11', gccversion='', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=87654321 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc', ldflags =' -xarch=v9 -L/usr/lib/sparcv9 -L/usr/ccs/lib/sparcv9 -L/opt/SUNWspro/WS6U1/lib/v9 -L/usr/local/lib ' libpth=/usr/lib/sparcv9 /usr/ccs/lib/sparcv9 /opt/SUNWspro/WS6U1/lib/v9 /usr/local/lib /usr/lib /usr/ccs/lib libs=-lsocket -lnsl -ldl -lm -lpthread -lc perllibs=-lsocket -lnsl -ldl -lm -lpthread -lc libc=/usr/lib/sparcv9/libc.so, so=so, useshrplib=true, libperl=libperl.so gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -R /vobs/prod/opensource/perl/SunOS/lib/5.8.3/sun4-solaris-thread-multi-64/CORE' cccdlflags='-KPIC', lddlflags=' -G -xarch=v9 -L/usr/lib/sparcv9 -L/usr/ccs/lib/sparcv9 -L/opt/SUNWspro/WS6U1/lib/v9 -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY USE_ITHREADS USE_64_BIT_INT USE_64_BIT_ALL USE_LARGE_FILES PERL_IMPLICIT_CONTEXT Built under solaris Compiled at Mar 30 2004 15:09:51 @INC: /vobs/prod/opensource/perl/SunOS/lib/5.8.3/sun4-solaris-thread-multi-64 /vobs/prod/opensource/perl/SunOS/lib/5.8.3 /vobs/prod/opensource/perl/SunOS/lib/site_perl/5.8.3/sun4-solaris-thread-multi-64 /vobs/prod/opensource/perl/SunOS/lib/site_perl/5.8.3 /vobs/prod/opensource/perl/SunOS/lib/site_perl .
From: jussi_mononen_ctl [...] yahoo.com
Show quoted text
> SunOS sol8dev 5.8 Generic_108528-14 sun4u sparc SUNW,Sun-Fire > > and my perl is:
and compiler is gcc: Reading specs from /vobs/prod/tools/gnu/gcc/SunOS/lib/gcc-lib/sparc-sun-solaris2.8/3.3. 1/specs Configured with: ../configure --prefix=/vobs/prod/tools/gnu/gcc/SunOS --enable-threads=posix --disable-shared --disable-nls --enable-languages=c,c++ --enable-libstdcxx-v3 Thread model: posix gcc version 3.3.1
Oh forgot to mention that these errors happen at least in Compaq OSF1v5. 1b, SunOS 8, HP-UX.11.11
From: WendtJ
This also happens with x84_64 platforms
On Thu Feb 09 13:29:27 2006, guest wrote: Show quoted text
> This also happens with x84_64 platforms
That would be x86_64... apologies...
The actual reason for the failing tests is that the test suite assumes the size of an unsigned long is 4 bytes, which is wrong for 64 bit architectures. I wrote a patch that fixes that issue by including the expected values for 32 and 64 bit architectures and deciding on the size of of an unsigned long which of them to use. It's available at http://files.perldition.org/libmath-gmp-perl-2.04-ftbfs-64bit.diff I use this in the Debian packages of Math::GMP and it works well on all architectures Debian supports, as the build logs say: http://buildd.debian.org/build.php?&pkg=libmath-gmp-perl Regards, Flo
Show quoted text
> I wrote a patch that fixes that issue by including the expected values > for 32 and 64 bit architectures and deciding on the size of of an > unsigned long which of them to use.
This patch works great, thank you for attaching it to this bug. This ticket has now been open for four years. Is this module abandoned? Kind of sad how often I stumble across situations exactly like this on CPAN.
Rather than just complaining, I became co-maintainer of the module and patched the bug. :) Thanks very much for the patch, it seems to work great and is part of version 2.05.