Opened 10 years ago

Last modified 5 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: 0.1.2.5-alpha
Severity: Keywords:
Cc: nickm Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description


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 0.1.2.6, or other?
02:47 < phobos> 0.1.2.6-alpha
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

stability

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 0.1.2.6, 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 10 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
minutes.

comment:2 Changed 10 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 10 years ago by nickm

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

comment:4 Changed 5 years ago by nickm

  • Component changed from Tor Relay to Tor
Note: See TracTickets for help on using tickets.