all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Codrut Gusoi <codrut.gusoi@gmail.com>
Cc: 26097@debbugs.gnu.org
Subject: bug#26097: Segmentation fault due to missing faces in face_cache.
Date: Tue, 14 Mar 2017 20:20:56 +0200	[thread overview]
Message-ID: <838to7btyv.fsf@gnu.org> (raw)
In-Reply-To: <CAJi2ve4tHbczdvKeW-+8ZVD1cE_=f_RQO51CZtQDOhrreF_Piw@mail.gmail.com> (message from Codrut Gusoi on Tue, 14 Mar 2017 15:49:49 +0200)

> From: Codrut Gusoi <codrut.gusoi@gmail.com>
> Date: Tue, 14 Mar 2017 15:49:49 +0200
> 
> This is a bit weird to describe so please bear with me.

Thanks for your investigations.

This should not happen: the display engine attempts to prevent faces
from being released while it works on redrawing a frame.  So something
doesn't quite work as planned here.

However, the patches you propose don't really solve the problem, they
are just band-aids.  I'd like to try to find the real reason for the
problem and fix it.

> - Before opening helm in the setup above there are 28 faces in the face_cache.
> - After I open helm the cache fills with around 48 faces.
> - When i hit return after selecting a file, the cache fills up with
> more faces, until it gets to displaying the frame corresponding to the
> file (buffer). Then the face_cache drops to 33 (f->used == 33).

Can you show the backtrace from where the face use count drops?  One
way of doing that is to put a conditional watchpoint on the cache's
'used' count with the condition that it becomes smaller (or maybe
zero).  Make sure you use "watch -l" to avoid automatic deletion of
the watchpoint when some variable goes out of scope.

> - When it gets to the line where it must redisplay helm (vpos == 29 on
> dgb frame 2 above), it wants to redisplay the faces for helm but they
> are no longer in the cache, so FACE_FROM_ID returns NULL and a crash
> happens when the code dereferences the porinter a line below.

The display engine tries to prevent this by setting
inhibit_free_realized_faces to a non-zero value, but I guess something
doesn't quite work in that regard.  I wonder what that is.

Thanks.





  reply	other threads:[~2017-03-14 18:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-14 13:49 bug#26097: Segmentation fault due to missing faces in face_cache Codrut Gusoi
2017-03-14 18:20 ` Eli Zaretskii [this message]
     [not found]   ` <CAJi2ve5YMc04-VUTcRRMv49jFRo3wgFyraZT4TqPHNxPQyO4sA@mail.gmail.com>
2017-03-20 18:46     ` Eli Zaretskii
2017-03-20 19:40       ` Codrut Gusoi
2017-03-25 14:01         ` Eli Zaretskii
2017-03-25 16:46           ` Codrut Gusoi
2017-03-25 17:00             ` 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=838to7btyv.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=26097@debbugs.gnu.org \
    --cc=codrut.gusoi@gmail.com \
    /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.