9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] leak(1) problem
@ 2010-02-22 17:43 Steve Simon
  2010-02-22 18:01 ` Russ Cox
  0 siblings, 1 reply; 2+ messages in thread
From: Steve Simon @ 2010-02-22 17:43 UTC (permalink / raw)
  To: 9fans

I have a memory leak in my code, and am using leak(1) to track
it but I have reached an en-passe.

Leak only reports strdup(2) as being the source of the leak. I added
a setmalloctag(2) call directly after the call to strdup(2) but
leak continues to report the strdup(2) address rather than its
bounding function.

Is this expected or have I done something silly?

-Steve



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [9fans] leak(1) problem
  2010-02-22 17:43 [9fans] leak(1) problem Steve Simon
@ 2010-02-22 18:01 ` Russ Cox
  0 siblings, 0 replies; 2+ messages in thread
From: Russ Cox @ 2010-02-22 18:01 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> Leak only reports strdup(2) as being the source of the leak. I added
> a setmalloctag(2) call directly after the call to strdup(2) but
> leak continues to report the strdup(2) address rather than its
> bounding function.

There are many calls to strdup in your program,
and you didn't tag the one that is causing the leak.
That is, you guessed who was calling strdup but
did not guess correctly.  Instead of guessing, you
can put a call to setmalloctag inside strdup and
then leak will show you the offending call site.

Russ


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-22 18:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-22 17:43 [9fans] leak(1) problem Steve Simon
2010-02-22 18:01 ` Russ Cox

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