From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dima Kogan Newsgroups: gmane.emacs.bugs Subject: bug#21556: 25.0.50; Memory leak in emacs -Q with lucid (font) Date: Thu, 24 Sep 2015 17:05:12 -0700 Message-ID: <87d1x7e53b.fsf@secretsauce.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1443139589 25974 80.91.229.3 (25 Sep 2015 00:06:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Sep 2015 00:06:29 +0000 (UTC) To: 21556@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 25 02:06:14 2015 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 1ZfGWh-0008QH-EZ for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Sep 2015 02:06:11 +0200 Original-Received: from localhost ([::1]:44673 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfGWg-00074L-PP for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Sep 2015 20:06:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfGWc-00072x-6X for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2015 20:06:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfGWY-0003gS-Ua for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2015 20:06:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53312) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfGWY-0003g8-SA for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2015 20:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZfGWY-0007iM-Gj for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2015 20:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Sep 2015 00:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 21556 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.144313952929609 (code B ref -1); Fri, 25 Sep 2015 00:06:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 25 Sep 2015 00:05:29 +0000 Original-Received: from localhost ([127.0.0.1]:42283 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZfGW0-0007hT-GN for submit@debbugs.gnu.org; Thu, 24 Sep 2015 20:05:29 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51732) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZfGVv-0007hI-IB for submit@debbugs.gnu.org; Thu, 24 Sep 2015 20:05:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfGVu-000340-2d for submit@debbugs.gnu.org; Thu, 24 Sep 2015 20:05:23 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:37218) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfGVu-00033l-06 for submit@debbugs.gnu.org; Thu, 24 Sep 2015 20:05:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33503) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfGVs-0006pH-Le for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2015 20:05:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfGVp-00031e-Ef for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2015 20:05:20 -0400 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:40307) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfGVp-000310-8u for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2015 20:05:17 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 0808F22F96 for ; Thu, 24 Sep 2015 20:05:14 -0400 (EDT) Original-Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Thu, 24 Sep 2015 20:05:14 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=content-type:date:from:message-id:mime-version:subject:to :x-sasl-enc:x-sasl-enc; s=mesmtp; bh=eeZ0j5uBIBcP9sdevpAmaWfIpZk =; b=Nnxexpp6wde/Kg+pUo1t7GcRdUmSrk09WTSFZhMtNWAAdu1zLU+e7tRY6m3 +HDhKRsCz27/9s14F9qe0HezpMIErUsRhwDGfsMb1pPiHPporF5pbKv8BkZKq1+Q RQuL3WSIn2EWMrJOmwzcHIKdZKSlsRfk67QC8kSFGBU549Sc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=ee Z0j5uBIBcP9sdevpAmaWfIpZk=; b=DyB0qrBCvoVOOlAbk9gLIvn6EuPA9pFs7/ VP7lkvW8uj9Wn8a9u0YeZA4Y7qX3t+KDFvkqgWpfXJtdrsf+jwpRvfEnJlG/NIjo 1gkfsAVpf6DE58EKPhfz8Cej6u7HM/4OU3cRLEzi0o7PdFNoX8n9K1VRnlv2R8Dk Nv1aQTis0= X-Sasl-enc: PdeqAhZWLU4RyqNM9zhrerOO8F39QneHqLmzPcbAh/SY 1443139513 Original-Received: from shorty.local (50-1-153-216.dsl.dynamic.fusionbroadband.com [50.1.153.216]) by mail.messagingengine.com (Postfix) with ESMTPA id AD7216800A5 for ; Thu, 24 Sep 2015 20:05:13 -0400 (EDT) Original-Received: from ip6-localhost ([::1] helo=shorty) by shorty.local with esmtp (Exim 4.84) (envelope-from ) id 1ZfGVk-0006Vw-Jc for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2015 17:05:12 -0700 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). 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: 208.118.235.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:106888 Archived-At: Hi. This is similar to, but different from http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21509 On my machine if I open a daemon with emacs -Q, and start/stop clients as described in the previous report, I see one font leaking with every frame. With one exception (below), everything that is cleaned out, is cleaned with x_delete_terminal() where all fonts in emacs's font cache are cleared. The bug appears to be that something is resetting emacs's font cache at some point during frame creation, and any fonts that were cached before that point end up leaking. With a breakpoint at font_load_for_lface() I print the font cache. font_load_for_lface() is called 4 times during frame creation, and the caches look like this: (":0.0" (x 1) (xft 1)) (":0.0" (x 1) (xft 1 (# . [# # # #]))) (":0.0" (x 1) (xft 1)) (":0.0" (x 1) (xft 1 (# . [# # # #]))) Note that this cache is reset between the 2nd and 3rd calls without the corresponding font being freed. I cannot tell where this is being cleared; all the suspect breakpoints aren't hitting. Main question of this bug report so far: Is there a way to put a watchpoint on a lisp object? How? I'm observing that most (but not all) of the time, the menu font is being created around the same time as the cache reset. Backtrace: 7fcf06d1e99f XftFontOpenName (/usr/lib/x86_64-linux-gnu/libXft.so.2.3.2) 6b5861 openXftFont (/tmp/emacs-tst) 6b5999 XlwMenuInitialize (/tmp/emacs-tst) 7fcf07ac9e2c [unknown] (/usr/lib/x86_64-linux-gnu/libXt.so.6.0.0) 7fcf07aca7c8 [unknown] (/usr/lib/x86_64-linux-gnu/libXt.so.6.0.0) 7fcf07acac18 _XtCreateWidget (/usr/lib/x86_64-linux-gnu/libXt.so.6.0.0) 7fcf07acaefd XtCreateWidget (/usr/lib/x86_64-linux-gnu/libXt.so.6.0.0) 6b01f3 xlw_create_menubar (/tmp/emacs-tst) 6af1d3 instantiate_widget_instance (/tmp/emacs-tst) 6ae462 allocate_widget_instance (/tmp/emacs-tst) 6af306 lw_make_widget (/tmp/emacs-tst) 6af392 lw_create_widget (/tmp/emacs-tst) 4974b9 set_frame_menubar (/tmp/emacs-tst) 497673 initialize_frame_menubar (/tmp/emacs-tst) 5358f5 Fx_create_frame (/tmp/emacs-tst) This font allocation doesn't read or write to the frame cache, and has its own font-cleanup call that appears to work. I cannot find any explicit evidence that this clears out the font cache, but turning off the menu with M-x menu-bar-mode makes this leak mostly go away.