Bug 487766 - gawk 3.1.3 causes unexpected (empty) results with a certain expression (see full bug)
Summary: gawk 3.1.3 causes unexpected (empty) results with a certain expression (see f...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gawk
Version: 4.6
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Jan Zeleny
QA Contact: BaseOS QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-02-27 20:13 UTC by Dan McDougall
Modified: 2018-10-20 02:27 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-03-18 13:20:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Text that the gawk expression fails on (56 bytes, text/plain)
2009-02-27 20:15 UTC, Dan McDougall
no flags Details

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>


Note You need to log in before you can comment on or make changes to this bug.