This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Problem with gawk-3.1.5-3

Corinna Vinschen wrote:
> On Mar 13 17:30, Buchbinder, Barry (NIH/NIAID) [E] wrote:
>> I have a gawk script that I've been using unchanged for at least 9
>> months that seems to have broken with the transition from
>> gawk-3.1.5-2 to gawk-3.1.5-3. 
>> Gawk seemed to hang, though it might be merely very slow.  I let it
>> run for hours before killing it.  gawk-3.1.5-2 took 20-30 seconds to
>> run. 
> Weird.  The difference between gawk-3.1.5-2 and gawk-3.1.5-3 is in
> theory only the fact that -2 missed to make CRLF->LF conversion on
> stdin while -3 does CRLF->LF conversion.  
>> This is the script, if that makes a difference.  It is in the middle
>> of a pipe, receiving input from sort and giving output to another
>> instance of sort.  Everything should have unix-style line-endings.
>> The pipe is running under ash.  The script actually used a tab
>> character instead of the "\t" escape sequence.  I changed it to "\t"
>> below in the hope that that might be easier to read in this email.
>>   gawk '  BEGIN   { FS = OFS = "\t" }
>>                   {
>>                   Key = $2 "\t" $3 "\t" $4
>>                   InfoNew[Key] = $5
>>                   DateNew[Key] = $1
>>                   if (InfoOld[Key] == "") {
>>                           InfoOld[Key] = InfoNew[Key]
>>                           DateOld[Key] = DateNew[Key] }
>>                   if (InfoNew[Key] != InfoOld[Key]) {
>>                           print DateOld[Key], Key, InfoOld[Key]
>>                           InfoOld[Key] = InfoNew[Key]
>>                           DateOld[Key] = DateNew[Key] }             
>>           } END     {
>>                   for (Key in InfoOld) {
>>                           print DateOld[Key], Key, InfoOld[Key] }   
>> }' 
>> Do I need to send anything else?
> Can you embed this in a minimal testscript to reproduce the effect,
> together with a few lines (<10) of a typical input file? 
> Corinna
> --
> Corinna Vinschen                  Please, send mails regarding Cygwin
> to 
> Cygwin Project Co-Leader          cygwin AT cygwin DOT com
> Red Hat

Sorry to have bothered you about this.

I did comparison tests with gawk-3.1.5-2 and gawk-3.1.5-3.  Playing with
"print" statements I found that gawk was not hanging.  Timing was not
consistently different between gawk-3.1.5-2 and gawk-3.1.5-3, so the
unexpectedly long run times must have been do to other reasons.  (As
this is Windows, on a network, and I don't have admin privileges, its
hard to say what those other reasons might be.)

Anyway, I apologize again for having raised a false alarm.

And thanks for all the great work everyone has done on cygwin!

- Barry

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]