[tor-bugs] #18641 [Core Tor/Tor]: Teach the OOM handler about uploaded descriptors on a dirauth.

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Jan 2 21:00:26 UTC 2017


#18641: Teach the OOM handler about uploaded descriptors on a dirauth.
----------------------------------------------+----------------------------
 Reporter:  nickm                             |          Owner:  nickm
     Type:  enhancement                       |         Status:  assigned
 Priority:  High                              |      Milestone:  Tor:
                                              |  0.3.0.x-final
Component:  Core Tor/Tor                      |        Version:
 Severity:  Normal                            |     Resolution:
 Keywords:  tor-dos, nickm-deferred-20160905  |  Actual Points:
Parent ID:                                    |         Points:  3
 Reviewer:                                    |        Sponsor:  SponsorU-
                                              |  can
----------------------------------------------+----------------------------

Comment (by nickm):

 Ug.  This is not going to be simple.  We don't really want to re-compute
 the total amount of space allocated in-memory for descriptors every time
 we check our memory usage... and so we'll want to have it be something
 that we track as we go along.  I *think* that the only places where we
 allocate more RAM here are in routerparse.c:
 {{{
 router->cache_info.signed_descriptor_body = tor_malloc(len+1);
 ...
 extrainfo->cache_info.signed_descriptor_body =
 tor_memdup_nulterm(s,end-s);
 ...
 cert->cache_info.signed_descriptor_body = tor_malloc(len+1);
 }}}

 And we free them several places in routerlist.c:
 {{{
 src/or/routerlist.c:        tor_free(sd->signed_descriptor_body); // sets
 it to null
 src/or/routerlist.c:  tor_free(router->cache_info.signed_descriptor_body);
 src/or/routerlist.c:
 tor_free(extrainfo->cache_info.signed_descriptor_body);
 src/or/routerlist.c:  tor_free(sd->signed_descriptor_body);
 src/or/routerlist.c:  tor_free(sd->signed_descriptor_body);
 src/or/routerlist.c:  tor_free(cert->cache_info.signed_descriptor_body);
 }}}

 but if we miss even one, the value gets out of sync, and we flip out.

 I guess maybe we could re-sync once every few minutes?

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/18641#comment:9>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list