Bug 487766 - gawk 3.1.3 causes unexpected (empty) results with a certain expression (see full bug)
gawk 3.1.3 causes unexpected (empty) results with a certain expression (see f...
Status: CLOSED NEXTRELEASE
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gawk (Show other bugs)
4.6
x86_64 Linux
low Severity medium
: rc
: ---
Assigned To: Jan Zeleny
BaseOS QE
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-27 15:13 EST by Dan McDougall
Modified: 2010-10-23 03:59 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-03-18 09:20:19 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Dan McDougall 2009-02-27 15:13:18 EST
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@corp.mycompany.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@corp.mycompany.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@corp.mycompany.com
Comment 1 Dan McDougall 2009-02-27 15:15:48 EST
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.