Michal Hlavinka
2013-07-09 16:42:02 UTC
Hi,
we found two memory leaks in ksh.
1) first one is related to an alias.
### set up
alias ls='/bin/ls -ltr'
### and call it in a loop
a=`ls some_file_that_does_not_exist 2>/dev/null`
as a result, ksh eats more and more memory
2) second one is related to autoloaded functions
### set up
cat >test48_autoload <<EOF
#!/bin/ksh
function test48_autoload
{
echo "function call"
}
EOF
FPATH=.
autoload test48_autoload
### and call it in a loop
a=`test48_autoload`
again, ksh eats more and more memory.
Complete reproducers are attached.
Michal
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reproducer1.sh
Type: application/x-shellscript
Size: 317 bytes
Desc: not available
URL: <http://lists.research.att.com/pipermail/ast-developers/attachments/20130709/705175c9/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reproducer3.sh
Type: application/x-shellscript
Size: 395 bytes
Desc: not available
URL: <http://lists.research.att.com/pipermail/ast-developers/attachments/20130709/705175c9/attachment-0001.bin>
we found two memory leaks in ksh.
1) first one is related to an alias.
### set up
alias ls='/bin/ls -ltr'
### and call it in a loop
a=`ls some_file_that_does_not_exist 2>/dev/null`
as a result, ksh eats more and more memory
2) second one is related to autoloaded functions
### set up
cat >test48_autoload <<EOF
#!/bin/ksh
function test48_autoload
{
echo "function call"
}
EOF
FPATH=.
autoload test48_autoload
### and call it in a loop
a=`test48_autoload`
again, ksh eats more and more memory.
Complete reproducers are attached.
Michal
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reproducer1.sh
Type: application/x-shellscript
Size: 317 bytes
Desc: not available
URL: <http://lists.research.att.com/pipermail/ast-developers/attachments/20130709/705175c9/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reproducer3.sh
Type: application/x-shellscript
Size: 395 bytes
Desc: not available
URL: <http://lists.research.att.com/pipermail/ast-developers/attachments/20130709/705175c9/attachment-0001.bin>