unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Pip Cet <pipcet@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 21394@debbugs.gnu.org
Subject: bug#21394: 25.0.50; Segfault when displaying unprintable character in echo area while frames are being created
Date: Wed, 2 Sep 2015 16:08:08 +0000	[thread overview]
Message-ID: <CAOqdjBcLFNbk-B0XY2mUNMb+tzfpUbHQxdYz9+jxB=ti0o=6Kg@mail.gmail.com> (raw)
In-Reply-To: <838u8oc0mx.fsf@gnu.org>


[-- Attachment #1.1: Type: text/plain, Size: 468 bytes --]

On Wed, Sep 2, 2015 at 3:16 PM, Eli Zaretskii <eliz@gnu.org> wrote:

> > This patch appears, so far, to run without a segfault
>

No segfault overnight.


> Can you please verify that when the (unmodified) code does segfault,
> the offending face ID is indeed stored in
> last_escape_glyph_merged_face_id?  I'd like to be sure we have really
> found the source of that face ID.
>

It is, indeed, and last_escape_glyph_frame also equals it->f.

Revised patch attached.

[-- Attachment #1.2: Type: text/html, Size: 1054 bytes --]

[-- Attachment #2: 0001-Forget-cached-face-ids-when-displaying-echo-area-mes.patch --]
[-- Type: text/x-patch, Size: 2093 bytes --]

From a245722563c5b904313f2f0fe9ca187f6daacae2 Mon Sep 17 00:00:00 2001
From: Philip <pipcet@gmail.com>
Date: Wed, 2 Sep 2015 15:58:16 +0000
Subject: [PATCH] Forget cached face ids when displaying echo area messages
 (Bug#21394)

	* xdisp.c (uncache_faces): New function.
	(display_echo_area_1): Call `uncache_faces'.
	(redisplay_internal): Call `uncache_faces'.
---
 src/xdisp.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/xdisp.c b/src/xdisp.c
index 9ff9f6c..c68c7e1 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -6787,6 +6787,15 @@ merge_glyphless_glyph_face (struct it *it)
   return face_id;
 }
 
+static void
+uncache_faces (void)
+{
+  last_escape_glyph_frame = NULL;
+  last_escape_glyph_face_id = (1 << FACE_ID_BITS);
+  last_glyphless_glyph_frame = NULL;
+  last_glyphless_glyph_face_id = (1 << FACE_ID_BITS);
+}
+
 /* Load IT's display element fields with information about the next
    display element from the current position of IT.  Value is false if
    end of buffer (or C string) is reached.  */
@@ -10676,7 +10685,11 @@ display_echo_area_1 (ptrdiff_t a1, Lisp_Object a2)
   /* Do this before displaying, so that we have a large enough glyph
      matrix for the display.  If we can't get enough space for the
      whole text, display the last N lines.  That works by setting w->start.  */
-  bool window_height_changed_p = resize_mini_window (w, false);
+  bool window_height_changed_p;
+
+  uncache_faces ();
+
+  window_height_changed_p = resize_mini_window (w, false);
 
   /* Use the starting position chosen by resize_mini_window.  */
   SET_TEXT_POS_FROM_MARKER (start, w->start);
@@ -13326,10 +13339,7 @@ redisplay_internal (void)
   sw = w;
 
   pending = false;
-  last_escape_glyph_frame = NULL;
-  last_escape_glyph_face_id = (1 << FACE_ID_BITS);
-  last_glyphless_glyph_frame = NULL;
-  last_glyphless_glyph_face_id = (1 << FACE_ID_BITS);
+  uncache_faces ();
 
   /* If face_change, init_iterator will free all realized faces, which
      includes the faces referenced from current matrices.  So, we
-- 
2.5.1


  reply	other threads:[~2015-09-02 16:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-01 16:43 bug#21394: 25.0.50; Segfault when displaying unprintable character in echo area while frames are being created Pip Cet
2015-09-01 16:57 ` Eli Zaretskii
2015-09-01 17:30   ` Pip Cet
     [not found]     ` <CAOqdjBd7MN39Ra_3nnGCFQAb=xhv7AZt5f+rvAKqqYtoCQKTqQ@mail.gmail.com>
2015-09-01 18:08       ` Eli Zaretskii
2015-09-01 18:52         ` Pip Cet
2015-09-01 19:37           ` Eli Zaretskii
2015-09-01 20:19             ` Pip Cet
2015-09-02 15:16               ` Eli Zaretskii
2015-09-02 16:08                 ` Pip Cet [this message]
2015-09-05  8:12                   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOqdjBcLFNbk-B0XY2mUNMb+tzfpUbHQxdYz9+jxB=ti0o=6Kg@mail.gmail.com' \
    --to=pipcet@gmail.com \
    --cc=21394@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).