Hide Forgot
Created attachment 481832 [details] mini scripts to be sourced and Readme (description) Description of problem: ( . ./xx ) ##### first call modifies local environment ( . ./xx ) ##### secon call core dump sigsev Version-Release number of selected component: Name : ksh Relocations : (not relocatable) Version : 20100621 Vendor : Red Hat, Inc. Release : 2.el6 Build Date : Tue Jun 29 14:40:26 2010 Install Date: Fri Jan 28 16:03:02 2011 Build Host : ls20-bc2-13.build.redhat.com Group : System Environment/Shells Source RPM : ksh-20100621-2.el6.src.rpm Size : 1478609 Signature : RSA/8, Mon Aug 16 17:39:17 2010, Key ID 199e2f91fd431d51 Packager : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla> How reproducible: unpack attachment (tar) see Readme call ksh and follow instructions from Readme Expected results: current environemnt must not be modified Additional info: works in redhat 5.5 ubuntu all versions SunOS 9,10 ....
(In reply to comment #0) > ( . ./xx ) ##### first call modifies local environment > ( . ./xx ) ##### secon call core dump sigsev this is already fixed in new ksh package prepared for next rhel6 update > How reproducible: > unpack attachment (tar) > see Readme > call ksh and follow instructions from Readme the "y1" reproducer is not fixed yet, I'll look at it > Additional info: > works in redhat 5.5 > ubuntu all versions > SunOS 9,10 > .... it works there because they use older ksh versions which suffer from other bugs "y1" reproducer bug got introduced between 2010-03-09 (working) and 2010-05-27 (broken)
simplified reproducers for "y1" bug: a) RET=$(ksh -c '( function fx { export X=123; } ; fx; ); echo $X') [ -z "$RET" ] && echo "works fine" || echo "bug present" b) RET=$(ksh -c 'echo "/bin/true; function fx { export X=123; } ; fx;" >/tmp/kshtest; ( . /tmp/kshtest >/dev/null ); echo $X; rm -f /tmp/kshtest') [ -z "$RET" ] && echo "works fine" || echo "bug present"
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: Previously, a ( ) compound list did not always use a copy of the environment which caused the original environment to be altered. Scripts could behave unexpectedly because their variables could be changed. With this update, a copy of the environment is always used for a ( ) compound list; thus, the original environment is not affected by commands from the ( ) compound list.
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-2011-0645.html