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

BBC: Blead Breaks Modern::Perl #17501

Closed
cjg-cguevara opened this issue Jan 27, 2020 · 3 comments
Closed

BBC: Blead Breaks Modern::Perl #17501

cjg-cguevara opened this issue Jan 27, 2020 · 3 comments
Labels
BBC Blead Breaks CPAN - changes in blead broke a cpan module(s)

Comments

@cjg-cguevara
Copy link

cjg-cguevara commented Jan 27, 2020

This is a bug report for perl from "Carlos Guevara" carlos@carlosguevara.com,
generated with the help of perlbug 1.41 running under perl 5.31.9.


[Please describe your issue here]

BBC: Blead Breaks Modern::Perl

Please see http://matrix.cpantesters.org/?dist=Modern-Perl

[Please do not change anything below this line]

Perl Info
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=low
---
Site configuration information for perl 5.31.9:

Configured by cpan at Mon Jan 27 17:02:33 CST 2020.

Summary of my perl5 (revision 5 version 31 subversion 9) configuration:
  Commit id: defa7a7ceabcb3fdc3e81b948a124b4f33bb6ec0
  Platform:
    osname=openbsd
    osvers=6.6
    archname=OpenBSD.amd64-openbsd
    uname='openbsd cjg-openbsd6 6.6 generic#4 amd64 '
    config_args='-des -Dprefix=~/bin/perl-blead -Dscriptdir=~/bin/perl-blead/bin -Dusedevel -Duse64bitall'
    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 ='-fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_FORTIFY_SOURCE=2'
    optimize='-O2'
    cppflags='-fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
    ccversion=''
    gccversion='4.2.1 Compatible OpenBSD Clang 8.0.1 (tags/RELEASE_801/final)'
    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 ='-Wl,-E  -fstack-protector-strong -L/usr/local/lib'
    libpth=/usr/lib /usr/local/lib
    libs=-lpthread -lm -lutil -lc
    perllibs=-lpthread -lm -lutil -lc
    libc=/usr/lib/libc.so.95.1
    so=so
    useshrplib=false
    libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=so
    d_dlsymun=undef
    ccdlflags=' '
    cccdlflags='-DPIC -fPIC '
    lddlflags='-shared -fPIC  -L/usr/local/lib -fstack-protector-strong'


---
@INC for perl 5.31.9:
    /home/cpan/bin/perl-blead/lib/site_perl/5.31.9/OpenBSD.amd64-openbsd
    /home/cpan/bin/perl-blead/lib/site_perl/5.31.9
    /home/cpan/bin/perl-blead/lib/5.31.9/OpenBSD.amd64-openbsd
    /home/cpan/bin/perl-blead/lib/5.31.9

---
Environment for perl 5.31.9:
    HOME=/home/cpan
    LANG (unset)
    LANGUAGE (unset)
    LC_ALL=C
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/cpan/bin/perl-blead/bin:/home/cpan/bin:/home/cpan/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/games
    PERL_BADLANG (unset)
    SHELL=/usr/local/bin/bash
@jkeenan
Copy link
Contributor

jkeenan commented Jan 28, 2020

This is a bug report for perl from "Carlos Guevara" carlos@carlosguevara.com,
generated with the help of perlbug 1.41 running under perl 5.31.9.

Error output:

[Modern-Perl-1.20190727] 28 $ make test
PERL_DL_NONLAZY=1 "/home/jkeenan/testing/blead/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/base.t .......... 1/? 
#   Failed test 'use Modern::Perl;'
#   at t/base.t line 10.
#     Tried to use 'Modern::Perl'.
#     Error:  Attempt to reload IO/File.pm aborted.
# Compilation failed in require at /home/jkeenan/.cpanm/work/1580178344.454/Modern-Perl-1.20190727/blib/lib/Modern/Perl.pm line 13.
# BEGIN failed--compilation aborted at /home/jkeenan/.cpanm/work/1580178344.454/Modern-Perl-1.20190727/blib/lib/Modern/Perl.pm line 13.
# Compilation failed in require at t/base.t line 10.
# BEGIN failed--compilation aborted at t/base.t line 10.
# Tests were run but no plan was declared and done_testing() was not seen.
t/base.t .......... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests 
t/odern.t ......... ok   
t/regressions.t ... ok    
t/unimport.t ...... ok   
t/year_imports.t .. ok    

Test Summary Report
-------------------
t/base.t        (Wstat: 256 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
  Parse errors: No plan found in TAP output
Files=5, Tests=112,  1 wallclock secs ( 0.04 usr  0.07 sys +  0.44 cusr  0.27 csys =  0.82 CPU)
Result: FAIL
Failed 1/5 test programs. 1/112 subtests failed.

This failure is not limited to OpenBSD (the OS on which @cjg-cguevara first detected the failure).

Bisection with this invocation:

perl Porting/bisect.pl --start=fd9c22e56536c51f0c621c365b440c3ca01c1ce4 \
--end=c30680823244b70a855267c5f99e9ffc0961cf1c \
--module=Modern::Perl

... points to the following commit:

4b004c43ef26ce175181122a7dfc3acd7dacb170 is the first bad commit
commit 4b004c43ef26ce175181122a7dfc3acd7dacb170
Author: Tony Cook <tony@develop-help.com>
Date:   Tue Jan 21 16:12:44 2020 +1100
Commit:     Tony Cook <tony@develop-help.com>
CommitDate: Mon Jan 27 10:23:08 2020 +1100

    always treat undef in %INC as a failed require
    
    Previously require would check for the specific \&PL_sv_undef
    SV in %INC, this meant that if %INC was copied, or undef
    assigned to a member the entry would erroneously be treated as if
    a previous require of that file was successful.
    
    So check for SvOK() instead, with appropriate magic tests.
    
    fixes #17428

@tonycoz, can you take a look?

Thank you very much.
Jim Keenan

@tonycoz
Copy link
Contributor

tonycoz commented Jan 29, 2020

It looks like the test in Moderl::Perl is broken.

It does the following:

use Test::More 0.98;
 
BEGIN
{
    local $INC{'IO/File.pm'};
    local $INC{'IO/Handle.pm'};
 
    use_ok( 'Modern::Perl' ) or exit;
    ok exists $INC{'IO/File.pm'},   'M::P should load IO::File';
    ok exists $INC{'IO/Handle.pm'}, 'M::P should load IO::Handle';
 
    Modern::Perl->import();
}

and from the "names" of the tests this is intended to make sure that loading Modern::Perl loads IO::File and IO::Handle, but that test is broken.

It uses local on the appropriate keys in %INC, but that does not remove the keys, it saves their values and replaces the SVs, making the keys undef.

This means that the existence tests will pass regardless, even if the keys didn't exist at all before that:

$ perl -le '{ local $INC{"IO/Foo.pm"}; print exists $INC{"IO/Foo.pm"} }'
1

What changed in 4b004c4 was the the undef is now treated as "failed to load" rather than "already loaded", and so require throws an error.

I'll post this as a bug to Modern::Perl. https://rt.cpan.org/Ticket/Display.html?id=131608

@xsawyerx
Copy link
Member

xsawyerx commented Feb 2, 2020

From the bug report:

Fixed in 1.20200201.

Thanks, @tonycoz, @chromatic. :)

@xsawyerx xsawyerx closed this as completed Feb 2, 2020
@jkeenan jkeenan added the BBC Blead Breaks CPAN - changes in blead broke a cpan module(s) label Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BBC Blead Breaks CPAN - changes in blead broke a cpan module(s)
Projects
None yet
Development

No branches or pull requests

4 participants