Bug 507562 - ksh typeset does not assign value in an asynchronously called function
Summary: ksh typeset does not assign value in an asynchronously called function
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: ksh
Version: 5.3
Hardware: All
OS: Linux
urgent
urgent
Target Milestone: rc
: ---
Assignee: Michal Hlavinka
QA Contact: BaseOS QE
URL:
Whiteboard:
Depends On:
Blocks: 509326 510712 5.4, TechnicalNotes
TreeView+ depends on / blocked
 
Reported: 2009-06-23 10:30 UTC by Tomas Smetana
Modified: 2018-10-20 00:09 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
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.
Clone Of:
: 509326 (view as bug list)
Environment:
Last Closed: 2009-09-02 09:10:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Proposed patch (467 bytes, patch)
2009-06-23 10:32 UTC, Tomas Smetana
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:1256 0 normal SHIPPED_LIVE ksh bug fix update 2009-09-01 09:05:54 UTC

Description Tomas Smetana 2009-06-23 10:30:58 UTC
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.

Comment 1 Tomas Smetana 2009-06-23 10:32:27 UTC
Created attachment 349075 [details]
Proposed patch

Comment 2 Tomas Smetana 2009-06-23 10:33:37 UTC
Just a note: this bug has been fixed in the ksh-2008-07-24 beta release.

Comment 12 Ruediger Landmann 2009-08-13 00:59:28 UTC
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.

Comment 13 errata-xmlrpc 2009-09-02 09:10:53 UTC
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


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