all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Basil L. Contovounesios" via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 50571@debbugs.gnu.org
Subject: bug#50571: 28.0.50; Redisplay segfaults with empty face cache
Date: Sun, 19 Sep 2021 14:57:02 +0100	[thread overview]
Message-ID: <87v92wacsx.fsf@tcd.ie> (raw)
In-Reply-To: <87y27zuek1.fsf@tcd.ie> (Basil L. Contovounesios's message of "Tue, 14 Sep 2021 20:45:18 +0100")

[-- Attachment #1: Type: text/plain, Size: 1602 bytes --]

reopen 50571
quit

Basil L. Contovounesios [2021-09-14 20:45 +0100] wrote:

> Eli Zaretskii [2021-09-14 16:33 +0300] wrote:
>
>>> Date: Tue, 14 Sep 2021 16:03:02 +0300
>>> From: Eli Zaretskii <eliz@gnu.org>
>>> Cc: 50571@debbugs.gnu.org
>>> 
>>> Thanks, I see the reason now.  It's because we allow to have arbitrary
>>> Lisp to be registered in jit-lock-functions, and then that arbitrary
>>> Lisp is called in the middle of redisplay, and in this case creates a
>>> whole new frame with faces.  As luck would have it, we decide right
>>> there and then perform routine maintenance and release all the faces
>>> on all the frames...
>>> 
>>> I'm thinking about the best solution for this.
>>
>> Does the patch below give good results?
>
> Yes, applying it makes the issue go away, and reverting it reintroduces
> the segfault.  I didn't notice any other issues.  Thanks!

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.

-- 
Basil


[-- Attachment #2: GDB log --]
[-- Type: application/gzip, Size: 22503 bytes --]

  parent reply	other threads:[~2021-09-19 13:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13 14:59 bug#50571: 28.0.50; Redisplay segfaults with empty face cache Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-13 16:03 ` Eli Zaretskii
2021-09-13 23:21   ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-14 13:03     ` Eli Zaretskii
2021-09-14 13:33       ` Eli Zaretskii
2021-09-14 19:45         ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-15 13:16           ` Eli Zaretskii
2021-09-19 13:57           ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2021-09-19 15:47             ` Eli Zaretskii
2021-09-19 18:21               ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-19 18:41                 ` 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

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

  git send-email \
    --in-reply-to=87v92wacsx.fsf@tcd.ie \
    --to=bug-gnu-emacs@gnu.org \
    --cc=50571@debbugs.gnu.org \
    --cc=contovob@tcd.ie \
    --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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.