The KornShell's "IFS" variable contains a list of field separators and is used to separate the results of command substitution, parameter expansion, or separate fields with the "read" built-in command. Previously, ksh did not protect this variable from being freed. Consequent to this, when a user attempted to unset the "IFS" variable from within a function, ksh terminated unexpectedly with a segmentation fault. With this update, an upstream patch has been applied to address this issue, and using the "unset IFS" command inside a function body no longer causes ksh to crash.
DescriptionSiddhesh Poyarekar
2011-03-10 06:57:16 UTC
Description of problem:
ksh crashes when IFS is unset inside a function
Version-Release number of selected component (if applicable):
ksh-20100202-1.el5_6.3
How reproducible:
Always
Steps to Reproduce:
Execute the following script:
-----------------------
#!/bin/ksh
function crash
{
typeset IFS
unset IFS
cd
print "hello"
}
crash
-----------------------
Actual results:
segfault
Expected results:
hello
Additional info:
This has been fixed upstream in ksh-20101010 and later. Relevant mail thread:
https://mailman.research.att.com/pipermail/ast-developers/2010q4/000785.html
Comment 2Siddhesh Poyarekar
2011-03-10 07:01:33 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:
The KornShell's "IFS" variable contains a list of field separators and is used to separate the results of command substitution, parameter expansion, or separate fields with the "read" built-in command. Previously, ksh did not protect this variable from being freed. Consequent to this, when a user attempted to unset the "IFS" variable from within a function, ksh terminated unexpectedly with a segmentation fault. With this update, an upstream patch has been applied to address this issue, and using the "unset IFS" command inside a function body no longer causes ksh to crash.
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