Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.21] lazy_load_for_storable.t fails on Perl 5.28.1 #11

Closed
abraxxa opened this issue Jan 22, 2019 · 13 comments
Closed

[0.21] lazy_load_for_storable.t fails on Perl 5.28.1 #11

abraxxa opened this issue Jan 22, 2019 · 13 comments

Comments

@abraxxa
Copy link

abraxxa commented Jan 22, 2019

nac@nac-dev-debian9:~/.cpan/build/HTTP-Headers-Fast-0.21-2$ ./Build test
t/00_compile.t .............. ok   
t/01-compat.t ............... ok   
t/02-isa.t .................. ok   
t/as_string_without_sort.t .. ok   
t/charset.t ................. ok   
t/headers.t ................. ok       
t/headers_psgi_flatten.t .... ok     
t/lazy_load_for_storable.t .. 1/1 
#   Failed test at t/lazy_load_for_storable.t line 6.
#          got: '/home/nac/.plenv/versions/CIS-Debian9-Perl5.28.1/lib/perl5/site_perl/5.28.1/x86_64-linux/Storable.pm'
#     expected: undef
# Looks like you failed 1 test of 1.
t/lazy_load_for_storable.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests 

Test Summary Report
-------------------
t/lazy_load_for_storable.t (Wstat: 256 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
Files=8, Tests=195,  1 wallclock secs ( 0.05 usr  0.01 sys +  0.61 cusr  0.05 csys =  0.72 CPU)
Result: FAIL

Perl is fresh compiled on Debian 9 x86-64 using plenv and Perl::Build:

nac@nac-dev-debian9:~/.cpan/build/HTTP-Headers-Fast-0.21-2$ perl -V
Summary of my perl5 (revision 5 version 28 subversion 1) configuration:
   
  Platform:
    osname=linux
    osvers=4.9.0-8-amd64
    archname=x86_64-linux
    uname='linux nac-dev-debian9 4.9.0-8-amd64 #1 smp debian 4.9.130-2 (2018-10-27) x86_64 gnulinux '
    config_args='-Dprefix=/home/nac/.plenv/versions/CIS-Debian9-Perl5.28.1 -de -Dversiononly -Duserelocatableinc -A'eval:scriptdir=/home/nac/.plenv/versions/CIS-Debian9-Perl5.28.1/bin''
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=undef
    usemultiplicity=undef
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
    bincompat5005=undef
  Compiler:
    cc='cc'
    ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2'
    optimize='-O2'
    cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
    ccversion=''
    gccversion='6.3.0 20170516'
    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='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='cc'
    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
    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.24.so
    so=so
    useshrplib=false
    libperl=libperl.a
    gnulibc_version='2.24'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=so
    d_dlsymun=undef
    ccdlflags='-Wl,-E'
    cccdlflags='-fPIC'
    lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector-strong'


Characteristics of this binary (from libperl): 
  Compile-time options:
    HAS_TIMES
    PERLIO_LAYERS
    PERL_COPY_ON_WRITE
    PERL_DONT_CREATE_GVSV
    PERL_MALLOC_WRAP
    PERL_OP_PARENT
    PERL_PRESERVE_IVUV
    USE_64_BIT_ALL
    USE_64_BIT_INT
    USE_LARGE_FILES
    USE_LOCALE
    USE_LOCALE_COLLATE
    USE_LOCALE_CTYPE
    USE_LOCALE_NUMERIC
    USE_LOCALE_TIME
    USE_PERLIO
    USE_PERL_ATOF
  Locally applied patches:
    Devel::PatchPerl 1.52
  Built under linux
  Compiled at Jan 22 2019 14:32:10
  %ENV:
    PERL5LIB=""
    PERL5OPT=""
    PERL5_CPANPLUS_IS_RUNNING="5329"
    PERL5_CPAN_IS_RUNNING="5329"
  @INC:
    /home/nac/.plenv/versions/CIS-Debian9-Perl5.28.1/lib/perl5/site_perl/5.28.1/x86_64-linux
    /home/nac/.plenv/versions/CIS-Debian9-Perl5.28.1/lib/perl5/site_perl/5.28.1
    /home/nac/.plenv/versions/CIS-Debian9-Perl5.28.1/lib/perl5/5.28.1/x86_64-linux
    /home/nac/.plenv/versions/CIS-Debian9-Perl5.28.1/lib/perl5/5.28.1
@eserte
Copy link

eserte commented Jan 23, 2019

Actually it fails not only on 5.28.1, but also on systems with other perl version. Statistical analysis has a somewhat surprising candidate: it breaks if JSON 4.01 is installed (@charsbar FYI):

****************************************************************
Regression 'mod:JSON'
****************************************************************
Name           	       Theta	      StdErr	 T-stat
[0='const']    	      1.0000	      0.0000	15382621021888392.00
[1='eq_2.61']  	      0.0000	      0.0000	   1.80
[2='eq_2.90']  	      0.0000	      0.0000	   1.70
[3='eq_2.92']  	      0.0000	      0.0000	   1.76
[4='eq_2.93']  	      0.0000	      0.0000	   1.82
[5='eq_2.94']  	      0.0000	      0.0000	   1.70
[6='eq_2.97000']	      0.0000	      0.0000	   2.09
[7='eq_2.97001']	      0.0000	      0.0000	   1.71
[8='eq_4.00']  	      0.0000	      0.0000	   3.34
[9='eq_4.01']  	     -1.0000	      0.0000	-15239523762645772.00
[10='eq_n/a']  	      0.0000	      0.0000	   0.01

R^2= 1.000, N= 614, K= 11
****************************************************************

@eserte
Copy link

eserte commented Jan 23, 2019

After running the test suite on more smokers it does not look anymore that JSON 4.01 is responsible for the failure.

@charsbar
Copy link
Contributor

@eserte, thanks. I couldn't reproduce the issue with Perl 5.28.1 (built with plenv) or any other Perl versions with JSON 4.01 and various versions of JSON backends. Possible candidates in the Perl 5.28.1 core that may load Storable are Encode and Test2::IPC::Driver::Files, but I'm not sure if they are actually loaded somewhere.

@abraxxa
Copy link
Author

abraxxa commented Jan 23, 2019

My ansible playbook installs plenv, Perl::Build, uses that to install 5.28.1, updates all modules from CPAN and then installs this module as a dependency of Catalyst::Runtime.

@andk
Copy link

andk commented Jan 23, 2019

It's rather Test-Simple-1.302058-TRIAL where it started to fail for me.

@eserte
Copy link

eserte commented Jan 23, 2019

... but I get PASSes on some of my smokers with Test-Simple-1.302160

@eserte
Copy link

eserte commented Jan 23, 2019

Test::More may trigger a load of Storable.pm if some prereqs are met. Here's the call stack after running "require Test::More" with a breakpoint on loading Storable.pm:

@ = DB::DB called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/x86_64-linux/Storable.pm' line 11
$ = require 'Storable.pm' called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/x86_64-linux/Encode.pm' line 55
. = Encode::BEGIN() called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/x86_64-linux/Storable.pm' line 0
. = eval {...} called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/x86_64-linux/Storable.pm' line 0
$ = require 'Encode.pm' called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/x86_64-linux/Unicode/LineBreak.pm' line 21
. = Unicode::LineBreak::BEGIN() called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/x86_64-linux/Storable.pm' line 0
. = eval {...} called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/x86_64-linux/Storable.pm' line 0
$ = require 'Unicode/LineBreak.pm' called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/x86_64-linux/Unicode/GCString.pm' line 24
. = Unicode::GCString::BEGIN() called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/x86_64-linux/Storable.pm' line 0
. = eval {...} called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/x86_64-linux/Storable.pm' line 0
$ = require 'Unicode/GCString.pm' called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/Term/Table/Util.pm' line 98
. = Term::Table::Util::__ANON__[/opt/perl-5.26.2/lib/site_perl/5.26.2/Term/Table/Util.pm:98]() called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/Term/Table/Util.pm' line 17
$ = eval {...} called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/Term/Table/Util.pm' line 17
@ = Term::Table::Util::try(ref(CODE)) called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/Term/Table/Util.pm' line 98
$ = require 'Term/Table/Util.pm' called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/Term/Table/LineBreak.pm' line 9
. = Term::Table::LineBreak::BEGIN() called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/x86_64-linux/Storable.pm' line 0
. = eval {...} called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/x86_64-linux/Storable.pm' line 0
$ = require 'Term/Table/LineBreak.pm' called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/Term/Table/Cell.pm' line 7
. = Term::Table::Cell::BEGIN() called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/x86_64-linux/Storable.pm' line 0
. = eval {...} called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/x86_64-linux/Storable.pm' line 0
$ = require 'Term/Table/Cell.pm' called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/Term/Table.pm' line 7
. = Term::Table::BEGIN() called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/x86_64-linux/Storable.pm' line 0
. = eval {...} called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/x86_64-linux/Storable.pm' line 0
$ = require 'Term/Table.pm' called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/Test2/Formatter/TAP.pm' line 23
$ = eval {...} called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/Test2/Formatter/TAP.pm' line 23
. = Test2::Formatter::TAP::BEGIN() called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/x86_64-linux/Storable.pm' line 0
. = eval {...} called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/x86_64-linux/Storable.pm' line 0
$ = require 'Test2/Formatter/TAP.pm' called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/Test/Builder/Formatter.pm' line 7
. = Test::Builder::Formatter::BEGIN() called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/x86_64-linux/Storable.pm' line 0
. = eval {...} called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/x86_64-linux/Storable.pm' line 0
$ = require 'Test/Builder/Formatter.pm' called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/Test/Builder.pm' line 37
. = Test::Builder::BEGIN() called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/x86_64-linux/Storable.pm' line 0
. = eval {...} called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/x86_64-linux/Storable.pm' line 0
$ = require 'Test/Builder.pm' called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/Test/Builder/Module.pm' line 5
. = Test::Builder::Module::BEGIN() called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/x86_64-linux/Storable.pm' line 0
. = eval {...} called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/x86_64-linux/Storable.pm' line 0
$ = require 'Test/Builder/Module.pm' called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/Test/More.pm' line 22
. = Test::More::BEGIN() called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/x86_64-linux/Storable.pm' line 0
. = eval {...} called from file '/opt/perl-5.26.2/lib/site_perl/5.26.2/x86_64-linux/Storable.pm' line 0
$ = require 'Test/More.pm' called from file '(eval 8)[/opt/perl-5.26.2/lib/5.26.2/perl5db.pl:738]' line 2
@ = eval 'no strict; ($@, $!, $^E, $,, $/, $\\, $^W) = @DB::saved;package main; $^D = $^D | $DB::db_stop;
require Test::More;

@eserte
Copy link

eserte commented Jan 23, 2019

Maybe the test script should be defensive and expect that the other "use" statements in the script could load Storable itself. So a possible workaround could be (completely untested code):

...
use Test::More;
BEGIN {
    if ($INC{"Storable.pm"}) {
        plan skip_all => 'Storable already loaded by toolchain";
    }
}
use HTTP::Headers::Fast;
...
done_testing;

Another question is: shouldn't Test::More be as non-invasive as possible? Using only the minimal set of modules as possible?

@eserte
Copy link

eserte commented Jan 23, 2019

I can reproduce the failure with this command:

cpan_smoke_modules TOKUHIROM/HTTP-Headers-Fast-0.21.tar.gz -skiptestedfail -pre Unicode::GCString -pre Term::Table -pre Test::More -pre Encode

-pre means here: make the latest version of the named module available.

@charsbar
Copy link
Contributor

@eserte thanks, confirmed the failure.

@exodist
Copy link

exodist commented Feb 22, 2019

Another question is: shouldn't Test::More be as non-invasive as possible? Using only the minimal set of modules as possible?

It tries. It is a balancing act. Storable should only get loaded by Test::More/Builder if you use threads or load Test2::IPC (or something that needs one of these). Storable is used in the new IPC system which makes thread support significantly better than it used to be.

If you are encountering a situation where Storable is being loaded, but threads are not in use and you are not loading anything that should need IPC then that is probably a bug, and I would love to have it reported.

@karenetheridge
Copy link

karenetheridge commented Feb 22, 2019

For such a simple test, Test::More is not needed:

use strict;
use warnings;
use HTTP::Headers::Fast;

print "1..1\n";
my $storable = $INC{'Storable.pm'};
if (not defined $storable) {
    print "ok 1\n";
}
else {
    print "not ok 1\n";
    print STDERR "# expected undef, got '$storable'\n";
}

@digaev
Copy link

digaev commented Mar 19, 2019

Any news? I'm trying to install Request Tracker but run into this issue.

➜  ~ perl -MCPAN -e "install HTTP::Headers::Fast"
Reading '/home/nick/.local/share/.cpan/Metadata'
  Database was generated on Tue, 19 Mar 2019 05:17:03 GMT
Running install for module 'HTTP::Headers::Fast'
Checksum for /home/nick/.local/share/.cpan/sources/authors/id/T/TO/TOKUHIROM/HTTP-Headers-Fast-0.21.tar.gz ok
Configuring T/TO/TOKUHIROM/HTTP-Headers-Fast-0.21.tar.gz with Build.PL
Creating new 'Build' script for 'HTTP-Headers-Fast' version '0.21'
  TOKUHIROM/HTTP-Headers-Fast-0.21.tar.gz
  /usr/bin/perl Build.PL -- OK
Running Build for T/TO/TOKUHIROM/HTTP-Headers-Fast-0.21.tar.gz
cp lib/HTTP/Headers/Fast.pm blib/lib/HTTP/Headers/Fast.pm
  TOKUHIROM/HTTP-Headers-Fast-0.21.tar.gz
  ./Build -- OK
Running Build test for TOKUHIROM/HTTP-Headers-Fast-0.21.tar.gz
t/00_compile.t .............. ok   
t/01-compat.t ............... ok   
t/02-isa.t .................. ok   
t/as_string_without_sort.t .. ok   
t/charset.t ................. ok   
t/headers.t ................. ok       
t/headers_psgi_flatten.t .... ok     
t/lazy_load_for_storable.t .. 1/1 
#   Failed test at t/lazy_load_for_storable.t line 6.
#          got: '/usr/lib64/perl5/vendor_perl/Storable.pm'
#     expected: undef
# Looks like you failed 1 test of 1.
t/lazy_load_for_storable.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests 

Test Summary Report
-------------------
t/lazy_load_for_storable.t (Wstat: 256 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
Files=8, Tests=195,  1 wallclock secs ( 0.03 usr  0.00 sys +  0.59 cusr  0.05 csys =  0.67 CPU)
Result: FAIL
  TOKUHIROM/HTTP-Headers-Fast-0.21.tar.gz
  ./Build test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports TOKUHIROM/HTTP-Headers-Fast-0.21.tar.gz
➜  ~ perl -v

This is perl 5, version 28, subversion 1 (v5.28.1) built for x86_64-linux-thread-multi
(with 42 registered patches, see perl -V for more detail)

Copyright 1987-2018, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

theory added a commit to iovation/rpmcpan that referenced this issue Mar 29, 2019
Per discussion in tokuhirom/HTTP-Headers-Fast#11 and patch in
tokuhirom/HTTP-Headers-Fast#12, work around a test failure, at least until the
next release of HTTP::Headers::Fast.
tokuhirom added a commit that referenced this issue Apr 16, 2019
Skip lazy_load_for_storable.t if Storable is already loaded (fix #11, patch by Slaven Rezić)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants