Bug 587127 - whence -q broken
whence -q broken
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: ksh (Show other bugs)
5.5
All Linux
low Severity medium
: rc
: ---
Assigned To: Michal Hlavinka
qe-baseos-tools
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-04-28 21:18 EDT by Ermin Borovac
Modified: 2012-08-10 08:46 EDT (History)
3 users (show)

See Also:
Fixed In Version: ksh-20100621-1.el5
Doc Type: Bug Fix
Doc Text:
Code optimization of 'whence' ksh builtin caused infinite loop in some cases. When 'whence' builtin was used with -q option, ksh hung. In the updated version, code of the whence builtin was fixed and ksh no longer hungs, when -q option is used.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-02-21 00:49:47 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
fix infinite loop (453 bytes, patch)
2010-05-03 09:55 EDT, Michal Hlavinka
no flags Details | Diff

  None (edit)
Description Ermin Borovac 2010-04-28 21:18:04 EDT
Description of problem:
The following command enters a loop using 100% CPU and never returns.
$ ksh whence -q ls

Version-Release number of selected component (if applicable):
ksh-20100202-1.el5

How reproducible:
Always.

Steps to Reproduce:
1. ksh whence -q ls
  
Actual results:
Command never returns.

Expected results:
Command does not return any output (quiet mode). Exit code is examined to see if command is found in $PATH.

Additional info:
This worked OK on RHEL 5.4 with ksh-20080202-14.el5. Easy to workaround but it could give someone nasty surprise if they use whence -q in a shell script and upgrade from 5.4 to 5.5.
Comment 1 Michal Hlavinka 2010-04-29 04:19:37 EDT
I can reproduce this, thanks for reporting
Comment 2 Michal Hlavinka 2010-04-29 06:26:58 EDT
this was caused by modifications (optimizations?) of whence for 2008-07-25 which is first broken version. for -q flag pp pointer used in while(pp) loop does not change making it looping forever. I've fix ready, but I'll mail it upstream first and wait for their response
Comment 3 Ermin Borovac 2010-04-29 19:33:37 EDT
Thanks Michal ... Ermin
Comment 4 Michal Hlavinka 2010-05-03 09:55:37 EDT
Created attachment 411003 [details]
fix infinite loop

this patch should be included in ksh 2010-03-19+
Comment 5 Michal Hlavinka 2010-05-03 09:56:52 EDT
> this patch should be included in ksh 2010-03-19+

note: this is just information from the upstream it does not mean the version where I'm going to fix this
Comment 7 RHEL Product and Program Management 2010-08-09 14:20:17 EDT
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 8 RHEL Product and Program Management 2011-01-11 15:21:39 EST
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 9 RHEL Product and Program Management 2011-01-11 17:44:29 EST
This request was erroneously denied for the current release of
Red Hat Enterprise Linux.  The error has been fixed and this
request has been re-proposed for the current release.
Comment 10 RHEL Product and Program Management 2011-05-31 09:20:33 EDT
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 13 Michal Hlavinka 2012-01-18 11:33:00 EST
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Code optimization of 'whence' ksh builtin caused infinite loop in some cases. When 'whence' builtin was used with -q option, ksh hung. In the updated version, code of the whence builtin was fixed and ksh no longer hungs, when -q option is used.
Comment 14 errata-xmlrpc 2012-02-21 00:49:47 EST
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.

http://rhn.redhat.com/errata/RHBA-2012-0159.html

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