From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Newsgroups: gmane.emacs.bugs Subject: bug#58334: 29.0.50; ASAN heap use after free in gui_produce_glyphs Date: Fri, 07 Oct 2022 14:01:49 +0200 Message-ID: References: <87mta8qx48.fsf@yahoo.com> <83v8ownmi1.fsf@gnu.org> <83r0zjopre.fsf@gnu.org> <83h70foo3h.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24550"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: luangruo@yahoo.com, 58334@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 07 16:27:29 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ogoK1-0006Dk-Dv for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 Oct 2022 16:27:29 +0200 Original-Received: from localhost ([::1]:34666 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ogoJz-0006Zy-W1 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 Oct 2022 10:27:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ogm3H-0006jm-4c for bug-gnu-emacs@gnu.org; Fri, 07 Oct 2022 08:02:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35506) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ogm3G-0006qS-Rn for bug-gnu-emacs@gnu.org; Fri, 07 Oct 2022 08:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ogm3G-0003wQ-Lr for bug-gnu-emacs@gnu.org; Fri, 07 Oct 2022 08:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 07 Oct 2022 12:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58334 X-GNU-PR-Package: emacs Original-Received: via spool by 58334-submit@debbugs.gnu.org id=B58334.166514412015135 (code B ref 58334); Fri, 07 Oct 2022 12:02:02 +0000 Original-Received: (at 58334) by debbugs.gnu.org; 7 Oct 2022 12:02:00 +0000 Original-Received: from localhost ([127.0.0.1]:34583 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogm3D-0003w1-SU for submit@debbugs.gnu.org; Fri, 07 Oct 2022 08:02:00 -0400 Original-Received: from mail-ej1-f51.google.com ([209.85.218.51]:46614) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogm3B-0003vc-U0 for 58334@debbugs.gnu.org; Fri, 07 Oct 2022 08:01:58 -0400 Original-Received: by mail-ej1-f51.google.com with SMTP id bj12so10738488ejb.13 for <58334@debbugs.gnu.org>; Fri, 07 Oct 2022 05:01:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=+dK6t403RI0LSPOlk36rpTkpoOuBy1PMM0/4MtYlVu8=; b=BjILsyRXU7qLkjZWXfClxjL4eh4MihLzTZ0vHrpCTFUZqgaROI+jFv4k39qXS1ivhK fHYq4ml0fEZWKCbNZoJZqpzxZdmjfINKkjtp6p6bmKFGDRa8UuKyLhQx0+BnSZzh+OqR +jcfwenak1i9efNEaaYeP86kJFpGk508hRp91FKdjta6FSvI9KScYajVh/eeH2jshJ9x l8YWovaYaz4Q6EO5SoEbet9JwRC9arVzqBkxAhMcuyjRZqhV7pIgDzugxC+/iUHmU2yC 8+lUR1gPArLFbyD2ULgqON3zxs/AkH28EjoR6SjVqr+3Y+KOJJgxyi/ki7dk/HeM2Qg7 I2nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+dK6t403RI0LSPOlk36rpTkpoOuBy1PMM0/4MtYlVu8=; b=W/lueumU2BtGKq7hnINveT6fB+wNa14AhQ/sPfa053uBk0MlkoYlHgheJn+Q/7jbAe ZH2A9Avq+v71AYVaZrvFYn2A0VW5Dd3wcjmdgf7WsjQQSivjcKqbnrxOv6zv3WXB+BSa jobu0XQZtx6n5Pk6zRHcRuSNIWO+na2+fOL+oyORIpLaI/MavvqjxCkxeQo2CRDnw0AR ktHeXF4otBNFaAuLR+9R6Qmhw8L16pAN9qZNMhyguk19ZOTIaGicJ1dGKm1ASULi8eua VgP0IjQngZuYoygXfdDMuAOoBtErMKCx7sW4ZoZnBietInJaS6fsligra+kRkt3vNzj7 CFgA== X-Gm-Message-State: ACrzQf1dzPs0I48TOJ0gaq7Q4DqQj6dUcDRZUHp8RuBAPWsskVOk6WYx CNJqMbb+u3f7KNamGYgVS/qLfPGCom9/lg== X-Google-Smtp-Source: AMsMyM4/wEM/y43s+98vLDuKPEhWppuFTC8NmL7iMfkYNcF7No4rirSIGthJuXVuGPlbc76m+sMvKA== X-Received: by 2002:a17:906:b08d:b0:782:d526:3e36 with SMTP id x13-20020a170906b08d00b00782d5263e36mr3826080ejy.358.1665144111643; Fri, 07 Oct 2022 05:01:51 -0700 (PDT) Original-Received: from Mini.fritz.box (pd9e36c8d.dip0.t-ipconnect.de. [217.227.108.141]) by smtp.gmail.com with ESMTPSA id sb25-20020a1709076d9900b0077077b59085sm1111182ejc.184.2022.10.07.05.01.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Oct 2022 05:01:51 -0700 (PDT) In-Reply-To: <83h70foo3h.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 07 Oct 2022 14:44:02 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:244788 Archived-At: Eli Zaretskii writes: > So I would recommend to fix FACE_FROM_ID to re-generate the basic > faces if needed, on the assumption that the cases where we have > problems with using face ID are limited to basic faces. If, after > that, we will find cases with non-basic faces, I'd first look for more > opportunities to use inhibit_free_realized_faces. Sigh, I'd rather do something easy, and continue with what I wanted to try out in the branch here. It has only gpt one commit so far, in 3 or 4 days. > One other thing is that inhibit_free_realized_faces is a boolean, so > if nesting is possible, it cannot support such nesting; we'd need a > reference count instead. Yes, that's why I asked if we get by with something like this: diff --git a/src/xdisp.c b/src/xdisp.c index 9534e27843..fd94509fe4 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -3179,7 +3179,8 @@ init_iterator (struct it *it, struct window *w, free realized faces now because they depend on face definitions that might have changed. Don't free faces while there might be desired matrices pending which reference these faces. */ - if (!inhibit_free_realized_faces) + if (!inhibit_free_realized_faces + && !garbage_collection_inhibited) { if (face_change) { BTW, I've commented out the call to redisplay in nsterm.m layoutSomething now in my branch. Let's see what the effect is. So far I don't notice anything.