From unknown Fri Aug 15 15:36:25 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21651: 25.0.50; [PATCH] Memory leak: auto_fontset_alist has keys that are modified externally by mistake Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Oct 2015 21:50:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 21651 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 21651@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.144434096423083 (code B ref -1); Thu, 08 Oct 2015 21:50:03 +0000 Received: (at submit) by debbugs.gnu.org; 8 Oct 2015 21:49:24 +0000 Received: from localhost ([127.0.0.1]:33120 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZkJ3z-00060F-TW for submit@debbugs.gnu.org; Thu, 08 Oct 2015 17:49:24 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40205) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZkJ3w-000605-LK for submit@debbugs.gnu.org; Thu, 08 Oct 2015 17:49:21 -0400 Received: from lists.gnu.org ([208.118.235.17]:36495) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkJ3w-0005bG-Dn for submit@debbugs.gnu.org; Thu, 08 Oct 2015 17:49:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkJ3v-00089c-B1 for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 17:49:20 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_20,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZkJ3s-0005aj-1l for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 17:49:19 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:42338) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkJ3r-0005aa-P9 for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 17:49:15 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id E8A88203A8 for ; Thu, 8 Oct 2015 17:49:13 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Thu, 08 Oct 2015 17:49:13 -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=8RrdRShw393SVN7qrT5MT5MdkmM =; b=EVwd1jvAQoa+tR4mhLOF+6ahXvA56JqO/Qd0+FOf4St0znYwK0YjVr0hq6y hVl5ek67Fh1Gebo2pcSh/JnbadVoU754G6iyZ+GIN6SJIbyi87n/uZZdXj5IRt6z D5KSnMqTDFkZom875/EVMaK6RelbW9ywbrYEk1CizOqJIws4= 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=8R rdRShw393SVN7qrT5MT5MdkmM=; b=LlB4gutryGb6kziPLk5CUjRLUA1D0lVASg zOr2e6v2nI2xIter77U7UiM2DhGO3DzBnMZ6timEdwSKUoQoLEkhxUcEyFNAvJMd eEa6THrDUFTd08hKlMkOxAAZfXyZ2KM0teOme5PfMpM4kxABQHRedNDG2+TE0BBo s8BBiO78g= X-Sasl-enc: iYpxIo6Lneyi/GCfHL1dNSyqFbJRHRP/xMc0sDAVCYcM 1444340953 Received: from shorty.local (99-116-254-180.lightspeed.irvnca.sbcglobal.net [99.116.254.180]) by mail.messagingengine.com (Postfix) with ESMTPA id 95E39680106 for ; Thu, 8 Oct 2015 17:49:13 -0400 (EDT) Received: from ip6-localhost ([::1] helo=shorty) by shorty.local with esmtp (Exim 4.84) (envelope-from ) id 1ZkJ3n-0001MG-EC for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 14:49:11 -0700 From: Dima Kogan Date: Thu, 08 Oct 2015 14:49:11 -0700 Message-ID: <87d1wp8208.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.29 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=-=-= Content-Type: text/plain This issue was discussed on the mailing list with the thread starting here: https://lists.gnu.org/archive/html/emacs-devel/2015-10/msg00550.html A patch was proposed here: https://lists.gnu.org/archive/html/emacs-devel/2015-10/msg00292.html and is copied here as an attachment. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-copy_font_spec-now-makes-a-deeper-copy-of-its-input.patch From: Dima Kogan Date: Mon, 5 Oct 2015 11:21:12 -0700 Subject: (copy_font_spec) now makes a deeper copy of its input --- src/font.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/font.c b/src/font.c index a52a653..0b2999e 100644 --- a/src/font.c +++ b/src/font.c @@ -3981,7 +3981,12 @@ copy_font_spec (Lisp_Object font) pcdr = spec->props + FONT_EXTRA_INDEX; for (tail = AREF (font, FONT_EXTRA_INDEX); CONSP (tail); tail = XCDR (tail)) if (!EQ (XCAR (XCAR (tail)), QCfont_entity)) - *pcdr = Fcons (XCAR (tail), Qnil), pcdr = xcdr_addr (*pcdr); + { + *pcdr = Fcons (Fcons( XCAR (XCAR (tail)), + XCDR (XCAR (tail))), + Qnil); + pcdr = xcdr_addr (*pcdr); + } XSETFONT (new_spec, spec); return new_spec; --=-=-=-- From unknown Fri Aug 15 15:36:25 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Dima Kogan Subject: bug#21651: closed (Re: bug#21651: 25.0.50; [PATCH] Memory leak: auto_fontset_alist has keys that are modified externally by mistake) Message-ID: References: <83lhaxfu7z.fsf@gnu.org> <87d1wp8208.fsf@secretsauce.net> X-Gnu-PR-Message: they-closed 21651 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 21651@debbugs.gnu.org Date: Tue, 20 Oct 2015 15:15:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1445354103-8955-1" This is a multi-part message in MIME format... ------------=_1445354103-8955-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #21651: 25.0.50; [PATCH] Memory leak: auto_fontset_alist has keys that are = modified externally by mistake which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 21651@debbugs.gnu.org. --=20 21651: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D21651 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1445354103-8955-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 21651-done) by debbugs.gnu.org; 20 Oct 2015 15:14:19 +0000 Received: from localhost ([127.0.0.1]:58157 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZoYcB-0002JK-7S for submit@debbugs.gnu.org; Tue, 20 Oct 2015 11:14:19 -0400 Received: from mtaout28.012.net.il ([80.179.55.184]:36313) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZoYc5-0002J6-3p for 21651-done@debbugs.gnu.org; Tue, 20 Oct 2015 11:14:12 -0400 Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il (HyperSendmail v2007.08) id <0NWI00G00Y0UJV00@mtaout28.012.net.il> for 21651-done@debbugs.gnu.org; Tue, 20 Oct 2015 18:13:19 +0300 (IDT) Received: from HOME-C4E4A596F7 ([84.94.185.246]) by mtaout28.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NWI009JUYA6NW70@mtaout28.012.net.il>; Tue, 20 Oct 2015 18:13:19 +0300 (IDT) Date: Tue, 20 Oct 2015 18:14:08 +0300 From: Eli Zaretskii Subject: Re: bug#21651: 25.0.50; [PATCH] Memory leak: auto_fontset_alist has keys that are modified externally by mistake In-reply-to: <87d1wp8208.fsf@secretsauce.net> X-012-Sender: halo1@inter.net.il To: Dima Kogan Message-id: <83lhaxfu7z.fsf@gnu.org> References: <87d1wp8208.fsf@secretsauce.net> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 21651-done Cc: 21651-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Dima Kogan > Date: Thu, 08 Oct 2015 14:49:11 -0700 > > This issue was discussed on the mailing list with the thread starting > here: > > https://lists.gnu.org/archive/html/emacs-devel/2015-10/msg00550.html > > A patch was proposed here: > > https://lists.gnu.org/archive/html/emacs-devel/2015-10/msg00292.html > > and is copied here as an attachment. Thanks, pushed. ------------=_1445354103-8955-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 8 Oct 2015 21:49:24 +0000 Received: from localhost ([127.0.0.1]:33120 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZkJ3z-00060F-TW for submit@debbugs.gnu.org; Thu, 08 Oct 2015 17:49:24 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40205) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZkJ3w-000605-LK for submit@debbugs.gnu.org; Thu, 08 Oct 2015 17:49:21 -0400 Received: from lists.gnu.org ([208.118.235.17]:36495) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkJ3w-0005bG-Dn for submit@debbugs.gnu.org; Thu, 08 Oct 2015 17:49:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkJ3v-00089c-B1 for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 17:49:20 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_20,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZkJ3s-0005aj-1l for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 17:49:19 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:42338) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkJ3r-0005aa-P9 for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 17:49:15 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id E8A88203A8 for ; Thu, 8 Oct 2015 17:49:13 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Thu, 08 Oct 2015 17:49:13 -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=8RrdRShw393SVN7qrT5MT5MdkmM =; b=EVwd1jvAQoa+tR4mhLOF+6ahXvA56JqO/Qd0+FOf4St0znYwK0YjVr0hq6y hVl5ek67Fh1Gebo2pcSh/JnbadVoU754G6iyZ+GIN6SJIbyi87n/uZZdXj5IRt6z D5KSnMqTDFkZom875/EVMaK6RelbW9ywbrYEk1CizOqJIws4= 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=8R rdRShw393SVN7qrT5MT5MdkmM=; b=LlB4gutryGb6kziPLk5CUjRLUA1D0lVASg zOr2e6v2nI2xIter77U7UiM2DhGO3DzBnMZ6timEdwSKUoQoLEkhxUcEyFNAvJMd eEa6THrDUFTd08hKlMkOxAAZfXyZ2KM0teOme5PfMpM4kxABQHRedNDG2+TE0BBo s8BBiO78g= X-Sasl-enc: iYpxIo6Lneyi/GCfHL1dNSyqFbJRHRP/xMc0sDAVCYcM 1444340953 Received: from shorty.local (99-116-254-180.lightspeed.irvnca.sbcglobal.net [99.116.254.180]) by mail.messagingengine.com (Postfix) with ESMTPA id 95E39680106 for ; Thu, 8 Oct 2015 17:49:13 -0400 (EDT) Received: from ip6-localhost ([::1] helo=shorty) by shorty.local with esmtp (Exim 4.84) (envelope-from ) id 1ZkJ3n-0001MG-EC for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 14:49:11 -0700 From: Dima Kogan To: bug-gnu-emacs@gnu.org Subject: 25.0.50; [PATCH] Memory leak: auto_fontset_alist has keys that are modified externally by mistake Date: Thu, 08 Oct 2015 14:49:11 -0700 Message-ID: <87d1wp8208.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.29 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=-=-= Content-Type: text/plain This issue was discussed on the mailing list with the thread starting here: https://lists.gnu.org/archive/html/emacs-devel/2015-10/msg00550.html A patch was proposed here: https://lists.gnu.org/archive/html/emacs-devel/2015-10/msg00292.html and is copied here as an attachment. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-copy_font_spec-now-makes-a-deeper-copy-of-its-input.patch From: Dima Kogan Date: Mon, 5 Oct 2015 11:21:12 -0700 Subject: (copy_font_spec) now makes a deeper copy of its input --- src/font.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/font.c b/src/font.c index a52a653..0b2999e 100644 --- a/src/font.c +++ b/src/font.c @@ -3981,7 +3981,12 @@ copy_font_spec (Lisp_Object font) pcdr = spec->props + FONT_EXTRA_INDEX; for (tail = AREF (font, FONT_EXTRA_INDEX); CONSP (tail); tail = XCDR (tail)) if (!EQ (XCAR (XCAR (tail)), QCfont_entity)) - *pcdr = Fcons (XCAR (tail), Qnil), pcdr = xcdr_addr (*pcdr); + { + *pcdr = Fcons (Fcons( XCAR (XCAR (tail)), + XCDR (XCAR (tail))), + Qnil); + pcdr = xcdr_addr (*pcdr); + } XSETFONT (new_spec, spec); return new_spec; --=-=-=-- ------------=_1445354103-8955-1--