hidden-service-circ-related memory leaks?
Running moria1 under valgrind on git master (c48d6da24c403), when #3047 (moved) triggered.
==14131== 424 bytes in 1 blocks are still reachable in loss record 4 of 22 ==14131== at 0x4C2260E: malloc (vg_replace_malloc.c:207) ==14131== by 0x462198: orconn_circid_map_HT_GROW (circuitlist.c:77) ==14131== by 0x462AC4: circuit_set_circid_orconn_helper (circuitlist.c:76) ==14131== by 0x462B83: circuit_set_n_circid_orconn (circuitlist.c:189) ==14131== by 0x45954C: circuit_deliver_create_cell (circuitbuild.c:1880) ==14131== by 0x45C038: circuit_send_next_onion_skin (circuitbuild.c:2020) ==14131== by 0x45CC03: circuit_handle_first_hop (circuitbuild.c:1769) ==14131== by 0x45F950: circuit_establish_circuit (circuitbuild.c:1705) ==14131== by 0x429028: rend_services_introduce (rendservice.c:1262) ==14131== by 0x467D72: circuit_build_needed_circs (circuituse.c:655) ==14131== by 0x40BE3D: second_elapsed_callback (main.c:1383) ==14131== by 0x52C6EC0: event_base_loop (in /usr/lib/libevent-1.3e.so.1.0.3)
==14131== 960 bytes in 17 blocks are indirectly lost in loss record 7 of 22 ==14131== at 0x4C2260E: malloc (vg_replace_malloc.c:207) ==14131== by 0x57A08F2: CRYPTO_malloc (in /usr/lib/libcrypto.so.0.9.8) ==14131== by 0x57CBFD1: (within /usr/lib/libcrypto.so.0.9.8) ==14131== by 0x57CC12C: bn_expand2 (in /usr/lib/libcrypto.so.0.9.8) ==14131== by 0x57CC387: BN_copy (in /usr/lib/libcrypto.so.0.9.8) ==14131== by 0x57D2BFC: BN_mod_inverse (in /usr/lib/libcrypto.so.0.9.8) ==14131== by 0x57E8EDE: RSA_generate_key_ex (in /usr/lib/libcrypto.so.0.9.8) ==14131== by 0x4CF2AC: crypto_pk_generate_key_with_bits (crypto.c:493) ==14131== by 0x428EC2: rend_services_introduce (rendservice.c:1885) ==14131== by 0x467D72: circuit_build_needed_circs (circuituse.c:655) ==14131== by 0x40BE3D: second_elapsed_callback (main.c:1383) ==14131== by 0x52C6EC0: event_base_loop (in /usr/lib/libevent-1.3e.so.1.0.3)
==14131== 1,056 (96 direct, 960 indirect) bytes in 2 blocks are definitely lost in loss record 8 of 22 ==14131== at 0x4C2260E: malloc (vg_replace_malloc.c:207) ==14131== by 0x4C66C7: _tor_malloc (util.c:138) ==14131== by 0x4C7C75: _tor_malloc_zero (util.c:164) ==14131== by 0x428F59: rend_services_introduce (rendservice.c:1288) ==14131== by 0x467D72: circuit_build_needed_circs (circuituse.c:655) ==14131== by 0x40BE3D: second_elapsed_callback (main.c:1383) ==14131== by 0x52C6EC0: event_base_loop (in /usr/lib/libevent-1.3e.so.1.0.3) ==14131== by 0x409740: do_main_loop (main.c:1786) ==14131== by 0x409A44: tor_main (main.c:2457) ==14131== by 0x5F031A5: (below main) (libc-start.c:222)
==14131== 6,317 bytes in 777 blocks are still reachable in loss record 10 of 22 ==14131== at 0x4C2260E: malloc (vg_replace_malloc.c:207) ==14131== by 0x5F51FDF: vasprintf (vasprintf.c:77) ==14131== by 0x4BA5CA: tor_vasprintf (compat.c:389) ==14131== by 0x4BA68C: tor_asprintf (compat.c:368) ==14131== by 0x42B929: rep_hist_update_bwhist_state_section (rephist.c:1625) ==14131== by 0x42BA47: rep_hist_update_state (rephist.c:1652) ==14131== by 0x46C9E0: or_state_save (config.c:5323) ==14131== by 0x40B85A: second_elapsed_callback (main.c:1426) ==14131== by 0x52C6EC0: event_base_loop (in /usr/lib/libevent-1.3e.so.1.0.3) ==14131== by 0x409740: do_main_loop (main.c:1786) ==14131== by 0x409A44: tor_main (main.c:2457) ==14131== by 0x5F031A5: (below main) (libc-start.c:222)
==14131== 34,320 bytes in 4 blocks are still reachable in loss record 11 of 22 ==14131== at 0x4C2260E: malloc (vg_replace_malloc.c:207) ==14131== by 0x4BE408: strmap_impl_HT_GROW (container.c:906) ==14131== by 0x4BEC76: strmap_set (container.c:905) ==14131== by 0x4BEE09: strmap_set_lc (container.c:1112) ==14131== by 0x4B35CE: geoip_add_entry (geoip.c:88) ==14131== by 0x4B3713: geoip_parse_entry (geoip.c:123) ==14131== by 0x4B38E1: geoip_load_file (geoip.c:229) ==14131== by 0x471A8D: options_act (config.c:1378) ==14131== by 0x472A4A: set_options (config.c:674) ==14131== by 0x4730CE: options_init_from_string (config.c:4283) ==14131== by 0x4734B9: options_init_from_torrc (config.c:4157) ==14131== by 0x408424: tor_init (main.c:2139)
==14131== 49,208 bytes in 1 blocks are still reachable in loss record 13 of 22 ==14131== at 0x4C2260E: malloc (vg_replace_malloc.c:207) ==14131== by 0x413418: nodelist_map_HT_GROW (nodelist.c:54) ==14131== by 0x414144: node_get_or_create (nodelist.c:53) ==14131== by 0x414335: nodelist_set_consensus (nodelist.c:182) ==14131== by 0x411435: networkstatus_set_current_consensus (networkstatus.c:1787) ==14131== by 0x4122AF: router_reload_consensus_networkstatus (networkstatus.c:230) ==14131== by 0x40964E: do_main_loop (main.c:1738) ==14131== by 0x409A44: tor_main (main.c:2457) ==14131== by 0x5F031A5: (below main) (libc-start.c:222)
==14131== 98,312 bytes in 1 blocks are still reachable in loss record 14 of 22 ==14131== at 0x4C2260E: malloc (vg_replace_malloc.c:207) ==14131== by 0x4176D8: policy_map_HT_GROW (policies.c:545) ==14131== by 0x41793C: addr_policy_get_canonical_entry (policies.c:544) ==14131== by 0x442D3B: router_parse_addr_policy (routerparse.c:3654) ==14131== by 0x44918A: router_parse_entry_from_string (routerparse.c:3601) ==14131== by 0x449B53: router_parse_list_from_string (routerparse.c:1205) ==14131== by 0x43FAD1: router_load_routers_from_string (routerlist.c:3874) ==14131== by 0x43FF6B: router_reload_router_list_impl (routerlist.c:848) ==14131== by 0x4400A1: router_reload_router_list (routerlist.c:898) ==14131== by 0x40965C: do_main_loop (main.c:1742) ==14131== by 0x409A44: tor_main (main.c:2457) ==14131== by 0x5F031A5: (below main) (libc-start.c:222)
==14131== 3,907,584 bytes in 3,612 blocks are still reachable in loss record 17 of 22 ==14131== at 0x4C22741: realloc (vg_replace_malloc.c:429) ==14131== by 0x4C6607: _tor_realloc (util.c:183) ==14131== by 0x4BF54B: smartlist_add (container.c:71) ==14131== by 0x44CD4F: networkstatus_v2_parse_from_string (routerparse.c:2339) ==14131== by 0x411CC9: router_set_networkstatus_v2 (networkstatus.c:731) ==14131== by 0x4127D3: router_reload_v2_networkstatus (networkstatus.c:175) ==14131== by 0x409634: do_main_loop (main.c:1735) ==14131== by 0x409A44: tor_main (main.c:2457) ==14131== by 0x5F031A5: (below main) (libc-start.c:222)
==14131== 4,083,552 bytes in 18 blocks are still reachable in loss record 18 of 22 ==14131== at 0x4C2260E: malloc (vg_replace_malloc.c:207) ==14131== by 0x4BE008: digestmap_impl_HT_GROW (container.c:911) ==14131== by 0x4BE242: digestmap_set (container.c:1017) ==14131== by 0x49E461: dirserv_set_cached_networkstatus_v2 (dirserv.c:1444) ==14131== by 0x40FEBD: add_networkstatus_to_cache (networkstatus.c:683) ==14131== by 0x412055: router_set_networkstatus_v2 (networkstatus.c:893) ==14131== by 0x4127D3: router_reload_v2_networkstatus (networkstatus.c:175) ==14131== by 0x409634: do_main_loop (main.c:1735) ==14131== by 0x409A44: tor_main (main.c:2457) ==14131== by 0x5F031A5: (below main) (libc-start.c:222)
==14131== 6,039,596 bytes in 164,801 blocks are still reachable in loss record 19 of 22 ==14131== at 0x4C2260E: malloc (vg_replace_malloc.c:207) ==14131== by 0x5F5FDF1: strdup (strdup.c:43) ==14131== by 0x4C60DD: _tor_strdup (util.c:206) ==14131== by 0x4C01CE: log_set_application_name (log.c:154) ==14131== by 0x408307: tor_init (main.c:2101) ==14131== by 0x4099D5: tor_main (main.c:2450) ==14131== by 0x5F031A5: (below main) (libc-start.c:222)