Description of problem: Assume the following script: ======== 8< ======== #!/bin/ksh testfn() { typeset var=val echo "var = $var" } function wrap_fork_testfn { testfn & } echo "=== call wrapper forking function" wrap_fork_testfn ======== 8< ======== Version-Release number of selected component (if applicable): ksh-20080202-13 How reproducible: always Steps to Reproduce: 1. Run the script from above 2. Look at the output Actual results: === call wrapper forking function var = Expected results: === call wrapper forking function var = val Additional info: This is caused by a bug in ksh xec.c where the function nesting counter is being zeroed after forking.
Created attachment 349075 [details] Proposed patch
Just a note: this bug has been fixed in the ksh-2008-07-24 beta release.
Release note added. If any revisions are required, please set the "requires_release_notes" flag to "?" and edit the "Release Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: in the last ksh version, the function nesting counter was zeroed after forking. Therefore, typeset did not assign values in asynchronously called functions. This is now fixed.
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-2009-1256.html