From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?=E5=BC=A0=E4=BA=91=E5=B3=B0?= Newsgroups: gmane.emacs.bugs Subject: bug#65198: 29.1; Emacs29.1 crash in function face_for_font Date: Sat, 12 Aug 2023 00:14:01 +0800 Message-ID: References: <83r0obi53o.fsf@gnu.org> <83bkfeizgz.fsf@gnu.org> <831qgaiw2d.fsf@gnu.org> <83ttt6gl9l.fsf@gnu.org> <83zg2xfvff.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000e8b4000602a80017" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7181"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65198@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 11 18:15:20 2023 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 1qUUnI-0001gX-K5 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 11 Aug 2023 18:15:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qUUn1-0006sM-0e; Fri, 11 Aug 2023 12:15:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qUUmz-0006rz-W9 for bug-gnu-emacs@gnu.org; Fri, 11 Aug 2023 12:15:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qUUmz-0002DX-NE for bug-gnu-emacs@gnu.org; Fri, 11 Aug 2023 12:15:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qUUmz-0003rw-Jl for bug-gnu-emacs@gnu.org; Fri, 11 Aug 2023 12:15:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?=E5=BC=A0=E4=BA=91=E5=B3=B0?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 11 Aug 2023 16:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65198 X-GNU-PR-Package: emacs Original-Received: via spool by 65198-submit@debbugs.gnu.org id=B65198.169177046314799 (code B ref 65198); Fri, 11 Aug 2023 16:15:01 +0000 Original-Received: (at 65198) by debbugs.gnu.org; 11 Aug 2023 16:14:23 +0000 Original-Received: from localhost ([127.0.0.1]:47853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUUmM-0003qc-2R for submit@debbugs.gnu.org; Fri, 11 Aug 2023 12:14:23 -0400 Original-Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]:60824) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUUmJ-0003qM-8h for 65198@debbugs.gnu.org; Fri, 11 Aug 2023 12:14:20 -0400 Original-Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-686b879f605so1656732b3a.1 for <65198@debbugs.gnu.org>; Fri, 11 Aug 2023 09:14:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691770453; x=1692375253; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=EqKKeEjHc5e2dIarCvzoIbkGQf48FV/Rv+HD8XZNIn4=; b=VqHhjfZFm0zoClfTEmPXnxV0sAoI2T//tEokmyLU6ubpNfo7KSHCFr6HENitzHFuul GvQxYmJ2LXR0gQpexhh5/KrpAl5CvE7i6dqi5QGG0WCFwy2JGwnNXeLyRv6p2yd3NFvC oAVIKvLIOrHX4SY2+5OuI6G1uPWWIqCGTeWXX3aF0K/qBz+ChWlazjt2f9YY8r3TVlMU 8QlZn9iVgqSGeM0LqBnD9lY0OSWAAnAxX7vLrn1XOzMSy/K3Bl6eOeK1146ptSKsNon7 2XlkFEOcaPJmcdI3j11x+DvQyInXLB/Oj78ZNRWEMwhy/795BcifLwHv27nBjbjeDIKD LTIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691770453; x=1692375253; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=EqKKeEjHc5e2dIarCvzoIbkGQf48FV/Rv+HD8XZNIn4=; b=XhC5j9NbS4JO7D2U6zo95rGyxfIDDKbdoL+qSk7FBcQEnO2YwcOFzPFc/Qqi9o1u7i r5hFPfPU0ualdvDqSlC//L6XraOJieOPMqp6hlCtrkURjOCcp8Be5OXCJIYIsvhmUW99 QMmymzp5kmMd2pZA1rF9Yg8G992vcH7CQL7Yi8mGt3sEaAujQ0t47DsazAm6NUNLYthE onPNrY9qMKFnfZ8Y3hA0lIfeRBomymgblHziCkrUzcr/AWKdyKS44o4DpmIPtp60Zxaq yFd442mT65ifcnUv8zru6G81Vb80cPnh3CMxkS2tVBdF/z5XAUccWkpvaNwOck93rI27 IZqg== X-Gm-Message-State: AOJu0Yw625Lt7XE42c0MbI+MOLtQbXe1GswpnbvNBsoZZZutAx+gpP0p dtzugAP8yy3EKJ6XWPW7PbaloisGRs8KFfFcww6nNujFj53QJw== X-Google-Smtp-Source: AGHT+IGMGbYGjkNPY4/JODgtFG3eqCRgaWMh7Ug7DLr82a5lBBFwAPFKzkqzu3kk81LSGnL9IOFwVKj2YXyuAsZk4DM= X-Received: by 2002:a17:90a:f193:b0:268:1e9:53bf with SMTP id bv19-20020a17090af19300b0026801e953bfmr1600028pjb.37.1691770453273; Fri, 11 Aug 2023 09:14:13 -0700 (PDT) In-Reply-To: <83zg2xfvff.fsf@gnu.org> 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:267221 Archived-At: --000000000000e8b4000602a80017 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I made a little modification to this patch, and after verification, emacs does not crash anymore, thanks!=F0=9F=98=8A diff --git a/src/xdisp.c b/src/xdisp.c index 9cddcfe..830b622 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -8312,9 +8312,14 @@ get_next_display_element (struct it *it) && success_p && FRAME_WINDOW_P (it->f)) { - struct face *face =3D FACE_FROM_ID (it->f, it->face_id); + struct face *face =3D FACE_FROM_ID_OR_NULL (it->f, it->face_id); - if (it->what =3D=3D IT_COMPOSITION && it->cmp_it.ch >=3D 0) + if (!face) + { + it->what =3D IT_GLYPHLESS; + it->glyphless_method =3D GLYPHLESS_DISPLAY_EMPTY_BOX; + } + else if (it->what =3D=3D IT_COMPOSITION && it->cmp_it.ch >=3D 0) { /* Automatic composition with glyph-string. */ Lisp_Object gstring =3D composition_gstring_from_id (it->cmp_it.i= d); @@ -31782,8 +31787,8 @@ produce_glyphless_glyph (struct it *it, bool for_no_font, Lisp_Object acronym) /* Get the metrics of the base font. We always refer to the current ASCII face. */ - face =3D FACE_FROM_ID (it->f, it->face_id)->ascii_face; - font =3D face->font ? face->font : FRAME_FONT (it->f); + face =3D FACE_FROM_ID_OR_NULL (it->f, it->face_id); + if (face) + { + face =3D face->ascii_face; + } + font =3D (face && face->font) ? face->font : FRAME_FONT (it->f); normal_char_ascent_descent (font, -1, &it->ascent, &it->descent); it->ascent +=3D font->baseline_offset; it->descent -=3D font->baseline_offset; --000000000000e8b4000602a80017 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I made a little modification to this patch, and after= verification, emacs does not crash anymore, thanks!=F0=9F=98=8A
=
diff --git a/src/xdisp.c b/src/xdisp.c
index 9cddcfe..830b622 = 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -8312,9 +8312,14 @@ = get_next_display_element (struct it *it)
=C2=A0 =C2=A0 =C2=A0 =C2=A0&= ;& success_p
=C2=A0 =C2=A0 =C2=A0 =C2=A0&& FRAME_WINDOW_P (i= t->f))
=C2=A0 =C2=A0 =C2=A0{
- =C2=A0 =C2=A0 =C2=A0struct face *fa= ce =3D FACE_FROM_ID (it->f, it->face_id);
+ =C2=A0 =C2=A0 =C2=A0st= ruct face *face =3D FACE_FROM_ID_OR_NULL (it->f, it->face_id);
- =C2=A0 =C2=A0 =C2=A0if (it->what =3D=3D IT_COMPOSITION && it-= >cmp_it.ch >=3D 0)
+ =C2=A0 =C2= =A0 =C2=A0if (!face)
+ =C2=A0 =C2=A0 =C2=A0 {
+ =C2=A0 =C2=A0 =C2=A0 = =C2=A0 it->what =3D IT_GLYPHLESS;
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 it-&g= t;glyphless_method =3D GLYPHLESS_DISPLAY_EMPTY_BOX;
+ =C2=A0 =C2=A0 =C2= =A0 }
+ =C2=A0 =C2=A0 =C2=A0else if (it->what =3D=3D IT_COMPOSITION &= amp;& it->cmp_it.ch >=3D 0)
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Auto= matic composition with glyph-string. =C2=A0 */
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 Lisp_Object gstring =3D composition_gstring_from_id (it->cmp_it.id);
@@ -31782,8 +31787,8 @@ produce= _glyphless_glyph (struct it *it, bool for_no_font, Lisp_Object acronym)
=
=C2=A0 =C2=A0/* Get the metrics of the base font.=C2=A0 We always refer= to the current
=C2=A0 =C2=A0 =C2=A0 ASCII face. =C2=A0*/
- =C2=A0fac= e =3D FACE_FROM_ID (it->f, it->face_id)->ascii_face;
- =C2=A0fo= nt =3D face->font ? face->font : FRAME_FONT (it->f);
+ =C2=A0face =3D FACE_FROM_ID_OR_NULL (it->f, it->face_= id);
+=C2=A0 =C2=A0if (face)=C2=A0
+=C2=A0 =C2=A0{
+=C2=A0 =C2=A0 =C2=A0 face =3D face->ascii_face;
+=C2=A0 =C2=A0 }
+ =C2=A0font= =3D (face && face->font) ? face->font : FRAME_FONT (it->f= );
=C2=A0 =C2=A0normal_char_ascent_descent (font, -1, &it->ascent= , &it->descent);
=C2=A0 =C2=A0it->ascent +=3D font->baselin= e_offset;
=C2=A0 =C2=A0it->descent -=3D font->baseline_offset;
--000000000000e8b4000602a80017--