From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#50571: 28.0.50; Redisplay segfaults with empty face cache Date: Mon, 13 Sep 2021 19:03:21 +0300 Message-ID: <831r5sea46.fsf@gnu.org> References: <87ilz4msha.fsf@tcd.ie> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13730"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50571@debbugs.gnu.org To: "Basil L. Contovounesios" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 13 18:12:22 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mPoZ5-00037L-Ly for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 13 Sep 2021 18:12:15 +0200 Original-Received: from localhost ([::1]:54748 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mPoZ3-0000nM-O2 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 13 Sep 2021 12:12:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58626) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPoR8-0008J7-FB for bug-gnu-emacs@gnu.org; Mon, 13 Sep 2021 12:04:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35136) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mPoR8-0002iR-7x for bug-gnu-emacs@gnu.org; Mon, 13 Sep 2021 12:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mPoR7-0002fo-VI for bug-gnu-emacs@gnu.org; Mon, 13 Sep 2021 12:04:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Sep 2021 16:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50571 X-GNU-PR-Package: emacs Original-Received: via spool by 50571-submit@debbugs.gnu.org id=B50571.163154902210239 (code B ref 50571); Mon, 13 Sep 2021 16:04:01 +0000 Original-Received: (at 50571) by debbugs.gnu.org; 13 Sep 2021 16:03:42 +0000 Original-Received: from localhost ([127.0.0.1]:46682 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mPoQo-0002f4-8B for submit@debbugs.gnu.org; Mon, 13 Sep 2021 12:03:42 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41422) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mPoQj-0002em-QX for 50571@debbugs.gnu.org; Mon, 13 Sep 2021 12:03:41 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:43208) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mPoQe-0002OH-3D; Mon, 13 Sep 2021 12:03:32 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3871 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPoQc-0006Pg-Oz; Mon, 13 Sep 2021 12:03:32 -0400 In-Reply-To: <87ilz4msha.fsf@tcd.ie> (bug-gnu-emacs@gnu.org) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:214242 Archived-At: > Date: Mon, 13 Sep 2021 15:59:29 +0100 > From: "Basil L. Contovounesios" via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > I can reliably cause Emacs to segfault with my current config and > installed packages with the following steps specific to my system: > > 0. C-x p p (project-switch-project) > 1. Select a checkout of https://github.com/kyleam/bog, > using Ivy completion. > 2. m (magit-project-status) Thanks. I'd prefer not to install two huge packages, so would you please help me understand better what's going on in this recipe? Here's what puzzles me: > #0 terminate_due_to_signal (sig=6, backtrace_limit=2147483647) at emacs.c:400 > #1 0x00005555557d4f5f in die > (msg=0x55555592d2e8 "0 <= id && id < FRAME_FACE_CACHE (f)->used", file=0x55555592d2da "frame.h", line=1433) at alloc.c:7479 > #2 0x00005555556c89f1 in FACE_FROM_ID (f=0x5555562070b0, id=0) at frame.h:1433 > #3 0x00005555556d9e57 in face_at_buffer_position > (w=0x555556207318, pos=1, endptr=0x7fffffff7f70, limit=101, mouse=false, base_face_id=0, attr_filter=0) at xfaces.c:6425 > #4 0x00005555555d41d0 in face_at_pos (it=0x7fffffff8170, attr_filter=0) at xdisp.c:4379 > #5 0x00005555555d44cd in handle_face_prop (it=0x7fffffff8170) at xdisp.c:4480 > #6 0x00005555555d2977 in handle_stop (it=0x7fffffff8170) at xdisp.c:3854 > #7 0x00005555555dd96a in reseat (it=0x7fffffff8170, pos=..., force_p=true) at xdisp.c:7112 > #8 0x00005555555d1abb in init_iterator > (it=0x7fffffff8170, w=0x555556207318, charpos=1, bytepos=1, row=0x555557419f80, base_face_id=DEFAULT_FACE_ID) at xdisp.c:3455 init_iterator makes sure the frame's face cache includes all the basic faces, around line 3220 of xdisp.c: /* If realized faces have been removed, e.g. because of face attribute changes of named faces, recompute them. When running in batch mode, the face cache of the initial frame is null. If we happen to get called, make a dummy face cache. */ if (FRAME_FACE_CACHE (it->f) == NULL) init_frame_faces (it->f); if (FRAME_FACE_CACHE (it->f)->used == 0) recompute_basic_faces (it->f); The backtrace you sent starts at line 3455 of xdisp.c. So somewhere between these two places, or maybe inside reseat and the functions it calls, the frame's face cache gets cleared. Can you please put a watchpoint on it->f->face_cache->used, after the above snippet makes sure the cache is valid and the basic faces are cached in it, and see where the cache gets cleared? Be sure to use the -l (ell) switch of the "watch" command in GDB, so it's valid even when you are not in the lexical scope of init_iterator. When the watchpoint breaks, please show both the C backtrace and the Lisp backtrace (using the "xbacktrace" command if needed). I hope this will tell us enough to understand whodunit. Thanks.