Bug 813219

Summary: zsh gets in infinite loop when checking syntax
Product: Red Hat Enterprise Linux 5 Reporter: Sebastien Aime <saime>
Component: zshAssignee: James Antill <james.antill>
Status: CLOSED ERRATA QA Contact: Jan Kepler <jkejda>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.8CC: bnater, jkejda, lmiksik, prc, vgaikwad
Target Milestone: rcKeywords: EasyFix, Patch
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: zsh-4.2.6-9.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-30 23:20:15 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:
Bug Depends On:    
Bug Blocks: 928849    
Description Flags
proposed patch none

Description Sebastien Aime 2012-04-17 09:18:56 UTC
With zsh on rhel5, running a syntax check against the script below never terminates whereas with rhel6 it does terminate.

while (( $X < $Y ))

rhel5> zsh -n loop.sh
loop.sh:2: bad math expression: operand expected at `<  '
loop.sh:2: bad math expression: operand expected at `<  '
loop.sh:2: bad math expression: operand expected at `<  '
(infinite loop)

rhel6> zsh -n loop.sh 
loop.sh:2: bad math expression: operand expected at `<  '

It appears that with zsh version 4.2.6 condition '(($X < $Y))' is true whereas it's false with version 4.3.10 from rhel6. As a result script never terminates when executed with rhel5 zsh.

Comment 1 mahaveer darade 2012-05-17 07:54:04 UTC
Created attachment 585136 [details]
proposed patch

Comment 2 RHEL Program Management 2012-06-12 01:22:50 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 5 James Antill 2013-04-05 13:46:20 UTC
 The patch looks simple enough (I assume someone ported it, or just took it, from upstream?)

Comment 11 errata-xmlrpc 2013-09-30 23:20:15 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.