zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@berkom.de>
To: zsh-workers@sunsite.dk
Subject: Re: valgrind: useful memory checker
Date: Wed, 24 Apr 2002 09:56:05 +0200	[thread overview]
Message-ID: <15558.25877.644500.459450@wischnow.berkom.de> (raw)
In-Reply-To: <20020422182026.19547.qmail@web10401.mail.yahoo.com>


Felix Rosencrantz wrote:

> ...
> 
> Also, I ran valgrind on zsh interactively for a little bit, did
> some completions and found a couple leaks.  Of course, adding valgrind
> to the automated tests would be quite useful.
> 
> -FR.
> ==3725== 80 bytes in 1 blocks are definitely lost in loss record 45 of 136
> ==3725==    at 0x808C516: zalloc (in /bin/linux/zsh-020416d/bin/zsh)
> ==3725==    by 0x80A3010: patcompile (in /bin/linux/zsh-020416d/bin/zsh)
> ==3725==    by 0x413C4011: bin_zstyle (in
> /bin/linux/zsh-020416d/lib/zsh/4.1.0-dev-4-020416/zsh/zutil.so)
> ==3725==    by 0x8052425: execbuiltin (in /bin/linux/zsh-020416d/bin/zsh)
> ==3725==    by 0x8067E93: execcmd (in /bin/linux/zsh-020416d/bin/zsh)
> ==3725==    by 0x806484B: execpline2 (in /bin/linux/zsh-020416d/bin/zsh)
> ==3725==    by 0x8063DDF: execpline (in /bin/linux/zsh-020416d/bin/zsh)
> ==3725==    by 0x80637D3: execlist (in /bin/linux/zsh-020416d/bin/zsh)

Do you set the same style for the same pattern twice?

> ==3725== 132 bytes in 33 blocks are definitely lost in loss record 62 of 136
> ==3725==    at 0x808C516: zalloc (in /bin/linux/zsh-020416d/bin/zsh)
> ==3725==    by 0x80B9DE2: zarrdup (in /bin/linux/zsh-020416d/bin/zsh)
> ==3725==    by 0x411EC6D4: comp_wrapper (in
> /bin/linux/zsh-020416d/lib/zsh/4.1.0-dev-4-020416/zsh/complete.so)
> ==3725==    by 0x806AB53: runshfunc (in /bin/linux/zsh-020416d/bin/zsh)
> ==3725==    by 0x806A973: doshfunc (in /bin/linux/zsh-020416d/bin/zsh)
> ==3725==    by 0x806A33C: execshfunc (in /bin/linux/zsh-020416d/bin/zsh)
> ==3725==    by 0x8067E09: execcmd (in /bin/linux/zsh-020416d/bin/zsh)
> ==3725==    by 0x806484B: execpline2 (in /bin/linux/zsh-020416d/bin/zsh)
> ==3725== 

These are 33 times a char ** to a NULL pointer. The copied compredirs
array.


Bye
  Sven

Index: Src/Modules/zutil.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/zutil.c,v
retrieving revision 1.9
diff -u -r1.9 zutil.c
--- Src/Modules/zutil.c	9 Jul 2001 16:05:14 -0000	1.9
+++ Src/Modules/zutil.c	24 Apr 2002 07:56:12 -0000
@@ -132,6 +132,7 @@
 		freearray(p->vals);
 	    if (p->eval)
 		freeeprog(p->eval);
+            freepatprog(p->prog);
 	    p->vals = zarrdup(vals);
 	    p->eval = eprog;
 
Index: Src/Zle/complete.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/complete.c,v
retrieving revision 1.20
diff -u -r1.20 complete.c
--- Src/Zle/complete.c	1 Mar 2002 10:42:02 -0000	1.20
+++ Src/Zle/complete.c	24 Apr 2002 07:56:12 -0000
@@ -1320,6 +1320,7 @@
 	    zsfree(oqs);
 	    zsfree(oaq);
 	    freearray(owords);
+	    freearray(oredirs);
 	}
 	zsfree(comprestore);
 	comprestore = orest;

-- 
Sven Wischnowsky                          wischnow@berkom.de


  parent reply	other threads:[~2002-04-24  7:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-22 18:20 Felix Rosencrantz
2002-04-22 18:32 ` Bart Schaefer
2002-04-22 22:10   ` Julian Seward
2002-04-24  7:56 ` Sven Wischnowsky [this message]
2002-04-25  5:27   ` Felix Rosencrantz
2002-04-26  6:00     ` 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=15558.25877.644500.459450@wischnow.berkom.de \
    --to=wischnow@berkom.de \
    --cc=zsh-workers@sunsite.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).