develooper Front page | perl.perl5.porters | Postings from August 2012

[perl #23331] Win32 pipe/fork or filehandle I/O deadlock bug

Thread Next
From:
James E Keenan via RT
Date:
August 13, 2012 17:14
Subject:
[perl #23331] Win32 pipe/fork or filehandle I/O deadlock bug
Message ID:
rt-3.6.HEAD-11172-1344903277-1291.23331-15-0@perl.org
On Fri Aug 15 09:43:53 2003, Sean.Hunter@gs.com wrote:
> 
> This is a bug report for perl from sean.hunter@gs.com,
> generated with the help of perlbug 1.33 running under perl v5.6.1.
> 
> To: perlbug@perl.org
> Subject: Win32 pipe/fork bug
> Cc: ficcs-installmeister@ny.email.gs.com
> Reply-To: ficcs-installmeister@ny.email.gs.com
> Message-Id: <5.8.0_536_1060965069@jeeves.fi.gs.com>
> 
> This is a bug report for perl from ficcs-
>    installmeister@ny.email.gs.com,
> generated with the help of perlbug 1.34 running under perl v5.8.0.
> 
> 
> -----------------------------------------------------------------
> 
> Hi there
> 
> The following code, (copied directly from perlfork.pod) deadlocks on
>    Win32 (XP
> and NT4) under 5.8.0.  5.6.1 on Win32 and 5.8.0 on Solaris and Linux
>    work fine
> for me.  I have tried the same code with a build without PERLIO and
>    the
> standard ActiveState perl 5.8.0.  The AS perl deadlocks and sits there
>    until
> interrupted.  The build without PERLIO exits without printing the
>    message.  I
> have tried various settings of the PERLIO environment variable without
>    any
> noticable effect.
> 
> FWIW I see the same behaviour with tcp sockets between the parent and
>    child
> processes.
> 
> Cheers
> 
> Sean
> 
> # simulate open(FOO, "-|")
> sub pipe_from_fork ($) {
> 	my $parent = shift;
> 	pipe $parent, my $child or die;
> 	my $pid = fork();
> 	die "fork() failed: $!" unless defined $pid;
> 	if ($pid) {
> 		close $child;
> 	}
> 	else {
> 		close $parent;
> 		open(STDOUT, ">&=" . fileno($child)) or die;
> 	}
> 	$pid;
> }
> 
> if (pipe_from_fork('BAR')) {
> 	# parent
> 	while (<BAR>) { print; }
> 	close BAR;
> }
> else {
> 	# child
> 	print "pipe_from_fork certified \"100% Probably Working [tm]\"!  Have
>    a nice day.\n";
> 	close STDOUT;
> 	exit(0);
> }
> 
> 

This ticket has languished for many years.  Could someone on Win32
(version supported by vendor) and recent version of Perl (5.14 or 5.16
or their ActivePerl equivlents) give this a spin?

Thank you very much.
Jim Keenan

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org:443/rt3/Ticket/Display.html?id=23331

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About