Opened 13 years ago

Closed 13 years ago

#2756 closed Bug (fixed)

32 bytes leaked by tr_threadNew()

Reported by: tiennou Owned by: charles
Priority: Lowest Milestone: 1.81
Component: libtransmission Version: 1.70
Severity: Trivial Keywords:
Cc:

Description

leaks reports : Call stack: [thread 0x100e81000]: | thread_start | _pthread_start | libeventThreadFunc | event_base_loop | readFromPipe | tr_sessionInitImpl | tr_dhtInit | tr_threadNew | calloc | malloc_zone_calloc

It is caused by the tr_threadNew call in tr-dht.c:389, since we're not storing the return anywere. I imagine since this is for bootstrapping, as soon the thread exits it will be reclaimed, but I'm filing anyway ;-)

Attachments (1)

thread-leak.diff (267 bytes) - added by charles 13 years ago.
possible fix

Download all attachments as: .zip

Change History (9)

Changed 13 years ago by charles

possible fix

comment:1 Changed 13 years ago by charles

tiennou: could you please test this diff and see if it resolves the issue for you? valgrind isn't reporting this as a leak for some reason...

comment:2 Changed 13 years ago by tiennou

I'll test… I got another one from, but your fix will do for both :

Call stack: [thread 0x7fff7040dbe0]: | start | main | NSApplicationMain | +[NSBundle(NSNibLoading) loadNibNamed:owner:] | +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] | loadNib | -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] | -[NSSet makeObjectsPerformSelector:] | -[Controller awakeFromNib] | -[Torrent initWithHistory:lib:forcePause:] | -[Torrent startTransfer] | torrentStart | tr_verifyAdd | tr_threadNew | calloc | malloc_zone_calloc

comment:3 Changed 13 years ago by charles

tiennou: what did your tests find?

comment:4 Changed 13 years ago by tiennou

I'm no longer seeing the tr_thread leaking after a verification completes with the patch applied (much easier to check than waiting for DHT to bootstrap).

comment:5 Changed 13 years ago by charles

  • Summary changed from DHT memory leak on on r9299 to 32 bytes leaked by tr_threadNew()

comment:6 Changed 13 years ago by charles

  • Milestone changed from None Set to Sometime
  • Status changed from new to assigned
  • Version changed from 1.76+ to 1.70

IMO this ticket should be done post-1.80. 32 bytes is very little reward compared to the relatively high risk of messing with the threading code...

comment:7 Changed 13 years ago by charles

  • Milestone changed from Sometime to 1.81

comment:8 Changed 13 years ago by charles

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed in trunk for 1.81 by r9987

Note: See TracTickets for help on using tickets.