Skip to content

BBC: Blead Breaks IO::All #18019

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

Closed
cjg-cguevara opened this issue Aug 2, 2020 · 9 comments
Closed

BBC: Blead Breaks IO::All #18019

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

Comments

@cjg-cguevara
Copy link

This is a bug report for perl from "Carlos Guevara" [email protected],
generated with the help of perlbug 1.42 running under perl 5.33.1.


[Please describe your issue here]

BBC: Blead Breaks IO::All

Please see http://fast-matrix.cpantesters.org/?dist=IO-All

[Please do not change anything below this line]


Flags:
category=core
severity=low

Site configuration information for perl 5.33.1:

Configured by cpan at Fri Jul 31 09:52:26 EDT 2020.

Summary of my perl5 (revision 5 version 33 subversion 1) configuration:
Commit id: b22e6ad
Platform:
osname=openbsd
osvers=6.7
archname=OpenBSD.amd64-openbsd-thread-multi
uname='openbsd cjg-openbsd6 6.7 generic#5 amd64 '
config_args='-des -Dprefix=/bin/perl-blead -Dscriptdir=/bin/perl-blead/bin -Dusedevel -Duse64bitall -Duseithreads'
hint=recommended
useposix=true
d_sigaction=define
useithreads=define
usemultiplicity=define
use64bitint=define
use64bitall=define
uselongdouble=undef
usemymalloc=n
default_inc_excludes_dot=define
bincompat5005=undef
Compiler:
cc='cc'
ccflags ='-pthread -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_FORTIFY_SOURCE=2'
optimize='-O2'
cppflags='-pthread -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 ='-pthread -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.96.0
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.33.1:
/home/cpan/bin/perl-blead/lib/site_perl/5.33.1/OpenBSD.amd64-openbsd-thread-multi
/home/cpan/bin/perl-blead/lib/site_perl/5.33.1
/home/cpan/bin/perl-blead/lib/5.33.1/OpenBSD.amd64-openbsd-thread-multi
/home/cpan/bin/perl-blead/lib/5.33.1


Environment for perl 5.33.1:
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

@karenetheridge
Copy link
Member

I see both passing and failing reports from your systems under 5.33.1. What was the difference between those perl builds? For example, knowing what commits you built each of those from would be helpful as a starting point for bisection.

@xenu
Copy link
Member

xenu commented Aug 2, 2020

perl -V output in the cpantesters reports contains the commit id. It seems that both failing linux reports are using 4a1bbd3 while the latest successful report was using f4b02d7.

@jkeenan
Copy link
Contributor

jkeenan commented Aug 2, 2020

This is a bug report for perl from "Carlos Guevara" [email protected],
generated with the help of perlbug 1.42 running under perl 5.33.1.

[Please describe your issue here]

BBC: Blead Breaks IO::All

Bisection points to this commit:

$ gitshowf 894d8b10212a906402f4db9f9aac9efe9fa084fd
commit 894d8b10212a906402f4db9f9aac9efe9fa084fd (HEAD, refs/bisect/bad)
Author:     Ryan Voots <[email protected]>
AuthorDate: Tue Nov 12 14:57:57 2019 -0500
Commit:     Karl Williamson <[email protected]>
CommitDate: Thu Jul 30 15:25:17 2020 -0600

    Small changes to test on bugzilla and improve compatibility

diff --git a/dist/Safe/Safe.pm b/dist/Safe/Safe.pm
index 1ed1ee9b19..44b0786c5c 100644
--- a/dist/Safe/Safe.pm
+++ b/dist/Safe/Safe.pm
@@ -67,7 +67,7 @@ require utf8;
 # particular code points don't cause it to load.
 # (Swashes are cached internally by perl in PL_utf8_* variables
 # independent of being inside/outside of Safe. So once loaded they can be)
-do { my $a = pack('U',0x100); $a =~ m/\x{1234}/; $a =~ tr/\x{1234}//; };
+do { my $a = pack('U',0x100); utf8->import; require 'utf8_heavy.pl' };
 # now we can safely include utf8::SWASHNEW in $default_share defined below.
 
 my $default_root  = 0;
diff --git a/dist/Safe/t/safeutf8.t b/dist/Safe/t/safeutf8.t
index c58f7e5ad1..cda98cba2c 100644

Here is the tail of the bisection output:

...
 /tmp/tHQHrLMkwM/lib/perl5/5.33.1/pod/perltooc.pod
  /tmp/tHQHrLMkwM/lib/perl5/5.33.1/pod/perltoot.pod
Can't locate utf8_heavy.pl in @INC (@INC contains: /home/jkeenan/.cpan /tmp/tHQHrLMkwM/lib/perl5/site_perl/5.33.1/x86_64-linux /tmp/tHQHrLMkwM/lib/perl5/site_perl/5.33.1 /tmp/tHQHrLMkwM/lib/perl5/5.33.1/x86_64-linux /tmp/tHQHrLMkwM/lib/perl5/5.33.1) at /tmp/tHQHrLMkwM/lib/perl5/5.33.1/Safe.pm line 70.
Compilation failed in require at /tmp/tHQHrLMkwM/lib/perl5/5.33.1/CPAN.pm line 57.
BEGIN failed--compilation aborted at /tmp/tHQHrLMkwM/lib/perl5/5.33.1/CPAN.pm line 57.
Compilation failed in require.
BEGIN failed--compilation aborted.
HEAD is now at 894d8b1021 Small changes to test on bugzilla and improve compatibility
bad - non-zero exit from /tmp/tHQHrLMkwM/bin/perl -I /home/jkeenan/.cpan -MCPAN::MyConfig -MCPAN -e $CPAN::Config->{build_dir}=q{/tmp/HPetnZKo4u}; -e install('IO::All'); die unless CPAN::Shell->expand(Module => 'IO::All')->uptodate;
894d8b10212a906402f4db9f9aac9efe9fa084fd is the first bad commit
commit 894d8b10212a906402f4db9f9aac9efe9fa084fd
Author: Ryan Voots <[email protected]>
Date:   Tue Nov 12 14:57:57 2019 -0500

    Small changes to test on bugzilla and improve compatibility

:040000 040000 bbc79ad1911370eccd62c230cafcd4d183ea8ab2 c4f6ec8cb549d7adf06840d5d7ec641cb5cdeadc M	dist
bisect run success
That took 1519 seconds.

@khwilliamson @simcop2387 Can you take a look?

Thank you very much.
Jim Keenan

@jkeenan jkeenan added BBC Blead Breaks CPAN - changes in blead broke a cpan module(s) and removed Needs Triage labels Aug 2, 2020
@Leont
Copy link
Contributor

Leont commented Aug 4, 2020

Bisection points to this commit: 894d8b1

That doesn't make sense, IO::All isn't using Safe.

@atoomic
Copy link
Member

atoomic commented Aug 4, 2020

all the most this change was reverted

@karenetheridge
Copy link
Member

It looks like the build failed at that commit, so the bisection script decided that this was the significant commit. Instead, that commit should be skipped during the bisection so it can resume and continue testing against IO::All.

@ppisar
Copy link
Contributor

ppisar commented Aug 6, 2020

This is triggered by:

commit 89341f87f9fc65c4d7133e497bb04586e86b8052
Author: Tony Cook <[email protected]>
Date:   Tue May 12 10:29:17 2020 +1000

    make $fh->error report errors from both input and output
    
    For character devices and sockets perl uses separate PerlIO objects
    for input and output so they can be buffered separately.
    
    The IO::Handle::error() method only checked the input stream, so
    if a write error occurs error() would still returned false.
    
    Change this so both the input and output streams are checked.
    
    fixes #6799

@ppisar
Copy link
Contributor

ppisar commented Aug 6, 2020

A reproducer:

$ perl -e 'open my $f, q{<}, q{/etc/hosts} or die; print qq{error\n} if $f->error'
error

It seems the patch breaks IO::Handle error() method for regular files.

ppisar added a commit to ppisar/perl5 that referenced this issue Aug 6, 2020
89341f8 fix for GH Perl#6799 introduced a regression when calling error()
on an IO::Handle object that was opened for reading a regular file:

$ perl -e 'open my $f, q{<}, q{/etc/hosts} or die; print qq{error\n} if $f->error'
error

In case of a regular file opened for reading, IoOFP() returns NULL and
PerlIO_error(NULL) reports -1. Compare to the case of a file opened
for writing when both IoIFP() and IoOFP() return non-NULL, equaled
pointer.

This patch fixes handling the case of the NULL output stream.

GH Perl#18019
khwilliamson pushed a commit that referenced this issue Aug 11, 2020
89341f8 fix for GH #6799 introduced a regression when calling error()
on an IO::Handle object that was opened for reading a regular file:

$ perl -e 'open my $f, q{<}, q{/etc/hosts} or die; print qq{error\n} if $f->error'
error

In case of a regular file opened for reading, IoOFP() returns NULL and
PerlIO_error(NULL) reports -1. Compare to the case of a file opened
for writing when both IoIFP() and IoOFP() return non-NULL, equaled
pointer.

This patch fixes handling the case of the NULL output stream.

GH #18019
khwilliamson added a commit that referenced this issue Aug 19, 2020
@jkeenan
Copy link
Contributor

jkeenan commented Sep 1, 2020

http://fast-matrix.cpantesters.org/?dist=IO-All;perl=5.33.2;reports=1 is showing all GREEN for IO::All. Closing this ticket.

Thank you very much.
Jim Keenan

@jkeenan jkeenan closed this as completed Sep 1, 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

7 participants