Skip Menu |

This queue is for tickets about the System-Command CPAN distribution.

Report information
The Basics
Id: 82857
Status: resolved
Priority: 0/
Queue: System-Command

People
Owner: Nobody in particular
Requestors: Yossi.Itzkovich [...] ecitele.com
Cc:
AdminCc:

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



Subject: System::Command 1.09 fails on Solaris
Date: Mon, 21 Jan 2013 16:04:31 +0200
To: "bug-System-Command [...] rt.cpan.org" <bug-System-Command [...] rt.cpan.org>
From: Yossi Itzkovich <Yossi.Itzkovich [...] ecitele.com>
Hi, Using System::Command 1.09 with Perl 5.16.0 on Solaris10 (i86pc) I get the following test failure: Running Build test # Tested System::Command 1.09, Perl 5.016000, /net/147.234.244.17/vol/sdh/ops_unixdev/software/i86pc/perl5.16.0/bin/perl t/00-load.t ....... ok t/01-load.t ....... ok t/10-command.t .... ok # DESTROY System::Command=HASH(0x842f398) # DESTROY System::Command=HASH(0x85b03d0) # DESTROY System::Command=HASH(0x85d94a8) # DESTROY System::Command=HASH(0x85b2ef0) # DESTROY System::Command=HASH(0x859f250) # DESTROY System::Command=HASH(0x85d99d8) # DESTROY System::Command=HASH(0x85947a0) t/15-scope.t ...... ok # Failed test 'child still alive' # at t/20-zombie.t line 33. # Failed test 'no exit status' # at t/20-zombie.t line 34. # got: '1' # expected: undef # $SIG{CHLD} = 'IGNORE' # Failed test 'child still alive' # at t/20-zombie.t line 57. # Failed test 'no exit status' # at t/20-zombie.t line 58. # got: '-1' # expected: undef # Failed test 'child still alive' # at t/20-zombie.t line 78. # Failed test 'no exit status' # at t/20-zombie.t line 79. # got: '-1' # expected: undef # Looks like you failed 6 tests of 28. Regards, Yossi This e-mail message is intended for the recipient only and contains information which is CONFIDENTIAL and which may be proprietary to ECI Telecom. If you have received this transmission in error, please inform us by e-mail, phone or fax, and then delete the original and all copies thereof.
Subject: [rt.cpan.org #82857] Bug confirmed
Date: Wed, 02 Jul 2014 13:42:59 +0200
To: bug-System-Command [...] rt.cpan.org
From: Wolfgang Pecho <pecho [...] belwue.de>
Hi, I tried to install System::Command in Sun Solaris 10 Sparc, perl 5.18.2 and ran into the same issue. Reason is waitpid() call in System::Command::Reaper::_reap(): 43 sub _reap { 44 my ( $self, @flags ) = @_; 45 my $pid = $self->{pid}; 46 47 # REPENT/THE END IS/EXTREMELY/FUCKING/NIGH 48 if ( my $reaped = waitpid( $pid, @flags ) and !exists $self->{exit} ) { 49 my $zed = $reaped == $pid; 50 carp "Child process already reaped, check for a SIGCHLD handler" 51 if !$zed && !$System::Command::QUIET && !MSWin32; 52 Using an array as second parameter for waitpid() does not work on Solaris even though it works on linux ... for whatever reason. Fixed it and sent a pull request to maintainer. Ciao Wolfgang
On Wed Jul 02 07:43:11 2014, pecho@belwue.de wrote: Show quoted text
> Hi, > > I tried to install System::Command in Sun Solaris 10 Sparc, perl 5.18.2 > and ran into the same issue. > Reason is waitpid() call in System::Command::Reaper::_reap(): > > 43 sub _reap { > 44 my ( $self, @flags ) = @_; > 45 my $pid = $self->{pid}; > 46 > 47 # REPENT/THE END IS/EXTREMELY/FUCKING/NIGH > 48 if ( my $reaped = waitpid( $pid, @flags ) and !exists > $self->{exit} ) { > 49 my $zed = $reaped == $pid; > 50 carp "Child process already reaped, check for a SIGCHLD > handler" > 51 if !$zed && !$System::Command::QUIET && !MSWin32; > 52 > > Using an array as second parameter for waitpid() does not work on > Solaris even though it > works on linux ... for whatever reason.
So perldoc -f waitpid says how it's meant to be used: waitpid PID,FLAGS (two arguments). In the code, it's always used as $self->_reap(WNOHANG); So, @flags always has a single element. And on most systems, WNOHANG == 1... In short, this has been accidentaly working for years. Thanks for providing the fix! I'm so ashamed... I'll do a release shortly. -- BooK