Subject: Re: bug#18162: 24.3.92; segfault on null face pointer in face_for_char

From: Ken Raeburn <[email-masked]>
Date: Sat, 2 Aug 2014 06:00:34 -0400

On Aug 2, 2014, at 02:49, Eli Zaretskii <[email-masked]> wrote:
> There's nothing wrong with a call to clear_face_cache.  We do this all
> the time, as you have discovered.  The problem is if we try using
> faces after that without first realizing the basic faces.

Okay, I guess I misread your earlier message as suggesting that that was the problem. In any case, starting from that, I've got a recipe that seems to be somewhat reliable at triggering the problem:

  emacs -Q
  M-x list-faces-display RET
Type into the scratch buffer:
  (progn (clear-face-cache t) (internal-char-font nil 8230))
Hit C-j to evaluate. This generally works the first time. Move the cursor back up to the end of the expression and hit C-j again. The second time usually crashes for me.

The use of list-faces-display came about through guesswork and it seems to help. The real trick, I think, is to get FRAME_DISPLAY_INFO(f)->n_fonts to be large enough to trigger the call to free_all_realized_faces.

Ken