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: Sat, 08 Oct 2022 08:58:02 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37186"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: 58334@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 08 08:59:16 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 1oh3no-0009Uy-LI for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Oct 2022 08:59:16 +0200 Original-Received: from localhost ([::1]:59802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oh3nn-0000Ef-Lq for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Oct 2022 02:59:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49352) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oh3nb-0000Dn-6V for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2022 02:59:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38999) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oh3na-000851-UU for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2022 02:59:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oh3na-0006uT-ED for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2022 02:59: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: Sat, 08 Oct 2022 06:59: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.166521229426506 (code B ref 58334); Sat, 08 Oct 2022 06:59:02 +0000 Original-Received: (at 58334) by debbugs.gnu.org; 8 Oct 2022 06:58:14 +0000 Original-Received: from localhost ([127.0.0.1]:38077 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oh3mo-0006tS-7e for submit@debbugs.gnu.org; Sat, 08 Oct 2022 02:58:14 -0400 Original-Received: from mail-ej1-f52.google.com ([209.85.218.52]:39489) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oh3mk-0006tC-Qd for 58334@debbugs.gnu.org; Sat, 08 Oct 2022 02:58:12 -0400 Original-Received: by mail-ej1-f52.google.com with SMTP id b2so15424071eja.6 for <58334@debbugs.gnu.org>; Fri, 07 Oct 2022 23:58:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gcGOxTjnQelKkE0tWuaVFOCeYhv3+Ege+zCBTmxcV/Y=; b=dmwCsTESgduYDiIBjyQDtGqpWi6f+HM4M+TC3kHoIbBuqz0KyPBpN0K1/SNBjHCApz pTkGZ3R143EQTgmupYVJ3p7+3P6G2ooeUhZkSj2GNeHJHDy6/ghMGFd2nLBI87H2xCT1 Zpuf1viQxPFWQE3WobZGbZcb0i58qcIG0M02Y4512WuRfFP+AkuFnyK6P+hFTK/mIHeL Lc9qAei+aVyEocatWHKKlNznYy2TPGhyQFUKmDKPk/kPGl22dV5Boqi54MTX/9tqJ7ll 0VONi3O/z6gmYxJfPWqVu7bEYpCUoaz25pECiakETpYDbq1ReThGlbcBdvAlFarQS+fp x46w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:to:from:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=gcGOxTjnQelKkE0tWuaVFOCeYhv3+Ege+zCBTmxcV/Y=; b=RM5Cnglcts8iFQZswJV7ZosoDkaYsnDJLI34CrzBjinNdmD0k7VpVpxySwGdWBb4ws 0un6VEZvCbJQ2KoxIM8vsfUZu2+OqyBr011z0WgaEhgc3L32pWwzfng3nU+DczTy8fop xqPrNrE9wCBKU9X5XZhTtcxYBAayKbSiYcTq9QPbR1BbvHFYvn+IFaNZAgvh/kDB1Dk+ VFidWfMFgaX8IllX9WLr2RIzsApY0F1ywum51Kfxa5NiI/LWW4VkFTKV/3uGln3fnM5h KJRXFBxQN92vQriyaqcYNXN8+QzSO+eU/3BRllY58SWsdVFAGFTTRWqWgco35H69RIuB o+/g== X-Gm-Message-State: ACrzQf0/bBgbaxqbkjTNIBo7H604a0on+rsWl8sYreumuqQNocff97Od 7c2df9H+4ZJpuTuasCxWgsp8BfA3Z8o= X-Google-Smtp-Source: AMsMyM5bJLFSaG/rPO4XafW3gMNuq19MRPQS3gM+PTbugB25Lde3VEjxRvuVj5aLoHarg0llOSFcog== X-Received: by 2002:a17:906:591:b0:73d:c3ef:84ae with SMTP id 17-20020a170906059100b0073dc3ef84aemr6911347ejn.155.1665212284390; Fri, 07 Oct 2022 23:58:04 -0700 (PDT) Original-Received: from Mini.fritz.box (p4fe3a921.dip0.t-ipconnect.de. [79.227.169.33]) by smtp.gmail.com with ESMTPSA id 9-20020a170906328900b0073d84a321c8sm2300988ejw.166.2022.10.07.23.58.03 for <58334@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Oct 2022 23:58:03 -0700 (PDT) In-Reply-To: ("Gerd =?UTF-8?Q?M=C3=B6llmann?="'s message of "Thu, 06 Oct 2022 17:03:17 +0200") 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:244866 Archived-At: I'd like to finish this one way or another, so here it goes... The call to redisplay in nsterm.m was identified as the problem because it can free realized faces, that other code relies on not to happen. The call to redisplay was introduced in the commit below, and I'm looking at the bugs mentioned in it. 68bd6f3ea9c05637501139c46f1f4304482db95f Author: Alan Third CommitDate: Sat Feb 13 22:41:25 2021 +0000 Fix flicker when resizing NS frame programmatically (bug#46155) ; Incidentally fixes bug#21326. I=C3=84m using Emacs master on macOS 12.6 with modified src/nsterm.m @@ -8672,7 +8672,7 @@ - (void)layoutSublayersOfLayer:(CALayer *)layer waiting_for_input =3D 0; block_input (); =20 - redisplay (); + //redisplay (); =20 unblock_input (); waiting_for_input =3D owfi; ------------------------------------------------------------------------ bug#46155: 28.0.50; Regression: buffer contents flicker on macOS ------------------------------------------------------------------------ The bug complains that (dotimes (n 10) (set-frame-parameter nil 'width (+ 80 n)) (sit-for 0.1)) leads to flicker. Not reproducible. This funny comment by Alan made my day, so I'll quote it here :-) Well... I tried something ridiculous and it appears to work... I suspect forcing redisplay this way within the NS run loop is bad form, but it appears to work. In the mails under bug#46155, someone mentions that Emacs displays an empty buffer while busy on startup. Reproducible. That's all I checked. ------------------------------------------------------------------------ bug#21326: 24.5; OS X, frame blank while resizing ------------------------------------------------------------------------ Not reproducible. ------------------------------------------------------------------------ Possible solutions: 1. Don't call redisplay, depending on OS version. 2. What Eli said - make uses of realized faces resilient against face cache clearing. 3. Block input in vertical-motion etc. as Po Lu suggested. 4. Do nothing because that's all esoteric. I favour (1) or (4) because (2) I'm not motivated to do, and TBH I agree with Alan's comment above :-). Can't say much about (3), except that Eli doesn't seem to like it.