Opened 3 years ago

Closed 3 years ago

#21682 closed defect (fixed)

memory leak at shutdown

Reported by: cypherpunks Owned by: nickm
Priority: Medium Milestone: Tor: 0.3.0.x-final
Component: Core Tor/Tor Version: Tor: unspecified
Severity: Minor Keywords: regression memory-leak
Cc: Actual Points: 0
Parent ID: Points: 0
Reviewer: Sponsor:

Description

=================================================================
==2636==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 7 byte(s) in 1 object(s) allocated from:

#0 0x5566c0999f40 in interceptor_strdup (/home/reince/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x4f0f40)
#1 0x5566c0ec9125 in tor_strdup_ /home/reince/tor/src/common/util.c:280:15
#2 0x5566c0cfe147 in config_get_assigned_option /home/reince/tor/src/or/confparse.c:690:17
#3 0x5566c0ccd659 in option_get_assignment /home/reince/tor/src/or/config.c:2299:10
#4 0x5566c0d77484 in handle_control_getconf /home/reince/tor/src/or/control.c:1033:31
#5 0x5566c0d77484 in connection_control_process_inbuf /home/reince/tor/src/or/control.c:5032
#6 0x5566c0d35eba in connection_process_inbuf /home/reince/tor/src/or/connection.c:4476:14
#7 0x5566c0d2596b in connection_handle_read_impl /home/reince/tor/src/or/connection.c:3451:7
#8 0x5566c0d2596b in connection_handle_read /home/reince/tor/src/or/connection.c:3492
#9 0x5566c0a44791 in conn_read_callback /home/reince/tor/src/or/main.c:733:7
#10 0x7f3842c871fc in event_persist_closure /home/reince/libevent/event.c:1580:9
#11 0x7f3842c871fc in event_process_active_single_queue /home/reince/libevent/event.c:1639

SUMMARY: AddressSanitizer: 7 byte(s) leaked in 1 allocation(s).

just once when shutting down
libevent c199df7bc78824ff579ff34c5f9f922034e8fa31
tor efa5bbaba07d20d1aacff7d1d2a5fe08a6ec2d72

Child Tickets

Change History (6)

comment:1 Changed 3 years ago by cypherpunks

correction: i believe libevent to be ffbce578c40a06491ce6585ab2d82ebb69a52d30, if that matters

comment:2 Changed 3 years ago by nickm

Milestone: Tor: 0.3.0.x-final

So it looks like the key is leaking on this case, from when it gets duplicated in config_get_assigned_option. I think it's the CONFIG_TYPE_LINELIST_S case, which is changed in 0.3.0

comment:3 Changed 3 years ago by nickm

Keywords: regression memory-leak added
Owner: set to nickm
Severity: NormalMinor
Status: newaccepted

comment:4 Changed 3 years ago by nickm

Actual Points: 0
Points: 0
Status: acceptedneeds_review

Branch bug21682_030 in my public repository has a likely fix here.

comment:5 Changed 3 years ago by dgoulet

Status: needs_reviewmerge_ready

lgtm;

comment:6 Changed 3 years ago by nickm

Resolution: fixed
Status: merge_readyclosed

merged!

Note: See TracTickets for help on using tickets.