Opened 9 years ago

Closed 8 years ago

Last modified 7 years ago

#2373 closed defect (fixed)

tor memory not freed at exit

Reported by: arma Owned by:
Priority: Medium Milestone: Tor: 0.2.2.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: tor-relay
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

==6759== 131,072 bytes in 1 blocks are still reachable in loss record 13 of 16
==6759==    at 0x4C22741: realloc (vg_replace_malloc.c:429)
==6759==    by 0x4C4037: _tor_realloc (util.c:183)
==6759==    by 0x4BD05B: smartlist_add (container.c:71)
==6759==    by 0x429B61: rep_hist_buffer_stats_add_circ (rephist.c:2271)
==6759==    by 0x462491: circuit_free (circuitlist.c:497)
==6759==    by 0x462784: circuit_close_all_marked (circuitlist.c:298)
==6759==    by 0x40B73F: second_elapsed_callback (main.c:1381)
==6759==    by 0x52C6EC0: event_base_loop (in /usr/lib/libevent-1.3e.so.1.0.3)
==6759==    by 0x409590: do_main_loop (main.c:1750)
==6759==    by 0x409894: tor_main (main.c:2433)
==6759==    by 0x5F021A5: (below main) (libc-start.c:222)

==6759== 305,540 bytes in 12,543 blocks are still reachable in loss record 14 of 16
==6759==    at 0x4C2260E: malloc (vg_replace_malloc.c:207)
==6759==    by 0x4C40F7: _tor_malloc (util.c:138)
==6759==    by 0x4B9B4A: smartlist_create (container.c:34)
==6759==    by 0x4BE7A4: init_logging (log.c:602)
==6759==    by 0x409815: tor_main (main.c:2410)
==6759==    by 0x5F021A5: (below main) (libc-start.c:222)

From running valgrind on moria1 running master (fd8f7991e47d02cc).

I mention the first entry because it's a lot of bytes, and the second because it's a lot of allocs.

Child Tickets

Change History (7)

comment:1 Changed 9 years ago by nickm

Milestone: Tor: 0.2.2.x-final

Calling this "0.2.2.x", since I am pretty sure that the code here is not significantly different between the two versions.

comment:2 Changed 9 years ago by nickm

The second one is pretty confusing;init_logging should only ever get called once from main.c

comment:3 Changed 8 years ago by nickm

Status: newneeds_review

See branch bug2373 in my public repository.

comment:4 Changed 8 years ago by Sebastian

Looks plausible, and testing seems to confirm that these are the two cases that arma's valgrind spotted.

comment:5 Changed 8 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

thanks for the review! Merging & closing.

comment:6 Changed 7 years ago by nickm

Keywords: tor-relay added

comment:7 Changed 7 years ago by nickm

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