Subject: Re: bug#50571: 28.0.50; Redisplay segfaults with empty face cache

From: "Basil L. Contovounesios" <[email-masked]>
Date: Sun, 19 Sep 2021 19:21:12 +0100

Eli Zaretskii [2021-09-19 18:47 +0300] wrote:

>> From: "Basil L. Contovounesios" <[email-masked]>
>> Cc: [email-masked]
>> Date: Sun, 19 Sep 2021 14:57:02 +0100
>> 
>> Unfortunately I found another hole that needs plugging, but fortunately
>> I can reliably reproduce it with the following site-specific steps:
>> 
>> 0. emacs
>> 1. C-x p p (project-switch-project)
>> 2. Select a checkout of https://github.com/abo-abo/swiper,
>>    using Ivy completion.
>> 3. f (project-find-file)
>> 4. ivy.el RET
>> 5. C-s (isearch-forward)
>> 6. C-g
>> 7. M-s s (counsel-grep-or-swiper)
>> 8. #[[:digit:]]
>> 
>> This brings a bug-reference-bug-regexp match onto screen, which again
>> triggers a frame creation via bug-reference's call to display-warning.
>> 
>> The attached GDB log shows where the relevant frame's face cache is
>> cleared right before the crash (search for 'New value = 0'), at which
>> point f->inhibit_clear_image_cache is false.
>
> Thanks for the data.  I guess this is a preview of how allowing
> arbitrary Lisp that affects the display in fontification-functions
> will keep shooting in the foot, time and again.

For that there's M-x kevlar-feet-mode of course, though I'm not sure
it's GPL-compatible.

> Please try the patch below.

It seems to relieve the pain in my feet, thank you very much!

-- 
Basil