mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-13 19:52:20 +00:00
The memory leak regression tests added in commit 05683ec7
only leak memory
in the C.UTF-8 locale if ksh is compiled with vmalloc. I've ran these
regression tests against ksh93v- and neither fail in that version of
ksh, which indicates the bug causing these tests to fail may be similar to
the one that causes <https://github.com/ksh93/ksh/issues/95>.
Since the memory leak tests work with -D_std_malloc, only set $LANG to
'C' if ksh is compiled with vmalloc enabled.
This commit is contained in:
parent
0dd115e4b4
commit
eca92ea48c
1 changed files with 5 additions and 3 deletions
|
@ -29,6 +29,7 @@ if builtin vmstate 2>/dev/null &&
|
||||||
then N=512 # number of iterations for each test
|
then N=512 # number of iterations for each test
|
||||||
unit=bytes
|
unit=bytes
|
||||||
tolerance=$((4*N)) # tolerate 4 bytes per iteration to account for vmalloc artefacts
|
tolerance=$((4*N)) # tolerate 4 bytes per iteration to account for vmalloc artefacts
|
||||||
|
vmalloc=enabled
|
||||||
function getmem
|
function getmem
|
||||||
{
|
{
|
||||||
vmstate --format='%(busy_size)u'
|
vmstate --format='%(busy_size)u'
|
||||||
|
@ -253,8 +254,9 @@ err_exit_if_leak 'script sourced in virtual subshell'
|
||||||
# Multiple leaks when using arrays in functions (Red Hat #921455)
|
# Multiple leaks when using arrays in functions (Red Hat #921455)
|
||||||
# Fix based on: https://src.fedoraproject.org/rpms/ksh/blob/642af4d6/f/ksh-20120801-memlik.patch
|
# Fix based on: https://src.fedoraproject.org/rpms/ksh/blob/642af4d6/f/ksh-20120801-memlik.patch
|
||||||
|
|
||||||
# TODO: both of these tests still leak (although much less after the patch) when run in a non-C locale.
|
# TODO: When ksh is compiled with vmalloc, both of these tests still leak (although much less
|
||||||
saveLANG=$LANG; LANG=C # comment out to test remaining leak (1/2)
|
# after the patch) when run in a non-C locale.
|
||||||
|
[[ $vmalloc == enabled ]] && saveLANG=$LANG && LANG=C # comment out to test remaining leak (1/2)
|
||||||
|
|
||||||
function _hash
|
function _hash
|
||||||
{
|
{
|
||||||
|
@ -282,7 +284,7 @@ done
|
||||||
after=$(getmem)
|
after=$(getmem)
|
||||||
err_exit_if_leak 'indexed array in function'
|
err_exit_if_leak 'indexed array in function'
|
||||||
|
|
||||||
LANG=$saveLANG # comment out to test remaining leak (2/2)
|
[[ $vmalloc == enabled ]] && LANG=$saveLANG # comment out to test remaining leak (2/2)
|
||||||
|
|
||||||
# ======
|
# ======
|
||||||
# Memory leak in typeset (Red Hat #1036470)
|
# Memory leak in typeset (Red Hat #1036470)
|
||||||
|
|
Loading…
Reference in a new issue