Skip Menu |

This queue is for tickets about the Scriptalicious CPAN distribution.

Report information
The Basics
Id: 85999
Status: resolved
Priority: 0/
Queue: Scriptalicious

People
Owner: Nobody in particular
Requestors: CHORNY [...] cpan.org
gregoa [...] debian.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.16
Fixed in: (no value)



From: gregoa [...] cpan.org
Subject: libscriptalicious-perl: FTBFS with perl 5.18: test hang
This bug has been forwarded from http://bugs.debian.org/711614 -->-->-->-->-->-->-->-->-->-->-->-->-->-->-->-->-->-->-->--> Source: libscriptalicious-perl Version: 1.16-1 Severity: important User: debian-perl@lists.debian.org Usertags: perl-5.18-transition Tags: sid jessie This package FTBFS with perl 5.18 from experimental (in a clean sbuild session): t/03-yaml.t .......... ok make[1]: *** wait: No child processes. Stop. make[1]: *** Waiting for unfinished jobs.... make[1]: *** wait: No child processes. Stop. make: *** wait: No child processes. Stop. make: *** Waiting for unfinished jobs.... make: *** wait: No child processes. Stop. Build killed with signal TERM after 150 minutes of inactivity -- Dominic Hargreaves | http://www.larted.org.uk/~dom/ PGP key 5178E2A5 from the.earth.li (keyserver,web,email) <--<--<--<--<--<--<--<--<--<--<--<--<--<--<--<--<--<--<--<-- Thanks in advance, gregor herrmann, Debian Perl Group
From: ppisar [...] redhat.com
Dne So 08.čen.2013 16:54:40, GREGOA napsal(a): Show quoted text
> This bug has been forwarded from http://bugs.debian.org/711614 > > -->-->-->-->-->-->-->-->-->-->-->-->-->-->-->-->-->-->-->--> > > Source: libscriptalicious-perl > Version: 1.16-1 > Severity: important > User: debian-perl@lists.debian.org > Usertags: perl-5.18-transition > Tags: sid jessie > > This package FTBFS with perl 5.18 from experimental (in a clean sbuild > session): > > t/03-yaml.t .......... ok > make[1]: *** wait: No child processes. Stop. > make[1]: *** Waiting for unfinished jobs.... > make[1]: *** wait: No child processes. Stop. > make: *** wait: No child processes. Stop. > make: *** Waiting for unfinished jobs.... > make: *** wait: No child processes. Stop. > Build killed with signal TERM after 150 minutes of inactivity > >
Minimal reproducer: $ tail main.pl helper.pl ==> main.pl <== use Scriptalicious; my $output = capture( -in => sub { print "slopslopslop\n" }, -out => sub { my $foo = <STDIN>; # comment this out to suppress the bug }, $^X, "./helper.pl" ); ==> helper.pl <== while ( <STDIN> ) { print "got `$_'"; } $ strace -fq -e open,dup,dup2,fcntl,read,write,close,fork,clone,execve perl -Ilib ./main.pl [...] [pid 6973] open("./helper.pl", O_RDONLY) = 3 [pid 6973] fcntl(3, F_SETFD, FD_CLOEXEC) = 0 [pid 6973] read(3, "while ( <STDIN> ) {\n print \"g"..., 8192) = 44 [pid 6973] read(3, "", 8192) = 0 [pid 6973] close(3) = 0 [pid 6973] read(0, "slopslopslop\n", 8192) = 13 [pid 6973] read(0, ^C <detached ...> [test@fedora-21 Scriptalicious-1.16]$ main.pl: ERROR: Command `/usr/bin/perl ./helper.pl' killed by signal 2 Here you can see the helper.pl blocks on reading STDIN because Scriptalicious does not close the pipe if capture() -out routine does exhibits <STDIN>. If you comment the out the line, this bug will not render.
Curious. I don't see that on my Ubuntu desktop; I see: [pid 10788] read(3, "", 8192) = 0 [pid 10788] close(3) = 0 [pid 10788] read(0, "slopslopslop\n", 8192) = 13 [pid 10788] read(0, "", 8192) = 0 [pid 10788] write(1, "got `slopslopslop\n'", 19) = 19 [pid 10789] <... read resumed> "got `slopslopslop\n'", 8192) = 19 [pid 10788] +++ exited with 0 +++ [pid 10787] <... read resumed> 0xd382c0, 8192) = ? ERESTARTSYS (To be restarted if SA_RESTART is set) While I wait for perlbrew to build me a Perl 5.18.2, try this and tell me if it works: diff --git a/lib/Scriptalicious.pm b/lib/Scriptalicious.pm index a17f91e..c72f40a 100644 --- a/lib/Scriptalicious.pm +++ b/lib/Scriptalicious.pm @@ -951,8 +951,10 @@ sub setup_fds { if ( my $pid = fork ) { my $rw = ($mode eq ">" ? "W" : "R"); + my $wr = ($mode eq ">" ? "R" : "W"); open($fd, "$mode&FD${fnum}_$rw") or barf "failed to re-open fd $fnum $mode CODE; $!"; + close(\*{"FD${fnum}_$wr"}) } elsif ( !defined $pid ) { barf "fork failed; $!"; } else { PRs against github.com/samv/scriptalicious (heh, so old the repo name is lower case) will be returned in favor by CPAN releases. Cheers, Sam On Fri Mar 28 06:20:07 2014, ppisar wrote: Show quoted text
> Dne So 08.čen.2013 16:54:40, GREGOA napsal(a):
> > This bug has been forwarded from http://bugs.debian.org/711614 > > > > -->-->-->-->-->-->-->-->-->-->-->-->-->-->-->-->-->-->-->--> > > > > Source: libscriptalicious-perl > > Version: 1.16-1 > > Severity: important > > User: debian-perl@lists.debian.org > > Usertags: perl-5.18-transition > > Tags: sid jessie > > > > This package FTBFS with perl 5.18 from experimental (in a clean > > sbuild > > session): > > > > t/03-yaml.t .......... ok > > make[1]: *** wait: No child processes. Stop. > > make[1]: *** Waiting for unfinished jobs.... > > make[1]: *** wait: No child processes. Stop. > > make: *** wait: No child processes. Stop. > > make: *** Waiting for unfinished jobs.... > > make: *** wait: No child processes. Stop. > > Build killed with signal TERM after 150 minutes of inactivity > > > >
> > Minimal reproducer: > > $ tail main.pl helper.pl > ==> main.pl <== > use Scriptalicious; > > my $output = capture( > -in => sub { print "slopslopslop\n" }, > -out => sub { > my $foo = <STDIN>; # comment this out to suppress the bug > }, > $^X, "./helper.pl" > ); > > ==> helper.pl <== > while ( <STDIN> ) { > print "got `$_'"; > } > > $ strace -fq -e open,dup,dup2,fcntl,read,write,close,fork,clone,execve > perl -Ilib ./main.pl > [...] > [pid 6973] open("./helper.pl", O_RDONLY) = 3 > [pid 6973] fcntl(3, F_SETFD, FD_CLOEXEC) = 0 > [pid 6973] read(3, "while ( <STDIN> ) {\n print \"g"..., 8192) = > 44 > [pid 6973] read(3, "", 8192) = 0 > [pid 6973] close(3) = 0 > [pid 6973] read(0, "slopslopslop\n", 8192) = 13 > [pid 6973] read(0, > > ^C <detached ...> > [test@fedora-21 Scriptalicious-1.16]$ main.pl: ERROR: Command > `/usr/bin/perl ./helper.pl' killed by signal 2 > > Here you can see the helper.pl blocks on reading STDIN because > Scriptalicious does not close the pipe if capture() -out routine does > exhibits <STDIN>. If you comment the out the line, this bug will not > render.
From: ppisar [...] redhat.com
Dne Pá 28.bře.2014 16:04:57, SAMV napsal(a): Show quoted text
> Curious. I don't see that on my Ubuntu desktop; I see: > > [pid 10788] read(3, "", 8192) = 0 > [pid 10788] close(3) = 0 > [pid 10788] read(0, "slopslopslop\n", 8192) = 13 > [pid 10788] read(0, "", 8192) = 0 > [pid 10788] write(1, "got `slopslopslop\n'", 19) = 19 > [pid 10789] <... read resumed> "got `slopslopslop\n'", 8192) = 19 > [pid 10788] +++ exited with 0 +++ > [pid 10787] <... read resumed> 0xd382c0, 8192) = ? ERESTARTSYS (To be > restarted if SA_RESTART is set) >
Well, it does not fail for me all the time. However quite frequently (0.5). Show quoted text
> While I wait for perlbrew to build me a Perl 5.18.2, try this and tell > me if it works: > > diff --git a/lib/Scriptalicious.pm b/lib/Scriptalicious.pm > index a17f91e..c72f40a 100644 > --- a/lib/Scriptalicious.pm > +++ b/lib/Scriptalicious.pm > @@ -951,8 +951,10 @@ sub setup_fds { > > if ( my $pid = fork ) { > my $rw = ($mode eq ">" ? "W" : "R"); > + my $wr = ($mode eq ">" ? "R" : "W"); > open($fd, "$mode&FD${fnum}_$rw") > or barf "failed to re-open fd $fnum $mode CODE; $!"; > + close(\*{"FD${fnum}_$wr"}) > } elsif ( !defined $pid ) { > barf "fork failed; $!"; > } else { >
This patch fixes the issue for me. Even the whole test suite passes (300 consecutive runs). -- Petr
I have released Scriptalicious 1.17 with this fix to CPAN. The precise commit which triggered the error was this one: http://perl5.git.perl.org/perl.git/commitdiff/7dc8663964c6 I have to think quite creatively to guess how that happened. I'll consider that investigation out of scope for this :-)