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

[perl #50374] unexpected exit in open3() on win32

From:
James E Keenan via RT
Date:
August 13, 2012 16:53
Subject:
[perl #50374] unexpected exit in open3() on win32
Message ID:
rt-3.6.HEAD-11172-1344902022-711.50374-15-0@perl.org
On Tue Jan 29 07:19:30 2008, adavies@ptc.com wrote:
> This is a bug report for perl from adavies@ptc.com,
> generated with the help of perlbug 1.35 running under perl v5.8.7.
> 
> 
> -----------------------------------------------------------------
> [Please enter your report here]
> 
> IPC::Open3::open3() appears to exit on Win32 when STDOUT is redirected
> _and_ it is called via the associated perl. It works as expected
> if only one of the above conditions is met.
> Here's a walk thro':
> 
>   D:\>cat open3_testcase.pl
>   require IPC::Open3;
>   require IO::File;
>   my $cmd = "find.exe ."; # a random command to run
>   *CMD_ERR = IO::File->new_tmpfile;
>   print "start $^X\n";
>   my $pid = eval {
>           IPC::Open3::open3(undef, \*CMD_OUT, ">&CMD_ERR", $cmd);
>   };
>   $@ and die "failed to run $cmd\n$@";
>   print "end $pid\n";
>   
>   D:\>open3_testcase.pl
>   start C:\perl3\bin\perl5.8.7.exe
>   end 812
>   
>   D:\>C:\perl3\bin\perl5.8.7.exe open3_testcase.pl
>   start C:\perl3\bin\perl5.8.7.exe
>   end 2816
>   
>   D:\>C:\perl3\bin\perl5.8.7.exe open3_testcase.pl > output
>   
>   D:\>cat output
>   start C:\perl3\bin\perl5.8.7.exe
>   end 1880
>   
>   D:\>open3_testcase.pl > output
>   
>   D:\>cat output
>   start C:\perl3\bin\perl5.8.7.exe
>   
>   D:\>
> 
> 
> By placing print statements into IPC::Open3, it appears to be exiting
> during the call to:
> 
> 	# line 323 VERSION 1.0106
> 	$fd->{handle}->fdopen($saved{fileno $fd->{open_as}} ||
> $fd->{open_as},
> 			      $fd->{mode});
> 
> 
> Any idea what's happening here? Is it a bug?
> 
> 
> Cheers, alex.
> 
> 

Is there anyone on a supported version of Win32 who could take a look at
this problem and report whether it persists on a supported version of
Perl (5.14 or 5.16)?

Thank you very much.
Jim Keenan


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



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