Opened 14 years ago

Last modified 8 years ago

#381 closed defect (Fixed)

Leaking cached_resolve_t

Reported by: nickm Owned by:
Priority: Low Milestone: 0.1.2.x-final
Component: Core Tor/Tor Version:
Severity: Keywords:
Cc: nickm Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


02:45 < phobos> 1169451822: 21908908: total-size count source
02:45 < phobos> 1169451822: 21908908: 73920 231 dns.c:685
02:45 < phobos> 1169451822: 21908908: 168 2 bn_lib.c:328
02:45 < phobos> 1169451822: 21908908: 48 2 bn_lib.c:295
02:45 < phobos> 1169451822: 21908908: 74136 235 Total of 3
02:47 < nickm> huh.
02:47 < nickm> Okay, that's easy to fix, I think.
02:47 < nickm> Is that svn, or, or other?
02:47 < phobos>
02:48 < phobos> i'm testing svn now
02:49 < phobos> or i can wait for a fix
02:49 < phobos> either way
02:49 < nickm> hmm.
02:49 < phobos> err, either way i've already destroyed my tor server
uptime and


02:49 < nickm> actually, less trivial.
02:49 < nickm> I'll have to think a touch.
02:49 < nickm> That's definitely lost?
02:50 < nickm> and not, say, "reachable"?

In, this line is:

resolve = tor_malloc_zero(sizeof(cached_resolve_t));

in dns_resolve().

So apparently we have some cached_resolve_t items that are never freed.

[Automatically added by flyspray2trac: Operating System: All]

Child Tickets

Change History (4)

comment:1 Changed 14 years ago by nickm

One possibility: this may not be a true leak. In the code for dns_free_all, we free every
cached_resolve_t in cache_root, and we free the cached_resolve_pqueue list... but we don't
free the members of the cached_resolve_pqueue list that are not in the cache.

If I remember my hare-brained implementation of expiry, this will result in us leaking a
cached_resolve_t for every no-longer-pending resolve that was launched in the last five

comment:2 Changed 14 years ago by nickm

Okay, r9386 will probably stop the leak I describe in the above comment. Alas, I've no idea
whether there are more: let's see what happens the next time somebody dmallocs an exit node.

comment:3 Changed 14 years ago by nickm

flyspray2trac: bug closed.
Seems to be fixed in r9386.

comment:4 Changed 8 years ago by nickm

Component: Tor RelayTor
Note: See TracTickets for help on using tickets.