Opened 6 years ago

Closed 5 years ago

#8718 closed defect (fixed)

memory leak whenever a config change happens

Reported by: arma Owned by:
Priority: Medium Milestone: Tor: 0.2.4.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: tor-client 023-backport
Cc: weasel Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

==10870== 10 bytes in 1 blocks are definitely lost in loss record 1 of 27
==10870==    at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==10870==    by 0x5FDEB41: strdup (strdup.c:43)
==10870==    by 0x22111D: tor_strdup_ (in /usr/sbin/tor)
==10870==    by 0x1B8C04: config_get_assigned_option (in /usr/sbin/tor)
==10870==    by 0x1B580A: set_options (in /usr/sbin/tor)
==10870==    by 0x1B70FC: options_trial_assign (in /usr/sbin/tor)
==10870==    by 0x1D3FCD: control_setconf_helper (in /usr/sbin/tor)
==10870==    by 0x1D7584: connection_control_process_inbuf (in /usr/sbin/tor)
==10870==    by 0x1C11CC: connection_handle_read (in /usr/sbin/tor)
==10870==    by 0x11DEA0: conn_read_callback (in /usr/sbin/tor)
==10870==    by 0x52D8CCB: event_base_loop (in /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5.1.7)
==10870==    by 0x11E834: do_main_loop (in /usr/sbin/tor)
==10870== 
==10870== 42 bytes in 1 blocks are definitely lost in loss record 13 of 27
==10870==    at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==10870==    by 0x220DE7: tor_malloc_ (in /usr/sbin/tor)
==10870==    by 0x216DF2: smartlist_join_strings2 (in /usr/sbin/tor)
==10870==    by 0x1B8C9A: config_get_assigned_option (in /usr/sbin/tor)
==10870==    by 0x1B580A: set_options (in /usr/sbin/tor)
==10870==    by 0x1B70FC: options_trial_assign (in /usr/sbin/tor)
==10870==    by 0x1D3FCD: control_setconf_helper (in /usr/sbin/tor)
==10870==    by 0x1D7584: connection_control_process_inbuf (in /usr/sbin/tor)
==10870==    by 0x1C11CC: connection_handle_read (in /usr/sbin/tor)
==10870==    by 0x11DEA0: conn_read_callback (in /usr/sbin/tor)
==10870==    by 0x52D8CCB: event_base_loop (in /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5.1.7)
==10870==    by 0x11E834: do_main_loop (in /usr/sbin/tor)

Child Tickets

Change History (10)

comment:1 Changed 6 years ago by nickm

Keywords: tor-client added
Milestone: Tor: 0.2.4.x-final

comment:2 Changed 6 years ago by nickm

Keywords: 023-backport added
Status: newneeds_review

Looks like this was introduced in 0.2.3.3-alpha, by 02c62b29.

If we backport this fix to 0.2.3, we should first merge #7816, which fixes a related leak in the same code.

I have a likely fix in branch "bug8716_023", which is based off of the fix branch for #7816.

comment:3 Changed 6 years ago by nickm

Milestone: Tor: 0.2.4.x-finalTor: 0.2.3.x-final

This got merged into 0.2.4.12-alpha; changing milestone to 0.2.3 for the backport.

comment:4 Changed 6 years ago by arma

Are you sure it got merged into 0.2.4.12-alpha?

comment:5 Changed 6 years ago by nickm

I guess I was wrong. Perhaps because I misnamed the branch? Merging the branch to 0.2.4, leaving this ticket in 0.2.3 marked for backport.

comment:6 Changed 6 years ago by arma

Cc: weasel added

weasel, what's your preference here in terms of whether this goes into 0.2.3.26?

comment:7 Changed 6 years ago by weasel

I was about to err on the side of caution and remain quite conservative here, but looking at what already is queued up and in maint-0.2.3 there's probably little point. Just put it in?

comment:8 Changed 6 years ago by arma

I've been trying to err on the side of caution pretty consistently here. There isn't that much queued up, is there? :)

comment:9 Changed 6 years ago by nickm

I don't think this one is actually hurting anybody; I would be okay leaving it out for now

comment:10 Changed 5 years ago by nickm

Milestone: Tor: 0.2.3.x-finalTor: 0.2.4.x-final
Resolution: fixed
Status: needs_reviewclosed

Marking a batch of tickets that had been under consideration for 0.2.3 backport as fixed-in-0.2.4. There is no plan for further 0.2.3 releases.

Note: See TracTickets for help on using tickets.