Bug 429153 - scripts failing under ksh
scripts failing under ksh
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: ksh (Show other bugs)
4.5
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Tomas Smetana
:
: 444374 (view as bug list)
Depends On:
Blocks: 435159
  Show dependency treegraph
 
Reported: 2008-01-17 11:41 EST by Chuck Mead
Modified: 2010-10-22 17:50 EDT (History)
3 users (show)

See Also:
Fixed In Version: RHBA-2008-0704
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-07-24 15:52:49 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Chuck Mead 2008-01-17 11:41:19 EST
Description of problem: custom scripting written by users is failing under ksh
but runs perfectly under bash.


Version-Release number of selected component (if applicable):
ksh-20050202-0.4E.4.x86_64


How reproducible: here are the scripts in question

#!/bin/ksh
typeset -i j=1
while [ $j -le 1000 ]; do
./test_ret.sh
j=j+1
done

echo

The above script runs fine with /bin/bash as the shell. With /bin/ksh it fails
quite often. Here is the script it is calling:

#!/bin/ksh
TEMP=/bb/data/oracle/logs/test_return.tmp
TEMPLOG=/bb/data/oracle/logs/cmdout.tmp
LOG=/bb/data/oracle/logs/test_return.log

cat /dev/null > $LOG
touch $TEMP
#rm -f $TEMP > $TEMPLOG 2>&1
rm -f $TEMP > $TEMPLOG 2>&1
if [ ${?} -ne 0 ]; then
  echo
  echo "`date` - Command return non successful for rm -f $TEMP" | tee -a $LOG
  ls -l $TEMP | tee -a $LOG
  cat $TEMPLOG | tee -a $LOG
else
  echo -n "."
fi

The user running these scripts is oracle:dba and this user has all the rights
necessary to run this code. The same exact scripts with the bang path changed to
/bin/bash runs perfectly.



Steps to Reproduce:
1. see above
2.
3.
  
Actual results: Script fails like this:

Thu Jan 17 10:44:03 EST 2008 - Command return non successful for rm -f
/bb/data/oracle/logs/test_return.tmp
ls: /bb/data/oracle/logs/test_return.tmp: No such file or directory
.........................................................................
......................................



Expected results:

The scripts should provide only periods as output.

Additional info:

Obviously these are test scripts written expressly to test a recurring issue
with production script failures.
Comment 1 Tomas Smetana 2008-01-18 06:35:41 EST
This has the same cause as in the bug #232640 and bug #426132.  I have already a
patch for them.
Comment 2 Chuck Mead 2008-01-18 11:11:20 EST
so does this mean that a working patch is forthcoming?
Comment 3 Tomas Smetana 2008-01-21 05:32:03 EST
You may wish to test the packages from here:
http://tsmetana.fedorapeople.org/ksh/el4-test/
Comment 4 RHEL Product and Program Management 2008-02-01 13:58:27 EST
This request was evaluated by Red Hat Product Management for
inclusion, but this component is not scheduled to be updated in
the current Red Hat Enterprise Linux release. If you would like
this request to be reviewed for the next minor release, ask your
support representative to set the next rhel-x.y flag to "?".
Comment 7 Chuck Mead 2008-02-04 10:41:02 EST
The test scripts run fine with the new shell... prior to installing the rpm we
renamed the old ksh to ksh.old. When we change the bang path to the old ksh the
scripts fail immediately. So on the surface this looks good. There are some
other scripts (production) which need to run... we will wait a while and let
them run and see what it looks like... but for now things look pretty good.
Comment 19 Ian Mortimer 2008-05-05 20:55:27 EDT
The updated package also seems to have fixed (*) some random stack faults I was
getting on x86_64 el4.  (src rpm rebuilt on x86_64 since there's only i386 at
http://tsmetana.fedorapeople.org/ksh/el4-test/).

(*) with ksh-20050202-0.4E.2, 5 consecutive runs on the same data resulted in 1
successful completion and 4 stack faults all at different places.  With
ksh-20050202-0.5E.4, 5 consecutive runs results in 5 successful completions.
Comment 22 Tomas Smetana 2008-05-29 01:55:11 EDT
*** Bug 444374 has been marked as a duplicate of this bug. ***
Comment 23 errata-xmlrpc 2008-07-24 15:52:49 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2008-0704.html

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