in reply to Parallel ForkManager error with run_on_wait()

When using Parallel ForkManager 0.7.5 ... and maybe I discovered a bug?

Try the latest, try  cpan SZABGAB/Parallel-ForkManager-1.03.tar.gz

0.7.5 is over 10 years old

  • Comment on Re: Parallel ForkManager error with run_on_wait() (in 10 year old version)
  • Download Code

Replies are listed 'Best First'.
Re^2: Parallel ForkManager error with run_on_wait() (in 10 year old version)
by sojourn548 (Acolyte) on May 16, 2013 at 13:47 UTC

    That was one of my suspicions, so before I posted on PerlMonks, I downloaded and viewed the source for Parallel-ForkManager-1.03. The subs run_on_wait() and run_wait() hasn't changed, and I did not see any bug reports/changes related to the errors that I was seeing.. So I decided to post here to see if it was something that I was doing incorrectly.

      I downloaded and viewed the source

      How about you try running the code?

        Yes, testing it, and waiting to see if I get the same error.. It'll take a week or two to see if the process exits abnormally.

        Installed and tested with the Parallel ForkManager version 1.03 the code is still exiting abnormally in the same section of ForkManager.pm:

        Use of uninitialized value in block exit at /lib/site_perl/5.8.9/Paral +lel/ForkManager.pm line 599. Use of uninitialized value in block exit at /lib/site_perl/5.8.9/Paral +lel/ForkManager.pm line 599. Unable to create sub named "" at /lib/site_perl/5.8.9/Parallel/ForkMan +ager.pm line 599.
        587 sub run_on_wait { 588 my ($s,$code, $period)=@_; 589 590 $s->{on_wait}=$code; 591 $s->{on_wait_period} = $period; 592 } 593 594 sub on_wait { 595 my ($s)=@_; 596 597 if(ref($s->{on_wait}) eq 'CODE') { 598 $s->{on_wait}->(); 599 if (defined $s->{on_wait_period}) { 600 local $SIG{CHLD} = sub { } if ! defined $SIG{CHLD}; 601 select undef, undef, undef, $s->{on_wait_period} 602 }; 603 }; 604 };
        I have the same problem with both the old (0.7.5) and new (1.05) version of ForkManager. Obvious, the line numbers for the new version is different, so I get the following written to STDERR:
        Use of uninitialized value in block exit at .../perl5/Parallel/ForkMan +ager.pm line 601. Unable to create sub named "" at .../perl5/Parallel/ForkManager.pm lin +e 601.
        So, yes, the problem persists in hte new code. All hints/help is more than welcome, /Bjarne