9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Russ Cox <rsc@swtch.com>
To: Axel Belinfante <Axel.Belinfante@cs.utwente.nl>
Cc: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Subject: Re: [9fans] leak
Date: Fri, 16 Sep 2005 10:16:50 -0400	[thread overview]
Message-ID: <ee9e417a050916071615b4e5a6@mail.gmail.com> (raw)
In-Reply-To: <200509161129.j8GBTC302928@zamenhof.cs.utwente.nl>

> I submitted a patch to plug the leaks I encountered --
> should I also submit a patch for the setmalloctag's
> I added to analyse what goes on?

Please do.

> > Or just think really hard.
> 
> even with leak(1) and additional setmalloctag calls
> I already had to think hard enough to make sure
> I did (free) the right thing (at the right place).

For interactive programs, it's a bit easier.
You do something 100 times and then run leak
and look for blocks that have leaked 100, 200, etc.
times.

> Something else about leak:
> when I run it in textual mode (no option or -s)
> it doesn't report leaks.
> when I run it in graphical mode (-b) I do get
> red pieces in the picture.
> This surprises (confuses) me a bit.

I this this is a bug in aux/acidleak.  I just fixed it.

> > there was an older acid leak detection library that
> > took a snapshot of the call stack on each allocation.
> > that was useful, as you say.
> 
> (just curious)
> any particular reason this was deprecated (assuming it is)?

It had fallen into disrepair by the time I wanted to
use it.  The reason I wrote leak instead of fixing the
old acid library is that the acid library doesn't help
much with threaded programs.  It ran the program
with breakpoints at malloc and free, doing processing
as the program ran.  You can't do this once there are
multiple procs running around.  Also I wanted something
that worked even if the program had already started.

Russ


  reply	other threads:[~2005-09-16 14:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-24 18:23 Steve Simon
2005-08-24 18:46 ` Sape Mullender
2005-09-15 16:01   ` Axel Belinfante
2005-09-15 16:06     ` Russ Cox
2005-09-16 11:29       ` Axel Belinfante
2005-09-16 14:16         ` Russ Cox [this message]
2005-09-15 16:11     ` Charles Forsyth

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=ee9e417a050916071615b4e5a6@mail.gmail.com \
    --to=rsc@swtch.com \
    --cc=9fans@cse.psu.edu \
    --cc=Axel.Belinfante@cs.utwente.nl \
    /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.
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).