[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

event handle leak in TortoiseSVN.dll

From: Joost-Jan van Klaveren <info_at_elwave.com>
Date: Fri, 26 Nov 2010 07:31:29 -0800 (PST)

There's a gradual increase in Handles (Windows Task Manager) for
explorer.exe noticable, related to how frequent a working copy is
browsed/accessed through Windows Explorer. Over time this runs well
into thousands (some 33000, a limit seems to get reached).
I've tracked these handles down to being unnamed kernel event objects
using ProcessExplorer(SysInternals) and NTObjects (Russell Osterlund,
www.smidgeonsoft.com).

Further debugging revealed the objects getting created at line 117 of
src\TortoiseShell\RemoteCacheLink.cpp
(http://code.google.com/p/tortoisesvn/source/browse/trunk/src/TortoiseShell/RemoteCacheLink.cpp?r=20529)
m_hEvent gets reassigned without first checking for NULL or
INVALID_HANDLE_VALUE.
I thought of two solutions, either closing the previous handle or not
reassigning when already assigned a proper value. Not knowing the
exact impact of closing a handle that may already be in use I tried
the latter fix (why else make m_hEvent a member with only local use in
CRemoteCacheLink::GetStatusFromRemoteCache? seems also more in line
with how m_hPipe is created/destroyed). This at least keeps the number
of system handles down but not knowing the full impact (specifically,
m_hEvent 'handed' to overlapped IO and seeing as this is supposed to
handle exceptional cases like crashes) I hesitate to submit this as
solution.

(FYI: previously posted by emailing to the mailing list as HTML
(incidentally) rendering HTML as plaintext, forum post does allow specifying
'Message is in HTML Format - not that I'm a big fan of HTML, just explaining
why I expected it to work)

Joost-Jan

-- 
View this message in context: http://old.nabble.com/event-handle-leak-in-TortoiseSVN.dll-tp30308927p30308927.html
Sent from the tortoisesvn - users mailing list archive at Nabble.com.
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2685900
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2010-11-26 17:35:56 CET

This is an archived mail posted to the TortoiseSVN Users mailing list.