20160331-69bf47620a-win_x86-devprev Open Handles leak

Case number:699969-2002316
Topic:General
Opened by:Bletchley Park
Status:Open
Type:Bug
Opened on:Monday, April 18, 2016 - 06:20
Last modified:Thursday, June 30, 2016 - 15:11

This client has an open handles leak.
All copies use at least 150.000 open handles on my system, some copies as much as 205.000 and climbing. See attachment.

I would suspect something like banding to cause this.
A fresh copy uses only 300 handles.

Currently I am approaching a quarter of a million handles.

AttachmentSize
open handles bug.png8.03 KB
(Mon, 04/18/2016 - 06:20  |  10 comments)


LociOiling's picture
User offline. Last seen 1 hour 51 min ago. Offline
Joined: 12/27/2012
Groups: Beta Folders

I'm seeing the same, 148 K handles on first client I looked at.

LociOiling's picture
User offline. Last seen 1 hour 51 min ago. Offline
Joined: 12/27/2012
Groups: Beta Folders

Maybe another job for sysinternals Process Explorer, a free download from Microsoft.

See https://blogs.technet.microsoft.com/yongrhee/2011/12/19/how-to-troubleshoot-a-handle-leak/ for a discussion of how to view handle details with Process Explorer.

Looking at my 148 K example, it appears 99.99% of the handles are for threads. So I'm guessing the leak has something to do with thread clean-up.

There are also 19 file handles for fonts, 9 for CourierNew.ttf, and 10 for Arial.ttf. Not sure if this is a problem, but it does seem curious.

LociOiling's picture
User offline. Last seen 1 hour 51 min ago. Offline
Joined: 12/27/2012
Groups: Beta Folders

On one client at least, handles were cleaned up when I ended a long-running script.

Joined: 05/19/2009
Groups: Contenders

On several machines, no scripts are running with idle clients.
785.000, 710.000, 385.000, ... big numbers. This is a bug to check, it is slowing down the systems.

LociOiling's picture
User offline. Last seen 1 hour 51 min ago. Offline
Joined: 12/27/2012
Groups: Beta Folders

Interesting, not seeing numbers like that, more like ~150 K handles on a client running EDRW for a couple of days. My chat client has been sitting idle for days, and has "only" 2.5 K handles.

There are a few other processes with a questionable number of handles, such as Open Office, but they're all well below 10 K handles.

From Googling, it seems like creating GUI controls on a non-GUI thread is a well-known path to a thread handle leak. No clue what this means in the Foldit context.

Joined: 05/19/2009
Groups: Contenders

Thank you for that insight Loci, I checked whether it could be caused by other programs or processes, it really is from the clients. I stopped them and saw the count drop. In the end, the count was down to around 20.000.

LociOiling's picture
User offline. Last seen 1 hour 51 min ago. Offline
Joined: 12/27/2012
Groups: Beta Folders

Perhaps the handles are garbage collected some time after you stop a long-running recipe. In one case, I saw the handles (mostly) disappear quickly, but in others they persisted for quite a while, and I ended up just restarting the client.

The discussions I saw with regard to thread handle leaks involved starting a thread that created Windows GUI controls, but did not "pump GUI messages". Apparently, the Windows design model assumes there's a single thread that handles all GUI events and controls. Applications which violate this assumption may encounter issues such a handle leak.

I wonder if Foldit uses third-party software for its GUI activity, in order to achieve cross-platform support. If so, that software might be the source of the handle leak.

Joined: 05/19/2009
Groups: Contenders

The open handles may be related to the client trying to open the log.txt file for append, while I have made the log.txt file read-only in windows. I will check this behaviour when I have more time. Meanwhile, while Foldit investigates this issue, it may be a useful hint to check. The handle should be closed when the open for append (or write thereafter) fails. The log.txt is read-only because otherwise the log becomes too large (gigabytes).

jeff101's picture
User offline. Last seen 19 hours 35 min ago. Offline
Joined: 04/20/2012
Groups: Go Science

See http://fold.it/portal/node/997610 for some discussion about the log.txt file.

jeff101's picture
User offline. Last seen 19 hours 35 min ago. Offline
Joined: 04/20/2012
Groups: Go Science
Sitemap

Developed by: UW Center for Game Science, UW Institute for Protein Design, Northeastern University, Vanderbilt University Meiler Lab, UC Davis
Supported by: DARPA, NSF, NIH, HHMI, Amazon, Microsoft, Adobe, RosettaCommons