RESOLVED FIXED 76135
[Chromium] REGRESSION(102301): DC leak introduced in WebScreenInfoFactory
https://bugs.webkit.org/show_bug.cgi?id=76135
Summary [Chromium] REGRESSION(102301): DC leak introduced in WebScreenInfoFactory
Mark Larson (Google)
Reported 2012-01-11 17:53:06 PST
See also http://bugs.chromium.org/109768 http://trac.webkit.org/changeset/102301 introduces a leak of GDI handles in Chromium. In some cases, extensions that call screen.width/height repeatedly can exhaust GDI handles very quickly leading to a browser crash. I think all you need to do is introduce a ReleaseDC(0, hdc) call before you return in /Source/WebKit/chromium/src/win/WebScreenInfoFactory.cpp
Attachments
David Levin
Comment 1 2012-01-11 18:14:05 PST
I've got it. It is a simple fix. I'm working on a test for it right now.
Fady Samuel
Comment 2 2012-01-12 07:44:45 PST
(In reply to comment #1) > I've got it. It is a simple fix. I'm working on a test for it right now. Sorry, forgot the ReleaseDC (I don't do a lot of Windows development lately). I'm not sure how one tests memory leaks in WebKit however.
David Levin
Comment 3 2012-01-18 21:29:16 PST
Well I was going to introduce a test by calling the screen methods about 1000 or so times which is really fast in practice. It turns out that the DRT doesn't ever call the problematic function, so I was going to fix that but that function is different on every platform so it is a larger problem. Ideally the real screen functions would be called from the test to ensure there were no crashes, but I;m satisfied with having put in a check into check-webkit-style which will flag if anyone calls GetDC directly so it is unlikely that a leak of this type will ever be introduced again. The depends on bugs are about getting rid of current instances of GetDC. (They technically are only related so I'm going to resolve this bug -- They are fixed and just pending review also.)
Note You need to log in before you can comment on or make changes to this bug.