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#21556: 25.0.50; Memory leak in emacs -Q with lucid (font) Date: Fri, 25 Sep 2015 11:44:11 +0300 Message-ID: <83eghmj3c4.fsf@gnu.org> References: <87d1x7e53b.fsf@secretsauce.net> <83k2rfhu93.fsf@gnu.org> <8737y3dm0z.fsf@secretsauce.net> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1443170735 23417 80.91.229.3 (25 Sep 2015 08:45:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Sep 2015 08:45:35 +0000 (UTC) Cc: 21556@debbugs.gnu.org To: Dima Kogan Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 25 10:45:24 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 1ZfOcw-00075T-DL for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Sep 2015 10:45:10 +0200 Original-Received: from localhost ([::1]:49901 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfOcv-0007Wd-SX for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Sep 2015 04:45:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45322) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfOcr-0007UT-V4 for bug-gnu-emacs@gnu.org; Fri, 25 Sep 2015 04:45:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfOco-0007yv-NQ for bug-gnu-emacs@gnu.org; Fri, 25 Sep 2015 04:45:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53500) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfOco-0007yd-LK for bug-gnu-emacs@gnu.org; Fri, 25 Sep 2015 04:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZfOco-000365-7N for bug-gnu-emacs@gnu.org; Fri, 25 Sep 2015 04:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Sep 2015 08:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21556 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21556-submit@debbugs.gnu.org id=B21556.144317065211833 (code B ref 21556); Fri, 25 Sep 2015 08:45:02 +0000 Original-Received: (at 21556) by debbugs.gnu.org; 25 Sep 2015 08:44:12 +0000 Original-Received: from localhost ([127.0.0.1]:42471 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZfOc0-00034n-5A for submit@debbugs.gnu.org; Fri, 25 Sep 2015 04:44:12 -0400 Original-Received: from mtaout27.012.net.il ([80.179.55.183]:42762) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZfObx-00034c-C8 for 21556@debbugs.gnu.org; Fri, 25 Sep 2015 04:44:10 -0400 Original-Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0NV8002005ABH400@mtaout27.012.net.il> for 21556@debbugs.gnu.org; Fri, 25 Sep 2015 11:40:26 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NV8000B35FEJU20@mtaout27.012.net.il>; Fri, 25 Sep 2015 11:40:26 +0300 (IDT) In-reply-to: <8737y3dm0z.fsf@secretsauce.net> 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: 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:106896 Archived-At: > From: Dima Kogan > Cc: 21556@debbugs.gnu.org > Date: Thu, 24 Sep 2015 23:57:00 -0700 > > Eli Zaretskii writes: > > >> Is there a way to put a watchpoint on a lisp object? How? > > > > Depends on the object. Which object do you want to put the watchpoint > > on? Please show its source variable name and the source file lines > > where it is used. Also, if the object is complex, what kinds of > > changes in it would you like to watch? > > The object is the emacs font cache. Specifically in this case (Debian, > X11, xft fonts, lucid widgets) it is > > frame->output_data.x->display_info->name_list_element > > where frame is a struct frame*, such as the first argument of > > font_load_for_lface() > > In the original message for this bug report I showed 'pp' output for > this first argument of font_load_for_lface(). This function is called 4 > times during the creation of one frame. I want to know why the font > cache is cleared before the 3rd call. I tried to examine the code, and > to place breakpoints in places that could be performing this cache > clear, but none of those places look like the right ones. If a > watchpoint is possible, it would tell me where this is cleared, instead > of me having to guess. The place where the font cache is "cleared" (actually, it's compacted) is in compact_font_caches, and specifically in its subroutine compact_font_cache_entry. Did you place breakpoints there, and if so, what did you see? If the breakpoints in those functions don't help, then you'd need to put 2 watchpoints: one at the cdr pointer of (xft 1 ...) list, the other at the object pointed by that pointer. You can get at the values of these by using the GDB commands "xcar", "xcdr", and "xcons", starting with (gdb) p TERMINAL_FONT_CACHE(FRAME_TERMINAL(f)) which will display (the EMACS_INT value of) the object you showed in your previous message. Use xcdr to get to the tail of the list which you want to watch, then use xcar to show the element and xcons to display its C internals. Once you discover the addresses of the 2 values, set the watchpoints on their numerical addresses, do not use the variable names. Something like this: (gdb) watch *(struct Lisp_Cons *) 0x12345676887654320 (If you do want to use the variable names, use "watch -l" to place the watchpoints on their locations.)