Bug 921138
| Summary: | ksh memory leak when using arrays in functions | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 5 | Reporter: | Konstantin Gremliza <konstantin> | ||||||||
| Component: | ksh | Assignee: | Michal Hlavinka <mhlavink> | ||||||||
| Status: | CLOSED ERRATA | QA Contact: | Martin Kyral <mkyral> | ||||||||
| Severity: | high | Docs Contact: | |||||||||
| Priority: | high | ||||||||||
| Version: | 5.6 | CC: | chorn, cww, dag, kdudka, konstantin, ovasik, svashisht, tbowling | ||||||||
| Target Milestone: | rc | Keywords: | Patch | ||||||||
| Target Release: | --- | ||||||||||
| Hardware: | x86_64 | ||||||||||
| OS: | Linux | ||||||||||
| Whiteboard: | |||||||||||
| Fixed In Version: | ksh-20100621-16.el5 | Doc Type: | Bug Fix | ||||||||
| Doc Text: | Story Points: | --- | |||||||||
| Clone Of: | |||||||||||
| : | 921455 (view as bug list) | Environment: | |||||||||
| Last Closed: | 2013-10-01 00:26:05 UTC | Type: | Bug | ||||||||
| Regression: | --- | Mount Type: | --- | ||||||||
| Documentation: | --- | CRM: | |||||||||
| Verified Versions: | Category: | --- | |||||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||||
| Embargoed: | |||||||||||
| Bug Depends On: | |||||||||||
| Bug Blocks: | 836232 | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Konstantin Gremliza
2013-03-13 14:45:50 UTC
reproducible This problem occurs also in RHEL 5.9 and 6.2: more /etc/redhat-release Red Hat Enterprise Linux Server release 6.2 (Santiago) Name : ksh Relocations: (not relocatable) Version : 20100621 Vendor: CentOS Release : 12.el6_2.1 Build Date: Fri 06 Jan 2012 04:22:02 PM CET Install Date: Tue 12 Jun 2012 02:56:09 PM CEST Build Host: c6b18n1.dev.centos.org Group : System Environment/Shells Source RPM: ksh-20100621-12.el6_2.1.src.rpm Size : 1548708 License: CPL Signature : RSA/SHA1, Fri 06 Jan 2012 06:11:35 PM CET, Key ID 0946fca2c105b9de Packager : CentOS BuildSystem <http://bugs.centos.org> URL : http://www.kornshell.com/ Summary : The Original ATT Korn Shell Description : Any ideas for workarounds? Look like the used syntax is not compatible with pdksh, which I considered to use in exchange. (In reply to comment #2) > This problem occurs also in RHEL 5.9 and 6.2 This problem occurs in all ksh versions I've tested - from very old ksh versions (2008-02-02) to latest upstream alpha version (2013-02-22). I'm testing a patch already. (In reply to comment #3) > Any ideas for workarounds? Except calling the unset, there is no known workaround. unset will not work with hashes (-A) e.g.: hash=([ind1]=val1 [ind2]=val2) only with arrays Created attachment 710526 [details]
patch to fix this
The customer is willing to test, can we hand out a testpackage? Tested Test Package with script:
Mem leak not completly solved.
After some loops, significant slowdown in execution.
Mem Leak even worse with hash function as in first example.
function nil {
false
}
print ${.sh.version}
pmap -x $$ |tail -1
for (( j=0; j<100; j++)); do
a=$SECONDS
for (( i=0; i<10000; i++)); do
nil
done
((b=SECONDS-a))
printf "%3.4f " $b
pmap -x $$ |tail -1
done
Result:
Version AJM 93t+ 2010-06-21
total kB 106880 1512 232
0.0713 total kB 106880 1580 252
0.0683 total kB 106880 1580 252
0.0755 total kB 106880 1580 252
0.0694 total kB 106880 1580 252
0.0759 total kB 106880 1580 252
0.0709 total kB 106880 1580 252
0.0686 total kB 106880 1580 252
0.0689 total kB 106880 1580 252
0.0684 total kB 106880 1584 256
0.0685 total kB 106880 1584 256
0.0691 total kB 106880 1584 256
0.0771 total kB 106880 1584 256
0.0715 total kB 106880 1584 256
0.0694 total kB 106880 1584 256
0.0693 total kB 106880 1584 256
0.0716 total kB 106880 1584 256
0.0727 total kB 106880 1584 256
0.0692 total kB 106880 1584 256
0.0690 total kB 106880 1584 256
0.0683 total kB 106880 1584 256
0.0681 total kB 106880 1584 256
0.0691 total kB 106880 1584 256
0.0729 total kB 106880 1584 256
0.0698 total kB 106880 1584 256
0.0684 total kB 106880 1584 256
0.0678 total kB 106880 1584 256
0.0686 total kB 106880 1584 256
0.0682 total kB 106880 1588 260
0.0691 total kB 106880 1588 260
0.0692 total kB 106880 1588 260
0.0692 total kB 106880 1588 260
0.0690 total kB 106880 1588 260
0.0686 total kB 106880 1588 260
0.0686 total kB 106880 1588 260
0.0685 total kB 106880 1588 260
0.0681 total kB 106880 1588 260
0.1020 total kB 106880 1588 260
0.1246 total kB 106880 1588 260
0.1136 total kB 106880 1588 260
0.1092 total kB 106880 1588 260
0.1080 total kB 106880 1588 260
..
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux release for currently deployed products. This request is not yet committed for inclusion in a release. The issue of the customer is fixed by the testpackage. Does this patch also resolve the issue in RHEL 6? https://bugzilla.redhat.com/show_bug.cgi?id=921455 Yes and no. These bugs are a little messy. Bug for rhel 5 is in fact 2 (absolutely unrelated) bugs in one, for which we have two reproducers. Both of them are fixed in rhel5. The rhel6 bug is in fact 3 (absolutely unrelated) bugs with 3 reproducers. The first two are the same. So this patch will work and fix them. The third one is different and won't be fixed by this patch. We don't have patch for that reproducer yet. added fix for the remaining reproducer from rhel6 clone bug Created attachment 767425 [details]
patch to fix this v2
Created attachment 767886 [details]
patch to fix this v3
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-2013-1351.html |