Package: bash
Version: 3.0-17
Severity: normal
Tags: patch

Hi

There's a memory leak in the programmable completion code:

$ ps u $$
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
alexis   19754  4.6  1.4   6972  3624 pts/5    S    03:49   0:00 bash
$ for i in `seq 10000`; do compgen -W 'foo bar' > /dev/null; done; ps u $$
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
alexis   19754  4.8  2.3   9228  5956 pts/5    R    03:49   0:01 bash
$ for i in `seq 10000`; do compgen -W 'foo bar' > /dev/null; done; ps u $$
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
alexis   19754  7.8  2.9  10788  7516 pts/5    R    03:49   0:03 bash
$ for i in `seq 10000`; do compgen -W 'foo bar' > /dev/null; done; ps u $$
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
alexis   19754 10.2  3.5  12352  9080 pts/5    S    03:49   0:04 bash

After applying the attached patch (which was only lightly tested), I
don't get this problem anymore.

Alexis

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14
Locale: LANG=C, LC_CTYPE=pt_BR.UTF-8 (charmap=UTF-8)

Versions of packages bash depends on:
ii  base-files                    3.1.9      Debian base system miscellaneous f
ii  libc6                         2.3.5-7    GNU C Library: Shared libraries an
ii  libncurses5                   5.5-1      Shared libraries for terminal hand
ii  passwd                        1:4.0.13-6 change and administer password and

bash recommends no packages.

-- no debconf information
 pcomplete.c |    1 +
 1 file changed, 1 insertion(+)

Index: bash/pcomplete.c
===================================================================
--- bash.orig/pcomplete.c       2005-11-13 03:15:29.000000000 -0200
+++ bash/pcomplete.c    2005-11-13 03:21:06.000000000 -0200
@@ -843,6 +843,7 @@ gen_wordlist_matches (cs, text)
     }
   sl->list[sl->list_len = nw] = (char *)NULL;
 
+  dispose_words (l2);
   FREE (ntxt);
   return sl;
 }

Reply via email to