zsh-workers
 help / color / mirror / code / Atom feed
From: Felix Rosencrantz <f_rosencrantz@yahoo.com>
To: zsh-workers <zsh-workers@sunsite.auc.dk>
Subject: PATCH: Small memory leak and doc fix
Date: Fri, 2 Jun 2000 20:23:59 -0700 (PDT)	[thread overview]
Message-ID: <20000603032359.27133.qmail@web1303.mail.yahoo.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1476 bytes --]

Here's another memory leak fix along with a small doc fix.

There seems to be some situations when the following code will see
uninitialized memory reads from the following stack:
	pattern_match  [compmatch.c:1035]
        match_str      [compmatch.c:577]
        comp_match     [compmatch.c:941]
        addmatches     [compcore.c:1954]
        bin_compadd    [complete.c:595]
I haven't looked into this, so if more details are needed let me know.

--- Sven Wischnowsky <wischnow@informatik.hu-berlin.de> wrote:
>Hmm. Maybe we get this because some parameter setfn() neither uses nor 
>frees the string it gets.
I took a look at some of the memory that wasn't freed, and found one of the
strings had a value that only came out of the value of complist
("ambiguous packed rows").  So something that touches that value has a problem.
Maybe a parameter operator.

>I can't see where this comes from. mkautofn() creates the
>autofn-program wich is then freed in loadautofn() (or
>freeshfuncnode(), with ksh-autoloading).
>
>All these autofn-progs won't be freed at the end, though (together
>with many other things).

I can see these errors even before the shell exits.  The memory checker
will only list a memory leak if there are no pointers in memory to a memory
block.  We are probably losing the pointer to the memory from buitlin.c:2162.

-FR


__________________________________________________
Do You Yahoo!?
Yahoo! Photos -- now, 100 FREE prints!
http://photos.yahoo.com

[-- Attachment #2: patch7.txt --]
[-- Type: text/plain, Size: 1145 bytes --]

Index: Src/Zle/compcore.c
===================================================================
--- zsh/Src/Zle/ocompcore.c	Fri Jun  2 01:09:56 2000
+++ zsh/Src/Zle/compcore.c	Fri Jun  2 19:16:33 2000
@@ -733,6 +733,7 @@
 	}
 	compinsert = (useline < 0 ? tricat("tab ", "", compinsert) :
 		      ztrdup(compinsert));
+	zsfree(compexact);
 	if (useexact)
 	    compexact = ztrdup("accept");
 	else {

Index: Doc/Zsh/mod_complist.yo
===================================================================
--- zsh/Doc/Zsh/omod_complist.yo	Sun May 21 11:27:36 2000
+++ zsh/Doc/Zsh/mod_complist.yo	Fri Jun  2 19:33:20 2000
@@ -144,7 +144,7 @@
 letter will be replaced with a string of fixed width, padded to the
 right with spaces, while the lowercase form will not be padded.
 
-If the option att(LISTPROMPT) is set, the completion code will not ask if
+If the parameter tt(LISTPROMPT) is set, the completion code will not ask if
 the list should be shown.  Instead it immediately starts displaying the
 list, stopping after the first screenful, showing the prompt at the bottom,
 waiting for a keypress after temporarily switching to the tt(listscroll)

             reply	other threads:[~2000-06-03  3:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-03  3:23 Felix Rosencrantz [this message]
2000-06-05  7:55 Sven Wischnowsky
2000-06-06  5:31 Felix Rosencrantz
2000-06-07 13:23 Sven Wischnowsky
2000-06-08  2:50 Felix Rosencrantz
2000-06-08  9:20 Sven Wischnowsky
2000-06-09  5:26 Felix Rosencrantz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20000603032359.27133.qmail@web1303.mail.yahoo.com \
    --to=f_rosencrantz@yahoo.com \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).