IBM Support

IV54628: KSH93 BUILTIN CD MEMORY LEAK IN SUBSHELL APPLIES TO AIX 7100-03

A fix is available

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When using the builtin cd in a ksh93 subshell and the cd
    change to a directory different from the current
    directory
    of the parent, a memory leak occurs.
    The problem is seen using the following example :
    #!/bin/ksh93
    mkdir /home/test 2>/dev/null
    cd /home/test
    integer i=0
    while [[ $i -lt 200 ]] ; do
      text=$(cd /tmp; exit -1)
      i=i+1
    done  2>/dev/null
    ps avg|grep $$
    i=0
    while [[ $i -lt 200 ]] ; do
      text=$(cd /tmp; exit -1)
      i=i+1
    done 2>/dev/null
    ps avg|grep $$
    
    The two ps avg outputs will show memory growth of the
    ksh93 process.
    

Local fix

  • 1/If the subshell return 0 the problem doesn't exhibit.
    2/If we move the builtin cd outside of the subshell the
    problem doesn't exhibit either, but then the current
    working directory need to be restored after the subshell
    returns
    from the example replace :
      text=$(cd /tmp; exit -1)
    by :
    cd /tmp
      text=$(exit -1)
    cd -
    Note : the exit is used here for simplification it might
    be replaced by any command that does not return 0.
    3/ If we replace the builtin "cd" in the subshell by the
    /usr/bin/cd command, the problem doesn't exhibit either.
    from the example replace :
      text=$(cd /tmp; exit -1)
    by :
      text=$(/usr/bin/cd /tmp; exit -1)
    

Problem summary

  • When using the builtin cd in a ksh93 subshell and the cd
    change to a directory different from the current
    directory of the parent, a memory leak occurs.
    

Problem conclusion

  • Code changes has been done to free the memory at relevant
    places.
    

Temporary fix

Comments

  • 6100-07 - use AIX APAR IV40257
    6100-08 - use AIX APAR IV57798
    6100-09 - use AIX APAR IV54769
    6100-09 - use AIX APAR IV54769
    6100-09 - use AIX APAR IV54769
    7100-01 - use AIX APAR IV57497
    7100-02 - use AIX APAR IV56943
    7100-03 - use AIX APAR IV54628
    7100-04 - use AIX APAR IV54614
    

APAR Information

  • APAR number

    IV54628

  • Reported component name

    AIX V7.1

  • Reported component ID

    5765H4000

  • Reported release

    710

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Submitted date

    2014-01-27

  • Closed date

    2014-01-27

  • Last modified date

    2016-05-10

  • APAR is sysrouted FROM one or more of the following:

    IV40257

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    AIX V7.1

  • Fixed component ID

    5765H4000

Applicable component levels

  • R710 PSY U859733

       UP14/05/22 I 1000

PTF to Fileset Mapping

[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SSMV87","label":"AIX 6.1 Enterprise Edition"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"710","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}},{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSMVAX","label":"AIX Express Edition"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"710","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}},{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SG11R","label":"AIX 7.1 HIPERS, APARs and Fixes"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"710","Edition":"","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
10 May 2016