From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#26097: Segmentation fault due to missing faces in face_cache. Date: Tue, 14 Mar 2017 20:20:56 +0200 Message-ID: <838to7btyv.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1489515747 9217 195.159.176.226 (14 Mar 2017 18:22:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 14 Mar 2017 18:22:27 +0000 (UTC) Cc: 26097@debbugs.gnu.org To: Codrut Gusoi Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 14 19:22:21 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cnr5D-0000gZ-BX for geb-bug-gnu-emacs@m.gmane.org; Tue, 14 Mar 2017 19:22:07 +0100 Original-Received: from localhost ([::1]:32907 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnr5J-0004Fe-9j for geb-bug-gnu-emacs@m.gmane.org; Tue, 14 Mar 2017 14:22:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53953) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnr5D-0004FN-Qq for bug-gnu-emacs@gnu.org; Tue, 14 Mar 2017 14:22:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cnr59-0007md-MV for bug-gnu-emacs@gnu.org; Tue, 14 Mar 2017 14:22:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57734) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cnr59-0007li-If for bug-gnu-emacs@gnu.org; Tue, 14 Mar 2017 14:22:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cnr58-0000bz-7b for bug-gnu-emacs@gnu.org; Tue, 14 Mar 2017 14:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 Mar 2017 18:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26097 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26097-submit@debbugs.gnu.org id=B26097.14895157012324 (code B ref 26097); Tue, 14 Mar 2017 18:22:02 +0000 Original-Received: (at 26097) by debbugs.gnu.org; 14 Mar 2017 18:21:41 +0000 Original-Received: from localhost ([127.0.0.1]:55933 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cnr4n-0000bQ-FB for submit@debbugs.gnu.org; Tue, 14 Mar 2017 14:21:41 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34305) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cnr4m-0000bB-79 for 26097@debbugs.gnu.org; Tue, 14 Mar 2017 14:21:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cnr4c-0007Ry-OS for 26097@debbugs.gnu.org; Tue, 14 Mar 2017 14:21:34 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42218) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnr4c-0007Rt-Ko; Tue, 14 Mar 2017 14:21:30 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4562 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cnr4b-0001Ut-Pu; Tue, 14 Mar 2017 14:21:30 -0400 In-reply-to: (message from Codrut Gusoi on Tue, 14 Mar 2017 15:49:49 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:130585 Archived-At: > From: Codrut Gusoi > 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.