Bug 587127 - whence -q broken
Summary: whence -q broken
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: ksh
Version: 5.5
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Michal Hlavinka
QA Contact: qe-baseos-tools
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-04-29 01:18 UTC by Ermin Borovac
Modified: 2012-08-10 12:46 UTC (History)
3 users (show)

(edit)
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.
Clone Of:
(edit)
Last Closed: 2012-02-21 05:49:47 UTC


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


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0159 normal SHIPPED_LIVE ksh bug fix and enhancement update 2012-02-20 14:53:47 UTC

Description Ermin Borovac 2010-04-29 01:18:04 UTC
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 08:19:37 UTC
I can reproduce this, thanks for reporting

Comment 2 Michal Hlavinka 2010-04-29 10:26:58 UTC
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 23:33:37 UTC
Thanks Michal ... Ermin

Comment 4 Michal Hlavinka 2010-05-03 13:55:37 UTC
Created attachment 411003 [details]
fix infinite loop

this patch should be included in ksh 2010-03-19+

Comment 5 Michal Hlavinka 2010-05-03 13:56:52 UTC
> 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 18:20:17 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 8 RHEL Product and Program Management 2011-01-11 20:21:39 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 9 RHEL Product and Program Management 2011-01-11 22:44:29 UTC
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 13:20:33 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 13 Michal Hlavinka 2012-01-18 16:33:00 UTC
    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 05:49:47 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.

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.