Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#20401 closed defect (fixed)

minor memory leak in threadpool_queue_update()

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


Running Tor ish on moria1 for a day under valgrind, I found

==37985== 128 bytes in 8 blocks are definitely lost in loss record 33 of 92
==37985==    at 0x4A06A2E: malloc (vg_replace_malloc.c:270)
==37985==    by 0x269C27: tor_malloc_ (util.c:150)
==37985==    by 0x26B5A5: tor_malloc_zero_ (util.c:178)
==37985==    by 0x21E39E: worker_state_new (cpuworker.c:44)
==37985==    by 0x26FD1C: threadpool_queue_update (workqueue.c:363)
==37985==    by 0x21E25C: cpuworkers_rotate_keyinfo (cpuworker.c:187)
==37985==    by 0x14D3E9: signal_callback (main.c:2173)
==37985==    by 0x2B8FFA: event_signal_closure (in /home/tord/git/src/or/tor)
==37985==    by 0x2B9CE9: event_process_active_single_queue (in /home/tord/git/src/or/tor)
==37985==    by 0x2BA3BF: event_process_active (in /home/tord/git/src/or/tor)
==37985==    by 0x2BAB23: event_base_loop (in /home/tord/git/src/or/tor)
==37985==    by 0x14A05E: do_main_loop (main.c:2370)

Check out git show a52e5491, which went into Tor

Child Tickets

Change History (8)

comment:1 Changed 3 years ago by nickm

Milestone: Tor: 0.2.9.x-final

comment:2 Changed 3 years ago by nickm

Status: newneeds_review

See branch bug20401_029 in my public repository?

comment:3 Changed 3 years ago by arma

Patch looks plausible!

comment:4 Changed 3 years ago by arma

Status: needs_reviewmerge_ready

comment:5 Changed 3 years ago by arma

(In #20406 I see an "029 rationale" section, which seems like a great idea. If you wanted to move this ticket to 0.3.0, since it's a minor thing and isn't a regression in 0.2.9, I would support that. But if you wanted to put it into 029 because then we have it, I would support that too.)

comment:6 Changed 3 years ago by nickm

029 rationale: having expected memory leaks prevents us from diagnosing unknown ones.

Merged to 0.2.9 and forwards.

comment:7 Changed 3 years ago by nickm

Resolution: fixed
Status: merge_readyclosed


comment:8 Changed 3 years ago by arma

Reviewer: arma
Note: See TracTickets for help on using tickets.