Thread leak in shell extension (Windows 10)

32 views
Skip to first unread message

Martin Glass

unread,
May 1, 2017, 2:09:28 PM5/1/17
to us...@tortoisesvn.tigris.org
It appears to me that there is a thread leak in the Explorer shell extension under Windows 10 (64-bit).

Version information:
TortoiseSVN 1.9.5, Build 27581 - 64 Bit , 2016/11/26 09:18:58
Subversion 1.9.5, -release
apr 1.5.2
apr-util 1.5.4
serf 1.3.9
OpenSSL 1.0.2j 26 Sep 2016
zlib 1.2.8
SQLite 3.14.1

I'm using the Windows 10 task manager (Details tab) to show the thread count for explorer.exe. Every time I right-click on a folder or file, the thread count increases by 2. Whether I cancel the context menu, or select an option (TortoiseSVN or otherwise), the thread count generally does not decrease, even after an extended period of time. After doing a lot of TortoiseSVN work, I have observed an explorer thread count of over 2600. This makes most other applications noticeably slower, especially in UI responsiveness.

In observing the explorer.exe process using Process Monitor (Sysinternals), the thread IDs shown on the ThreadCreate function calls never show a corresponding ThreadClose call. These same ThreadCreate function calls are immediately followed by calls (CreateFile) to read "C:\Program Files\TortoiseSVN\bin\dbghelp.dll", which is why it appears that the leaked threads are associated with TortoiseSVN.

Restarting explorer.exe appears to be the only workaround.

Thanks,
Martin

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3233200

To unsubscribe from this discussion, e-mail: [users-un...@tortoisesvn.tigris.org].

Julien Cugnière

unread,
May 1, 2017, 2:49:58 PM5/1/17
to us...@tortoisesvn.tigris.org
2017-05-01 20:08 GMT+02:00 Martin Glass <mab...@hotmail.com>:
> I'm using the Windows 10 task manager (Details tab) to show the thread count for explorer.exe. Every time I right-click on a folder or file, the thread count increases by 2.

I can reproduce the leak (though on my computer it only goes up by 1).
However I don't think it has anything to do with TortoiseSVN : I can
still reproduce the leak after I uninstall it and reboot. Could you
try uninstalling Tortoise to confirm this is not the culprit ?

As far as dbghelp.dll is concerned, if Tortoise's bin is in your path,
I suspect any software could be picking it up there.

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3233211

Stefan Küng

unread,
May 1, 2017, 3:04:23 PM5/1/17
to us...@tortoisesvn.tigris.org
On 01.05.2017 20:08, Martin Glass wrote:
> It appears to me that there is a thread leak in the Explorer shell extension under Windows 10 (64-bit).
>
> Version information:
> TortoiseSVN 1.9.5, Build 27581 - 64 Bit , 2016/11/26 09:18:58
> Subversion 1.9.5, -release
> apr 1.5.2
> apr-util 1.5.4
> serf 1.3.9
> OpenSSL 1.0.2j 26 Sep 2016
> zlib 1.2.8
> SQLite 3.14.1
>
> I'm using the Windows 10 task manager (Details tab) to show the thread count for explorer.exe. Every time I right-click on a folder or file, the thread count increases by 2. Whether I cancel the context menu, or select an option (TortoiseSVN or otherwise), the thread count generally does not decrease, even after an extended period of time. After doing a lot of TortoiseSVN work, I have observed an explorer thread count of over 2600. This makes most other applications noticeably slower, especially in UI responsiveness.
>
> In observing the explorer.exe process using Process Monitor (Sysinternals), the thread IDs shown on the ThreadCreate function calls never show a corresponding ThreadClose call. These same ThreadCreate function calls are immediately followed by calls (CreateFile) to read "C:\Program Files\TortoiseSVN\bin\dbghelp.dll", which is why it appears that the leaked threads are associated with TortoiseSVN.
>
> Restarting explorer.exe appears to be the only workaround.

The TortoiseSVN shell extension does not create any threads. Not one
single thread is created in the shell extension part.

No idea where this thread leak comes from.

Stefan

--
___
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest interface to (Sub)version control
/_/ \_\ http://tortoisesvn.net

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3233220

Martin Glass

unread,
May 2, 2017, 1:42:19 AM5/2/17
to us...@tortoisesvn.tigris.org
> 2017-05-01 20:08 GMT+02:00 Martin Glass <mab893 at hotmail dot com>:
> > I'm using the Windows 10 task manager (Details tab) to show the thread count for explorer.exe. Every time I right-click on a folder or file, the thread count increases by 2.
>
> I can reproduce the leak (though on my computer it only goes up by 1).
> However I don't think it has anything to do with TortoiseSVN : I can
> still reproduce the leak after I uninstall it and reboot. Could you
> try uninstalling Tortoise to confirm this is not the culprit ?
>
> As far as dbghelp.dll is concerned, if Tortoise's bin is in your path,
> I suspect any software could be picking it up there.

Well, I've since dug a little deeper and it definitely isn't TortoiseSVN, as I saw the same result when it was uninstalled. (I uninstalled several other shell extension programs as well.)

For those interested in more details:
- When I show the Thread ID in ProcMon, the threads that have been created never do anything.
- I see two threads leak when right-clicking on folders in explorer's navigation pane (left pane), but see only one thread leak when using the folder view (right pane).

I'm going to keep digging, but so far it looks like explorer.exe is the culprit..

Thanks,
Martin

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3233244
Reply all
Reply to author
Forward
0 new messages