Run the attached script and observe the results. Here's the sample of the output of the different ksh93 versions: The previous version of the Korn Shell: ================================================================================== # ./loop_time_gets_longer ksh version: Version M 93s+ 2008-01-31 +-------------- pass number | +- current loop time/1st loop time | | process size --------------------------------------+ | | total time in seconds ----------------+ | | | current loop time + | | | | | | | \ / \ / \ / \ / \ / p# 1: cur/1st= 1.00; loop(secs)= 1.56; total(secs)= 1.56; RSS=0001592 p# 2: cur/1st= 0.99; loop(secs)= 1.55; total(secs)= 3.11; RSS=0001604 p# 3: cur/1st= 1.00; loop(secs)= 1.56; total(secs)= 4.67; RSS=0001604 p# 4: cur/1st= 1.00; loop(secs)= 1.56; total(secs)= 6.23; RSS=0001604 p# 5: cur/1st= 1.00; loop(secs)= 1.56; total(secs)= 7.79; RSS=0001604 p# 6: cur/1st= 1.00; loop(secs)= 1.57; total(secs)= 9.36; RSS=0001604 p# 7: cur/1st= 1.00; loop(secs)= 1.56; total(secs)= 10.92; RSS=0001604 p# 8: cur/1st= 1.01; loop(secs)= 1.57; total(secs)= 12.49; RSS=0001604 p# 9: cur/1st= 1.00; loop(secs)= 1.56; total(secs)= 14.06; RSS=0001604 p# 10: cur/1st= 1.00; loop(secs)= 1.56; total(secs)= 15.62; RSS=0001604 ================================================================================ The new Korn Shell: ================================================================================ # ./loop_time_gets_longer ksh version: Version AJM 93t+ 2010-02-02 +-------------- pass number | +- current loop time/1st loop time | | process size --------------------------------------+ | | total time in seconds ----------------+ | | | current loop time + | | | | | | | \ / \ / \ / \ / \ / p# 1: cur/1st= 1.00; loop(secs)= 5.43; total(secs)= 5.43; RSS=0069952 p# 2: cur/1st= 2.31; loop(secs)= 12.56; total(secs)= 17.99; RSS=0138524 p# 3: cur/1st= 3.46; loop(secs)= 18.78; total(secs)= 36.77; RSS=0207088 p# 4: cur/1st= 4.52; loop(secs)= 24.53; total(secs)= 61.31; RSS=0275656 p# 5: cur/1st= 5.51; loop(secs)= 29.93; total(secs)= 91.24; RSS=0344220 p# 6: cur/1st= 6.46; loop(secs)= 35.09; total(secs)= 126.33; RSS=0412784 p# 7: cur/1st= 7.39; loop(secs)= 40.15; total(secs)= 166.48; RSS=0481344 p# 8: cur/1st= 8.33; loop(secs)= 45.23; total(secs)= 211.70; RSS=0549912 p# 9: cur/1st= 9.29; loop(secs)= 50.48; total(secs)= 262.18; RSS=0618480 p# 10: cur/1st=10.22; loop(secs)= 55.49; total(secs)= 317.67; RSS=0687040 Version-Release number of selected component (if applicable): ksh-20100202-1.el5 How reproducible: always Steps to Reproduce: See the description
Created attachment 409846 [details] Reproducer script
Created attachment 409847 [details] Proposed patch Backported from 2010-03-09 upstream version.
Created attachment 414760 [details] A better patch There seems to be another leak caused by a forgotten initialization
This request was evaluated by Red Hat Product Management for inclusion in the current release of Red Hat Enterprise Linux. Because the affected component is not scheduled to be updated in the current release, Red Hat is unfortunately unable to address this request at this time. Red Hat invites you to ask your support representative to propose this request, if appropriate and relevant, in the next release of Red Hat Enterprise Linux.
This request was erroneously denied for the current release of Red Hat Enterprise Linux. The error has been fixed and this request has been re-proposed for the current release.
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: Due to a memory leak in the ksh executable, the performance of long running scripts could decrease significantly over the time. With this update, the underlying source code has been modified to prevent this memory leak, and the execution of long running scripts is no longer slowed down.
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