Bug 487766

Summary: gawk 3.1.3 causes unexpected (empty) results with a certain expression (see full bug)
Product: Red Hat Enterprise Linux 4 Reporter: Dan McDougall <riskable>
Component: gawkAssignee: Jan Zeleny <jzeleny>
Status: CLOSED NEXTRELEASE QA Contact: BaseOS QE <qe-baseos-auto>
Severity: medium Docs Contact:
Priority: low    
Version: 4.6CC: rvokal, tao, vanhoof
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-18 13:20:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Text that the gawk expression fails on none

Description Dan McDougall 2009-02-27 20:13:18 UTC
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6

I have no idea what is causing this bug but it appears to have presented itself in gawk 3.1.2, was still around in gawk 3.1.3, and was fixed in 3.1.4.  I figured this out by compiling all the aforementioned versions by hand.  Here's the expression that fails:

gawk '{if ($2 == "1") if ($3 ~ /\w+@\w+/) print tolower($1)":"tolower($3)}'

The text that it fails on (also attached):

RIA4395 1       RIA4395.com      ark     Smith, Robert

The workaround for now was to just install gawk-3.1.6 from sources but hopefully a fix can be backported before RHEL 4 is EOL'd.

Reproducible: Always

Steps to Reproduce:
echo "RIA4395 1       RIA4395.com      ark     Smith, Robert" | \
gawk '{if ($2 == "1") if ($3 ~ /\w+@\w+/) print tolower($1)":"tolower($3)}'
...or if that didn't format properly:
gawk '{if ($2 == "1") if ($3 ~ /\w+@\w+/) print tolower($1)":"tolower($3)}' <attached text>
Actual Results:  
$
(an empty shell of a prompt)

Expected Results:  
ria4395:ria4395.com

Comment 1 Dan McDougall 2009-02-27 20:15:48 UTC
Created attachment 333528 [details]
Text that the gawk expression fails on

gawk 3.1.3 (RHEL 4) fails to parse this text using the following expression:

gawk '{if ($2 == "1") if ($3 ~ /\w+@\w+/) print tolower($1)":"tolower($3)}' <attached example>