Bug 683734

Summary: ksh crashes when IFS is unset inside a function
Product: Red Hat Enterprise Linux 6 Reporter: Michal Hlavinka <mhlavink>
Component: kshAssignee: Michal Hlavinka <mhlavink>
Status: CLOSED ERRATA QA Contact: qe-baseos-tools-bugs
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0CC: eddie.quinteros, James.Hartsock, liko, mfranc, ovasik, prc, spoyarek
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 683722
: 727223 727891 (view as bug list) Environment:
Last Closed: 2011-12-06 16:18:42 UTC Type: ---
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: 683722    
Bug Blocks: 727223, 727891    

Comment 2 eddie.quinteros 2011-05-17 21:19:06 UTC
The problem can be seen by running the following script.

$ more ks6f3
#!/bin/ksh
function vlfunc {
  print "begin vlfunc"
  typeset IFS="$IFS"

  while read line
  do
    :
  done < /dev/null
  print "$( vlsub_func )"
  print END
}

function vlsub_func {
  print "begin vlsub_func"
  vlsub_sub_func
  IFS="DEF"
  vlsub_sub_func
  print "end vlsub_func"
  return
}

function vlsub_sub_func {
  print "begin vlsub_sub_func"
  IFS="abc"
  print "end vlsub_sub_func"
}

########################################
# run main, set up clean exit
#
IFS="hold"
vlfunc
vlfunc
vlfunc
[vern@vernsf2 test-ksh]$ ./ks6f3
begin vlfunc
begin vlsub_func
begin vlsub_sub_func
end vlsub_sub_func
begin vlsub_sub_func
end vlsub_sub_func
end vlsub_func
END
begin vlfunc
Segmentation fault (core dumped)
[vern@vernsf2 test-ksh]$

Comment 7 errata-xmlrpc 2011-12-06 16:18:42 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-2011-1647.html