Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Proc-Fork CPAN distribution.

Report information
The Basics
Id: 23893
Status: rejected
Priority: 0/
Queue: Proc-Fork

People
Owner: ARISTOTLE [...] cpan.org
Requestors: m.nooning [...] comcast.net
Cc:
AdminCc:

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



Subject: Proc::Fork Parent never says good bye
Date: Mon, 11 Dec 2006 20:15:25 -0500
To: bug-Proc-Fork [...] rt.cpan.org
From: Malcolm Nooning <m.nooning [...] comcast.net>
Hello, The 23 lines of code pasted further below will demonstrate the problem. I am on Windows XP Home Edition, perl 5.8.8, Proc::Fork 0.11 installed with the Active State ppm. The code below hangs at the waitpid in the parent. I need to Control-C to get out of it. It also looks like there is a double fork going on, resulting in two parents and two children. Thanks -----------paste command line results C:\aaa>test_proc_fork.pl Parent says hello Child is sleeping Child is awake Parent says hello Child is sleeping Child is awake -----------End paste command line results ----------paste code use Proc::Fork; parent { my $child = shift; print "Parent says hello\n"; waitpid ($child,0); print "Parent says good bye\n"; } child { print "Child is sleeping\n"; sleep(1); print "Child is awake\n"; exit; } retry { die "proc fork failed and I will not retry\n"; } error { die "That's all folks\n"; }; exit; ----------End paste code
From: ARISTOTLE [...] cpan.org
Proc::Fork 0.11 is long obsolete; please try version 0.3. Since 0.3 seems to crash Strawberry Perl 5.8.8, I would appreciate if you could test it on ActivePerl to see if it works there.
Subject: Re: [rt.cpan.org #23893] Proc::Fork Parent never says good bye
Date: Fri, 15 Dec 2006 21:40:34 -0500
To: bug-Proc-Fork [...] rt.cpan.org
From: Malcolm Nooning <m.nooning [...] comcast.net>
I tried 0.3 on Activestate 5.8.8. It does not work. During the "nmake test", the Perl Command Line Interpreter crashes, and so I click on the button that wants me to tell Microsoft about the problem. I tried it three times. Same thing. The crash window pops up with this paste showing: --------------paste C:\aaa\Proc\Proc-Fork-0.3>nmake test Microsoft (R) Program Maintenance Utility Version 7.00.9466 Copyright (C) Microsoft Corporation. All rights reserved. C:\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib\lib', 'blib\arch')" t\00.mo ck.t t\01.real.t t\pod-coverage.t t\pod.t t\00.mock.........ok t\01.real.........ok 1/3 -------------end paste After I click the pop up crash window to make it go away, the command prompt window looks like this: -------------------paste C:\aaa\Proc\Proc-Fork-0.3>nmake test Microsoft (R) Program Maintenance Utility Version 7.00.9466 Copyright (C) Microsoft Corporation. All rights reserved. C:\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib\lib', 'blib\arch')" t\00.mo ck.t t\01.real.t t\pod-coverage.t t\pod.t t\00.mock.........ok t\01.real.........dubious Test returned status 5 (wstat 1280, 0x500) DIED. FAILED tests 2-3 Failed 2/3 tests, 33.33% okay t\pod-coverage....skipped all skipped: Set the POD_TESTS environment variable to run these tests t\pod.............skipped all skipped: Set the POD_TESTS environment variable to run these tests Failed Test Stat Wstat Total Fail List of Failed ------------------------------------------------------------------------------- t\01.real.t 5 1280 3 4 2-3 2 tests skipped. Failed 1/4 test scripts. 2/17 subtests failed. Files=4, Tests=17, 22 wallclock secs ( 0.00 cusr + 0.00 csys = 0.00 CPU) Failed 1/4 test programs. 2/17 subtests failed. NMAKE : fatal error U1077: 'C:\perl\bin\perl.exe' : return code '0xff' Stop. ----------------end paste I saved one of the files that gets sent to Microsoft. I am not pasting it here because it is 12K bytes. It is an XML file. I'll post it if you want me to. If it helps, the windows fork itself does work. Here is some code that does a pretty good test of parent/child stuff, with an unnecessary subroutine call by the child just to flex things a touch. ------------paste fork test #!/usr/bin/perl -w # file: test_windows_fork_02.pl # 1. Have the children take longer than the parent will allow. # 2. Have the children finish within the parent's allotted time limit. sub sleeper { my ($sleep_time) = @_; sleep($sleep_time); } my $done = 0; my $count = 0; while (!($done)) { $count++; print "105: count $count\n"; #........................................... if (my $pid = fork()) { # Parent print "115: count $count\n"; select(undef, undef, undef, 1.00); kill 9, $pid; $done = 1 if ($count == 3); print "115: count $count\n"; } elsif(defined $pid) { # Child print "205\n"; sleeper(40); exit; } else { # Failed to fork print "Failed to fork:$!:\n"; exit; } #........................................... print "510\n"; } print "610\n"; #........................................... if (my $pid = fork()) { # Parent print "705: \n"; select(undef, undef, undef, 4.00); kill 9, $pid; } elsif(defined $pid) { # Child print "805\n"; sleeper(2); print "810\n"; exit; } else { # Failed to fork print "820: Failed to fork:$!:\n"; exit; } #........................................... print "910\n"; ------------end paste fork test Aristotle Pagaltzis via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=23893 > > > Proc::Fork 0.11 is long obsolete; please try version 0.3. > > Since 0.3 seems to crash Strawberry Perl 5.8.8, I would appreciate > if you could test it on ActivePerl to see if it works there. > >
Hmm. I am told that fork() is pretty problematic on Win32, even though it works some of the time. I have a Windows machine at my disposal now and will try to track the problem down, but I’m reluctant to promise anything. We’ll see how it goes. Sorry that I don’t have better news. Anyway, since I am not going to fix the original bug you reported in 0.11, I am closing this ticket as Rejected. I have created a new ticket for the 0.3 Win32 crash we’re discussing; it’s #24001 (<http://rt.cpan.org//Ticket/Display.html?id=24001>). Feel free to add yourself to the Cc there.
Subject: Re: [rt.cpan.org #23893] Proc::Fork Parent never says good bye
Date: Tue, 19 Dec 2006 12:08:03 -0500
To: bug-Proc-Fork [...] rt.cpan.org
From: Malcolm Nooning <m.nooning [...] comcast.net>
Show quoted text
>Hmm. I am told that fork() is pretty problematic on Win32
It has always been problematic ... until now. I have tried it periodically ever since it was first announced and I just stayed away from it because it never worked reliably. However, it does seem to work reliably now, with perl 5.8.8, on Windows XP SP2. The test I wrote loops three times, creating and killing forked processes (I hate to use the word children here), and has the children do a short subroutine call to see if there are any stack/unstack parameter problems. Not an exhaustive test by any stretch of the imagination, but, well, it does seem to work pretty reliably. Yes, please do end the original ticket. If it starts happening on someone else's computer, it can be reopened then. We can only do but so much in the limited time we have. We don't want to be chasing ghosts. Thanks Aristotle Pagaltzis via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=23893 > > > Hmm. I am told that fork() is pretty problematic on Win32, even though > it works some of the time. > > I have a Windows machine at my disposal now and will try to track the > problem down, but I’m reluctant to promise anything. We’ll see how it > goes. Sorry that I don’t have better news. > > Anyway, since I am not going to fix the original bug you reported in > 0.11, I am closing this ticket as Rejected. I have created a new ticket > for the 0.3 Win32 crash we’re discussing; it’s #24001 > (<http://rt.cpan.org//Ticket/Display.html?id=24001>). Feel free to add > yourself to the Cc there. > >