Bug 1250830
Summary: | awk matches lowercase when searching for uppercase range | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Scott Rochford <scott.rochford> | ||||||||
Component: | gawk | Assignee: | David Kaspar // Dee'Kej <deekej> | ||||||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Jan Kepler <jkejda> | ||||||||
Severity: | high | Docs Contact: | |||||||||
Priority: | urgent | ||||||||||
Version: | 6.6 | CC: | dkutalek, fkrska, jkejda, jkurik, kdudka, mkolaja, msaxena, ohudlick, praiskup, thozza, zpytela | ||||||||
Target Milestone: | rc | Keywords: | Patch, Reproducer, ZStream | ||||||||
Target Release: | --- | ||||||||||
Hardware: | All | ||||||||||
OS: | Linux | ||||||||||
Whiteboard: | |||||||||||
Fixed In Version: | gawk-3.1.7-11.el6 | Doc Type: | Bug Fix | ||||||||
Doc Text: | Story Points: | --- | |||||||||
Clone Of: | |||||||||||
: | 1271701 (view as bug list) | Environment: | |||||||||
Last Closed: | 2016-06-17 13:31:59 UTC | Type: | Bug | ||||||||
Regression: | --- | Mount Type: | --- | ||||||||
Documentation: | --- | CRM: | |||||||||
Verified Versions: | Category: | --- | |||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||||
Embargoed: | |||||||||||
Bug Depends On: | |||||||||||
Bug Blocks: | 1254457, 1271443, 1271701 | ||||||||||
Attachments: |
|
Description
Scott Rochford
2015-08-06 06:18:56 UTC
Forgot release number: gawk-3.1.7-10.el6.x86_64 Reproduced on: RHEL 5: gawk-3.1.5-16.el5 RHEL 6: gawk-3.1.7-10.el6.x86_64 not RHEL 7 with gawk-4.0.2-4.el7.x86_64 I have also reproduced this behaviour on RHEL6. RHEL7 uses newer version, which undertook a major source code rebase, and it is already fixed there. I have identified an upstream commits that fixes the issues. I'm currently working on extracting the necessary patch from it and porting it back. Once I have it, I will post it here for review. Created attachment 1076500 [details]
proposed fix (backport)
Comment on attachment 1076500 [details] proposed fix (backport) Why are the newly introduced buf/buf_len variables static? It makes no sense without the following changes: + if (buf == NULL) { + emalloc(buf, char *, len + 2, "make_regexp"); + buflen = len; + } else if (len > buflen) { + erealloc(buf, char *, len + 2, "make_regexp"); + buflen = len; + } + dest = buf; [...] - - free(temp); Please consider also backporting the related parts of the following upstream commits that fix bugs in the code introduced by this patch: http://git.savannah.gnu.org/cgit/gawk.git/commit/?id=00d79709 http://git.savannah.gnu.org/cgit/gawk.git/commit/?id=2c126c49 Created attachment 1078348 [details]
proposed fix (backport) v2
Kamil, thank you for your review and valuable info about the additional fixes.
Here's is the (hopefully) final version for this backport. Could you please check the changes are sane?
Thank you.
Comment on attachment 1078348 [details]
proposed fix (backport) v2
Thanks for the update! It looks better now. But please revert the unnecessary re-indentation. The previous patch used tabs for indentation (as the upstream code does). The current version of the patch uses spaces for indentation where the upstream patches use tabs for indentation. This makes the changes difficult to follow.
Created attachment 1078656 [details]
proposed fix (backport) v3
Ah, I didn't notice that. (Turned out I had some residual configuration in GIT, which was transforming tabs to hardtabs, and VIM, which was ignoring any indentation differences.) Thank you for your feedback.
Here's the same patch with just the indentation fixed to correspond more accurately with the upstream version.
Comment on attachment 1078656 [details] proposed fix (backport) v3 No behavioral changes, keeping r+. As a side note, this hunk is unnecessary: > @@ -239,7 +266,7 @@ research(Regexp *rp, register char *str, int start, > if (rp->dfa && ! no_bol && ! need_start) { > char save; > int count = 0; > - /* > + /* > * dfa likes to stick a '\n' right after the matched > * text. So we just save and restore the character. > */ > @@ -288,7 +315,7 @@ refree(Regexp *rp) > dfafree(&(rp->dfareg)); > free(rp); > } > - > + > /* dfaerror --- print an error message for the dfa routines */ > > void Note I was not able to actually set the review+ flag because of bug #1265524. I'm setting this bug as a blocker for the RHEL-6.8, so it is evaluated by the Product Management. |