From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dima Kogan Newsgroups: gmane.emacs.devel Subject: Re: Debugging emacs memory management Date: Mon, 05 Oct 2015 02:24:07 -0700 Message-ID: <87d1wt1xe0.fsf@secretsauce.net> References: <87zj8l3r32.fsf@secretsauce.net> <87vbbbxz2e.fsf@secretsauce.net> <55F998C8.4080203@cs.ucla.edu> <87vbb492ea.fsf@secretsauce.net> <83twqonub8.fsf@gnu.org> <87oagw885o.fsf@secretsauce.net> <837fnknlbm.fsf@gnu.org> <834mionkdg.fsf@gnu.org> <87fv1p232b.fsf@secretsauce.net> <83wpv1zr4q.fsf@gnu.org> <87egh9205z.fsf@secretsauce.net> <83r3l9zowx.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1444037097 26654 80.91.229.3 (5 Oct 2015 09:24:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 5 Oct 2015 09:24:57 +0000 (UTC) Cc: eggert@cs.ucla.edu, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 05 11:24:47 2015 Return-path: Envelope-to: ged-emacs-devel@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 1Zj20i-0001zZ-PS for ged-emacs-devel@m.gmane.org; Mon, 05 Oct 2015 11:24:44 +0200 Original-Received: from localhost ([::1]:44972 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zj20i-0002Fw-9D for ged-emacs-devel@m.gmane.org; Mon, 05 Oct 2015 05:24:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50050) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zj20D-00027j-8x for emacs-devel@gnu.org; Mon, 05 Oct 2015 05:24:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zj209-00069V-87 for emacs-devel@gnu.org; Mon, 05 Oct 2015 05:24:13 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:51979) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zj209-000692-19 for emacs-devel@gnu.org; Mon, 05 Oct 2015 05:24:09 -0400 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 7CCDE2011E for ; Mon, 5 Oct 2015 05:24:08 -0400 (EDT) Original-Received: from frontend1 ([10.202.2.160]) by compute3.internal (MEProxy); Mon, 05 Oct 2015 05:24:08 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=K/q6/ ircwCLA0U+8YufjXpVegUY=; b=ceVyjDXacNGA51Bw5xyrb6Wp+dn6pdIzgAWc8 uE4o6I9A9d+UgRHAS6Cz+8QDIqbBNWf3lPM8NV6MQOZRZgoQJy+3L/qyNuEUnNIv oh0QTRy57EBa/2Eg6kP2DQZMcXIqlDwE93ZWQphh5t+lEPHFdJoPGnehJ3JB8TVx vtInnA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=K/q6/ircwCLA0U+8YufjXpVegUY=; b=BKml9 IHfqh0dCbHr4wRS9OV1PML6BLaZ8N+Fk7FC40+m7kqsEXOiW3QQrzH5OJUD+8oB0 Qj0qjPC7upnxUGxaWQc6YgghC/bmYydwcgIKIF/vy12ue3k92yx0035vBu9Imr2H eXlOWLOKAQPQp4A69r9ME2e3W5zVmkeg+VDXvM= X-Sasl-enc: qqdkA1UGmwCR4/Yi6+kCYk5wvJW84UQ2e+kEFfRduwux 1444037048 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 30F32C0001D; Mon, 5 Oct 2015 05:24:08 -0400 (EDT) Original-Received: from localhost ([::1] helo=shorty) by shorty.local with esmtp (Exim 4.84) (envelope-from ) id 1Zj207-000810-2I; Mon, 05 Oct 2015 02:24:07 -0700 In-reply-to: <83r3l9zowx.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.28 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:190930 Archived-At: Eli Zaretskii writes: >> From: Dima Kogan >> Cc: eggert@cs.ucla.edu, emacs-devel@gnu.org >> Date: Mon, 05 Oct 2015 01:24:08 -0700 >> >> > If so, please show the values of the 2 arguments to assoc_no_quit (in >> > their Lisp form, as displayed by the "pp" command). >> >> This is the crux of the problem. The font_spec is >> >> # >> >> The auto_fontset_alist has many entries, all with the same identical key: >> >> # > > Not sure if it's relevant, but on my system, neither > auto_fontset_alist entries nor the value of font_spec have the > (:name ...) element. They do have user-spec, but no :name. Perhaps > try finding out where does that come from. (Functions in fontset.el > look like one possible place.) OK. So the problem is that fontset_from_font() does Lisp_Object font_spec = copy_font_spec (font_object); and then sets this font_spec as the key to the alist. However copy_font_spec() is not a deep copy, and the caller to fontset_from_font() ends up with references to internals of font_spec. It then changes those internals, and ends up changing the key of the auto_fontset_alist. Specifically the (name . ...) cons cell is the one being shared. If anybody cares, the backtrace of the reset of the :name is #0 0x000000000054cdad in XSETCDR (c=15185539, n=0) at lisp.h:1194 #1 0x0000000000608d42 in font_put_extra (font=19160773, prop=5184, val=0) at font.c:732 #2 0x000000000060f849 in font_clear_prop (attrs=0x7ffccea52c20, prop=FONT_SLANT_INDEX) at font.c:3044 #3 0x0000000000509d69 in merge_face_vectors (f=0xf975d0, from=0x7ffccea52d20, to=0x7ffccea52c20, named_merge_points=0x0) at xfaces.c:2130 #4 0x0000000000510790 in x_supports_face_attributes_p (f=0xf975d0, attrs=0x7ffccea52d20, def_face=0xebb2e0) at xfaces.c:4691 #5 0x00000000005113cb in Fdisplay_supports_face_attributes_p (attributes=10113851, display=16348629) but this seems hardly relevant. Making copy_font_spec() a deep copy probably would resolve this. Trying that now.