Login | Register
My pages Projects Community openCollabNet

Discussions > users > event handle leak in TortoiseSVN.dll

Project highlights: :. Download .: :. Support .: :. FAQ .: :. Translations .: :. Donate .: :. Report Bug .:

tortoisesvn
Discussion topic

2020-03-13: This site is going to be decommissioned and shut down very soon. Please copy and archive any data you wish to keep ASAP

Back to topic list

event handle leak in TortoiseSVN.dll

Author Joost-Jan van Klaveren <info at elwave dot com>
Full name Joost-Jan van Klaveren <info at elwave dot com>
Date 2010-11-25 05:57:54 PST
Message <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<STYLE type=text/css> P, UL, OL, DL, DIR, MENU, PRE { margin: 0 auto;}</STYLE>

<META name=GENERATOR content="MSHTML 8.00.6001.18702">​</HEAD>
<BODY leftMargin=1 rightMargin=1 topMargin=1>
<P><FONT size=2 face=Tahoma>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).<BR>​</FONT></P​>
<P><FONT size=2 face=Tahoma>I've tracked these handles down to being unnamed kernel event objects using ProcessExplorer(SysInternals) and NTObjects (Russell Osterlund, <A href="http://www.smidgeonsoft.com">www.smidgeonsof​t.com</A>).​</FONT></P>​
<P><FONT size=2 face=Tahoma></​FONT>&nbsp;​</P>
<P><FONT size=2 face=Tahoma>Further debugging revealed the objects getting created at line 117 of src\TortoiseShell\​RemoteCacheLink.cpp (</FONT><FONT size=2 face=Tahoma><A href="http://code.google.c​om/p/tortoisesvn/sou​rce/browse/trunk/src​/TortoiseShell/Remot​eCacheLink.cpp?r=205​29">http://code.google.c​om/p/tortoisesvn/sou​rce/browse/trunk/src​/TortoiseShell/Remot​eCacheLink.cpp?r=205​29</A>)</P​></FONT>
<P><FONT size=2 face=Tahoma>m_hEvent gets reassigned without&nbsp;first checking for NULL or INVALID_HANDLE_VALUE​.<BR></FONT​></P>
<P><FONT size=2 face=Tahoma>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&nbsp;handle that may already be in use I tried the latter fix (why else make m_hEvent a member with only local use in <SPAN class=typ><FONT color=#660066>CRe​moteCacheLink</FO​NT></SPAN>​<SPAN class=pun><FONT color=#666600>::​</FONT></SPA​N><FONT color=#660066><SPAN class=typ>GetStat​usFromRemoteCache? 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.</SPAN​></FONT></​FONT></P>
<P><FONT size=2 face=Tahoma><FONT color=#660066><SPAN class=typ></SP​AN></FONT>​</FONT>&nbs​p;</P>
<P><FONT size=2 face=Tahoma>Kind regards,<BR>​</FONT></P​>
<P><FONT size=2 face=Tahoma></​FONT>&nbsp;​</P>
<P><FONT size=2 face=Tahoma>Joost-Jan van Klaveren<BR>--​<BR>Prognosis Software Development<BR>Phone: +31.15.2123543&n​bsp;&nbsp;&n​bsp;&nbsp;Fax: +31.15.2132558<BR>email: </FONT><FONT size=2 face=Tahoma><A href="mailto:info@el​wave.com">info@el​wave.com</A>​</FONT><BR​><FONT size=2 face=Tahoma>internet: </FONT><FONT size=2 face=Tahoma>http://www.elwave.co​m</FONT></P​>
<P>&nbsp;​</P></BODY​></HTML>

« Previous message in topic | 1 of 3 | Next message in topic »

Messages

Show all messages in topic

event handle leak in TortoiseSVN.dll Joost-Jan van Klaveren <info at elwave dot com> Joost-Jan van Klaveren <info at elwave dot com> 2010-11-25 05:57:54 PST
     Re: event handle leak in TortoiseSVN.dll levyam Andy Levy 2010-11-25 08:31:41 PST
     Re: event handle leak in TortoiseSVN.dll simonlarge Simon Large 2010-11-25 12:05:35 PST
Messages per page: