From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#14850: 24.3; GDI Handles leak(Windows) Date: Sun, 14 Jul 2013 19:06:47 +0300 Message-ID: <83ip0d3z3c.fsf@gnu.org> References: <83r4f24o1k.fsf@gnu.org> <83ppum4k0i.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1373818029 4507 80.91.229.3 (14 Jul 2013 16:07:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Jul 2013 16:07:09 +0000 (UTC) Cc: 14850-done@debbugs.gnu.org To: Akihiro KAYAMA Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 14 18:07:09 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UyOpJ-0006cp-8K for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Jul 2013 18:07:09 +0200 Original-Received: from localhost ([::1]:56155 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyOpI-0005O0-Pn for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Jul 2013 12:07:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55263) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyOpE-0005Nh-Aj for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2013 12:07:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UyOpD-0004JY-Ay for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2013 12:07:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59763) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyOpD-0004JU-7X for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2013 12:07:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1UyOpC-0006pM-MG for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2013 12:07:02 -0400 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Jul 2013 16:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 14850 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 14850@debbugs.gnu.org, eliz@gnu.org, kayama@tiresia.org Original-Received: via spool by 14850-done@debbugs.gnu.org id=D14850.137381801926228 (code D ref 14850); Sun, 14 Jul 2013 16:07:01 +0000 Original-Received: (at 14850-done) by debbugs.gnu.org; 14 Jul 2013 16:06:59 +0000 Original-Received: from localhost ([127.0.0.1]:54077 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UyOp7-0006ov-Pj for submit@debbugs.gnu.org; Sun, 14 Jul 2013 12:06:58 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:65067) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UyOp4-0006oW-EG for 14850-done@debbugs.gnu.org; Sun, 14 Jul 2013 12:06:55 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MPX00500OPVH900@a-mtaout20.012.net.il> for 14850-done@debbugs.gnu.org; Sun, 14 Jul 2013 19:06:47 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MPX005CHORB7NA0@a-mtaout20.012.net.il>; Sun, 14 Jul 2013 19:06:47 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:76346 Archived-At: > Date: Sun, 14 Jul 2013 18:55:24 +0900 > From: Akihiro KAYAMA > Cc: 14850@debbugs.gnu.org > > I understand you can't reproduce GDI Handles leak. Just to make sure, > I mention again three requiremetns fot it. > > - multiple frames > - continuous shell buffer output(maybe mode line updates) > - mini buffer Actually, I think I did succeed to reproduce this. Here's a much easier method, for the record: emacs -Q M-x make-frame-command RET M-: (require 'time) RET M-: (setq display-time-interval 1) RET M-: (setq display-time-format "%H:%M:%S") RET M-x display-time RET C-x C-f As long as Emacs sits at the minibuffer prompt, you'll have a GDI handle leaked once every second, according to display-time-interval. Type C-g to get out of the minibuffer, and the leak stops. IOW, the conditions for this are: . more than 1 frame . active minibuffer prompt, and . continuous redisplay According to my measurements, the change I made in revision 113415 completely stops GDI handle leak in this scenario, and also in your original one. So I will close this bug; feel free to reopen if you can still come up with a scenario where GDI objects are leaked. The changes I committed are below, for your convenience. === modified file 'src/ChangeLog' --- src/ChangeLog 2013-07-13 10:29:15 +0000 +++ src/ChangeLog 2013-07-13 14:21:01 +0000 @@ -1,5 +1,8 @@ 2013-07-13 Eli Zaretskii + * w32term.c (x_draw_hollow_cursor): Delete the brush object when + returning early. (Bug#14850) + * coding.c (syms_of_coding): Set up inhibit-null-byte-detection and inhibit-iso-escape-detection attributes of 'undecided'. (Bug#14822) === modified file 'src/w32term.c' --- src/w32term.c 2013-07-06 02:40:50 +0000 +++ src/w32term.c 2013-07-13 14:21:01 +0000 @@ -5174,7 +5174,10 @@ x_draw_hollow_cursor (struct window *w, the current matrix is invalid or such, give up. */ cursor_glyph = get_phys_cursor_glyph (w); if (cursor_glyph == NULL) - return; + { + DeleteObject (hb); + return; + } /* Compute frame-relative coordinates for phys cursor. */ get_phys_cursor_geometry (w, row, cursor_glyph, &left, &top, &h);