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):
Steps to Reproduce:
1. ksh whence -q ls
Command never returns.
Command does not return any output (quiet mode). Exit code is examined to see if command is found in $PATH.
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.
I can reproduce this, thanks for reporting
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
Thanks Michal ... Ermin
Created attachment 411003 [details]
fix infinite loop
this patch should be included in ksh 2010-03-19+
> 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
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.
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.
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.
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.
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.