delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/03/22/16:59:47

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
Subject: RE: Cygwin1.dll 1.7.1 causes ActivePerl 5.10 hang on gzip pipe close on Windows Server 2003
Date: Mon, 22 Mar 2010 14:59:34 -0700
Message-ID: <87336DA2FD996C4FAB2DE4988F20DD8CCBE37E@SRV01.ghc.local>
In-Reply-To: <87336DA2FD996C4FAB2DE4988F20DD8C9D48A3@SRV01.ghc.local>
References: <30FB0BA95FB54CEAAB93ACE5DFD7D427 AT ghc DOT local> <87336DA2FD996C4FAB2DE4988F20DD8C9D48A3 AT SRV01 DOT ghc DOT local>
From: "Matthew Kidd" <matthew DOT kidd AT ghctechnologies DOT com>
To: <cygwin AT cygwin DOT com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

>> >> I upgraded to Cygwin 1.7.1 on a (64-bit) Windows Server 2003
>> >> and immediately ran into trouble. It seems that Perl can no
>> >> longer shutdown pipes related to Cygwin executables. Here is
>> >> some example code:
>> >>=20
>> >> #!/usr/bin/perl
>> >>=20
>> >> use strict;
>> >>=20
>> >> # my $fname =3D 'Y:\path\to\ratherbigfile.gz';
>> >> my $fname =3D '/cygdrive/y/path/to/ratherbigfile.gz';
>> >>=20
>> >> open(FH, "gzip -dc $fname |") || die 'open failed.';
>> >> for (1..4) { my $fline =3D <FH>; print $fline; }
>> >>=20
>> >> close(FH);
>> >> print "done\n";
>> >>=20=20
>> >>=20
>> >> Before Cygwin 1.7.1 this code ran fine. It printed out four
>> >> lines, closed the pipe, and exited. But now it hangs at the
>> >> close(FH) statement and the child gzip process maxes out a
>> >> core continuing to uncompress the big file. I either have to
>> >> kill the gzip process or the Perl process. This problem happens
>> >> whether I use a Windows style file path or a Unix style
>> >> file path. It doesn't matter if I use 32-bit or 64-bit Perl.
>> >>=20
>> >> If I replace the cygwin1.dll file from the 1.7.1 installation
>> >> with an older version of cygwin1.dll from a different installation
>> >> (specifically 1.5.25 cr-0x5f1), the code above works fine (though
>> >> I imagine mixing and matching DLL version is not a good long term
>> >> solution).
>>=20
>> > Try the latest developer snapshot from http://cygwin.com/snapshots/
>> > fixes your problem.
>>=20
>> I had no luck with the 1.7.2 cygwin1.dll from the developer snapshot.
>> Since the 1.7.1 Cygwin package does not show this problem on a 32-bit
>> Windows 7 box I think it is a 64-bit architecture issue.
>
> I have no problem running your testcase with Windows 7 64 and the
> latest Cygwin from CVS.

Did you check using a very large file? What I have learned on the 64-bit
Windows 2003 box is that the close(FH) does eventually succeed, but only
after the entire file has been uncompressed. If your test file were
small you would not necessarily observe that close(FH) does not take
place immediately after the four lines have been read.

I'll try to get my hands on a 64-bit Windows 7 box myself.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019