Skip Menu |

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

Maintainer(s)' notes

The latest version is in https://github.com/danaj/Math-Prime-Util

    git clone --origin upstream git://github.com/danaj/Math-Prime-Util.git Math-Prime-Util

Comments, issues, and patches are welcome at either RT or github, or send me email.

Report information
The Basics
Id: 115817
Status: resolved
Worked: 4 hours (240 min)
Priority: 0/
Queue: Math-Prime-Util

People
Owner: DANAJ [...] cpan.org
Requestors: DCOLLINS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.58
Fixed in: 0.59



Subject: Test failures in quadmath/threading builds of 5.24 and 5.25
Hello: While performing smoketesting of CPAN modules using perl 5.24.0 through bleadperl, I noticed that tests for Math::Prime::Util seemed to hang. The relevant parts of my config are that this is a -DDEBUGGING perl, with quadmath, threads, and multiplicity. Full -V and test reports are attached. After the panic in t/31-threading, the test suite hangs and needs to be killed. Failures: Appears only in 5.25.0: t/11-primes.t ................ 1/124 Negative repeat count does nothing at /home/dcollins/.cpan/build/Math-Prime-Util-0.58-dY84ZQ/blib/lib/Math/Prime/Util/PP.pm line 413. Negative repeat count does nothing at /home/dcollins/.cpan/build/Math-Prime-Util-0.58-dY84ZQ/blib/lib/Math/Prime/Util/PP.pm line 413. # Failed test 'primes(inf,inf)' # at t/11-primes.t line 40. # Looks like you failed 1 test of 124. t/11-primes.t ................ Dubious, test returned 1 (wstat 256, 0x100) Failed 1/124 subtests Appears in all 5.24 and 5.25 series releases: t/28-pi.t .................... 1/4 # Failed test 'Pi(0) gives floating point pi' # at t/28-pi.t line 22. # got: '3.14159265358979323851280895940619' # expected: '3.1415926535897932384626433832795' # Failed test 'Pi(2 .. 50)' # at t/28-pi.t line 25. # Structures begin differing at: # $got->[0] = '3.10000000000000008881784197001252' # $expected->[0] = '3.1' # Looks like you failed 2 tests of 4. t/28-pi.t .................... Dubious, test returned 2 (wstat 512, 0x200) Failed 2/4 subtests Appears in all 5.24 and 5.25 series releases, and hangs immediately after printing this output: t/31-threading.t ............. 2/10 Thread 13 terminated abnormally: panic: free from wrong pool, 130c010!=25cfab0 at t/31-threading.t line 82. Use of uninitialized value in addition (+) at t/31-threading.t line 131. Perl -V and buildlogs attached. 5.24.0 looks just like 5.25.3. Math::MPFR is also failing on this platform, but since it is marked "optional", CPAN is still willing to test Math::Prime::Util. Unfortunately, CPAN::Testers reports aren't being sent due to the hanging test.
Subject: Math-Prime-Util-5.25.0-test.log
Download Math-Prime-Util-5.25.0-test.log
application/octet-stream 2.7k

Message body not shown because it is not plain text.

Subject: Math-Prime-Util-5.25.3-test.log
Download Math-Prime-Util-5.25.3-test.log
application/octet-stream 2.5k

Message body not shown because it is not plain text.

Subject: perl V.txt
dcollins@nightshade64:~$ perl5.25.3 -V Summary of my perl5 (revision 5 version 25 subversion 3) configuration: Commit id: ee4b19b959afbc7b1778ed123bdc8612e6fb0cd6 Platform: osname=linux osvers=4.6.0-1-amd64 archname=x86_64-linux-thread-multi-quadmath uname='linux nightshade64 4.6.0-1-amd64 #1 smp debian 4.6.1-1 (2016-06-06) x86_64 gnulinux ' config_args='-Dusedevel -Dprefix=/usr -Dcc=ccache gcc-6 -Duse64bitall -Doptimize=-O3 -Dversiononly -Uman1dir -Uman3dir -Dsiteprefix=/home/dcollins/toolchain/local -DDEBUGGING -Uuselongdouble -Dusequadmath -Dusethreads -Dusemultiplicity -des' hint=recommended useposix=true d_sigaction=define useithreads=define usemultiplicity=define use64bitint=define use64bitall=define uselongdouble=undef usemymalloc=n bincompat5005=undef Compiler: cc='ccache gcc-6' ccflags ='-D_REENTRANT -D_GNU_SOURCE -fwrapv -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' optimize='-O3 -g' cppflags='-D_REENTRANT -D_GNU_SOURCE -fwrapv -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include' ccversion='' gccversion='6.1.1 20160519' gccosandvers='' intsize=4 longsize=8 ptrsize=8 doublesize=8 byteorder=12345678 doublekind=3 d_longlong=define longlongsize=8 d_longdbl=define longdblsize=16 longdblkind=3 ivtype='long' ivsize=8 nvtype='__float128' nvsize=16 Off_t='off_t' lseeksize=8 alignbytes=16 prototype=define Linker and Libraries: ld='ccache gcc-6' ldflags =' -fstack-protector-strong -L/usr/local/lib' libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/6/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib libs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc -lquadmath perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc -lquadmath libc=libc-2.22.so so=so useshrplib=false libperl=libperl.a gnulibc_version='2.22' Dynamic Linking: dlsrc=dl_dlopen.xs dlext=so d_dlsymun=undef ccdlflags='-Wl,-E' cccdlflags='-fPIC' lddlflags='-shared -O3 -g -L/usr/local/lib -fstack-protector-strong' Characteristics of this binary (from libperl): Compile-time options: DEBUGGING HAS_TIMES MULTIPLICITY PERLIO_LAYERS PERL_COPY_ON_WRITE PERL_DONT_CREATE_GVSV PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP PERL_OP_PARENT PERL_PRESERVE_IVUV PERL_TRACK_MEMPOOL PERL_USE_DEVEL USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME USE_PERLIO USE_PERL_ATOF USE_QUADMATH USE_REENTRANT_API Built under linux Compiled at Jan 1 1970 00:00:00 @INC: /home/dcollins/toolchain/local/lib/perl5/site_perl/5.25.3/x86_64-linux-thread-multi-quadmath /home/dcollins/toolchain/local/lib/perl5/site_perl/5.25.3 /usr/lib/perl5/5.25.3/x86_64-linux-thread-multi-quadmath /usr/lib/perl5/5.25.3 .
So far I'm unable to get Perl 5.24.0 or 5.25.2 to build with -Dquadmath, gcc 5.3.1.
As Tony Cook pointed out on p5p, using longdouble and quadmath at the same time makes a complete mess of Perl's build. As you pointed out in an older bug report, among many other screwups, $] is bad, and this makes most of the modules fail. However, I built a system without longdouble but with quadmath. It does not pass build tests, but I installed it anyway. (making all of this a bit dubious IMO). I can reproduce the test results you have reported, and I'll look at them. The threading test has always been a huge pain, as it seems to usually be a test of Perl's threads rather than testing the module's ability to run threaded. When these tests fail they also often don't do so gracefully, as you've discovered. I may just move them to author tests.
Fixes are on github, and will go out in the next release. Thank you *very* much for reporting. - I tested with various long double configs (128-bit floats), and AIX had the longest mantissa. x86-64 gcc quadmath has even longer. Fixed t/11-primes.t. - Pi() and Pi(n) returns an NV if possible. It was set up for doubles and long doubles, not quads. Added #ifdef USE_QUADMATH to use Q suffix, FLT128_MANT_DIG, and strtoflt128. - Removed 3 of the threading tests. This looks like DEBUGGING is turning on PERL_TRACK_MEMPOOL, which makes Perl's New/Safefree require all frees to be on the same thread as the allocation. Arguably I should just use malloc/free here to skip the Perl layer, as this is internal.
Should be fixed in 0.59.