zsh-workers
 help / color / mirror / code / Atom feed
From: Felix Rosencrantz <f_rosencrantz@yahoo.com>
To: zsh-workers <zsh-workers@sunsite.auc.dk>
Subject: Memory leaks.
Date: Thu, 1 Jun 2000 23:06:40 -0700 (PDT)	[thread overview]
Message-ID: <20000602060640.28323.qmail@web1303.mail.yahoo.com> (raw)

Since, we are sort of in a holding pattern to get a stable release,
I started doing some automated memory leak testing. 

I've already posted a couple patches, here are some possible remaining leaks
that need to be fixed.

Most of these were found by running the tests.  Some are from just my
usage of zsh.

The possible sources of the memory leaks are:
	bin_compadd()
	addvars()
	mkautofn()
	permmatches()

-FR

Memory leak from bin_compadd():
	malloc         [rtlib.o]
	zcalloc        [mem.c:469]
	parse_cmatcher [complete.c:294]
	bin_compadd    [complete.c:580]
	execbuiltin    [builtin.c:368]
	execcmd        [exec.c:2257]

Another leak in bin_compadd:
        malloc         [rtlib.o]
        zalloc         [mem.c:453]
        ztrdup         [mem.c:530]
        bin_compadd    [complete.c:574]
        execbuiltin    [builtin.c:368]
        execcmd        [exec.c:2257]

I think this is due to the fact that we do a tricat on complete.c:572, without
freeing the previous values of mstr.


Memory leak from addvars():
	malloc         [rtlib.o]
	zalloc         [mem.c:453]
	ztrdup         [mem.c:530]
	addvars        [exec.c:1510]
	execsimple     [exec.c:750]
	execlist       [exec.c:801]

Memory leak out of mkautofn():
	malloc         [rtlib.o]
	zalloc         [mem.c:453]
	mkautofn       [builtin.c:2161]
	bin_functions  [builtin.c:2143]
	execbuiltin    [builtin.c:368]
	execcmd        [exec.c:2257]
Alternate stack traces with the same malloc/zalloc/mkautofn stack:

	mkautofn
	bin_functions  [builtin.c:2143]
	bin_typeset    [builtin.c:1810]
	execbuiltin    [builtin.c:368]

	mkautofn
	eval_autoload  [builtin.c:2021]
	bin_functions  [builtin.c:2078]
	execbuiltin    [builtin.c:368]

	mkautofn
	bin_functions  [builtin.c:2143]
	execbuiltin    [builtin.c:368]
	execcmd        [exec.c:2257]

Memory leak from memory allocated in permmatches():
	malloc         [rtlib.o]
	zcalloc        [mem.c:469]
	permmatches    [compcore.c:2771]
	get_nmatches   [complete.c:1057]
	getstrvalue    [params.c:1367]
	getarg         [params.c:967]

Another trace:
        permmatches    [compcore.c:2771]
        list_lines     [compresult.c:1154]
        get_listlines  [complete.c:1064]
        getstrvalue    [params.c:1367]


Memory leak from set_gmatcher():
        malloc         [rtlib.o]
        zcalloc        [mem.c:469]
        parse_cmatcher [complete.c:294]
        set_gmatcher   [compctl.c:313]
        get_gmatcher   [compctl.c:341]
        bin_compctl    [compctl.c:1587]

(I guess this is still in my startup files...)


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


                 reply	other threads:[~2000-06-02  6:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20000602060640.28323.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).