From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#6593: emacs-23.2 crashes in get_glyph_face_and_encoding with a null face returned by FACE_FROM_ID(0) Date: Sat, 10 Jul 2010 11:13:33 +0300 Message-ID: <83sk3rah5e.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1278750612 29605 80.91.229.12 (10 Jul 2010 08:30:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 10 Jul 2010 08:30:12 +0000 (UTC) Cc: 6593@debbugs.gnu.org To: John Lumby Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 10 10:30:11 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OXVRq-00048J-ED for geb-bug-gnu-emacs@m.gmane.org; Sat, 10 Jul 2010 10:30:10 +0200 Original-Received: from localhost ([127.0.0.1]:52668 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OXVRp-00010k-Ld for geb-bug-gnu-emacs@m.gmane.org; Sat, 10 Jul 2010 04:30:09 -0400 Original-Received: from [140.186.70.92] (port=34994 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OXVRj-00010d-KF for bug-gnu-emacs@gnu.org; Sat, 10 Jul 2010 04:30:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OXVRi-0004a5-CP for bug-gnu-emacs@gnu.org; Sat, 10 Jul 2010 04:30:03 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41787) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OXVRi-0004a1-9x for bug-gnu-emacs@gnu.org; Sat, 10 Jul 2010 04:30:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OXVEA-0003QW-EY; Sat, 10 Jul 2010 04:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Jul 2010 08:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6593 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6593-submit@debbugs.gnu.org id=B6593.127874974513166 (code B ref 6593); Sat, 10 Jul 2010 08:16:02 +0000 Original-Received: (at 6593) by debbugs.gnu.org; 10 Jul 2010 08:15:45 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OXVDs-0003QJ-LP for submit@debbugs.gnu.org; Sat, 10 Jul 2010 04:15:44 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OXVDq-0003QC-1m for 6593@debbugs.gnu.org; Sat, 10 Jul 2010 04:15:43 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0L5C008001CYL200@a-mtaout20.012.net.il> for 6593@debbugs.gnu.org; Sat, 10 Jul 2010 11:15:38 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([77.127.120.144]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0L5C0069Z1LZ7E70@a-mtaout20.012.net.il>; Sat, 10 Jul 2010 11:15:36 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 10 Jul 2010 04:16:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:38338 Archived-At: > From: John Lumby > Date: Fri, 9 Jul 2010 09:54:55 -0400 > Cc: > > paste this text into any lisp-interaction buffer e.g. *scratch*, position cursor at end, and press Ctl-X Ctl-E > > > (progn (modify-frame-parameters (selected-frame) '((menu-bar-lines . 0))) > (set-face-font 'modeline "-misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-1") > (face-set-after-frame-default (selected-frame)) (set-face-background 'default (cdr (assoc 'background-color (frame-parameters (selected-frame))))) (set-face-background 'fringe (cdr (assoc 'background-color (frame-parameters (selected-frame))))) (set-face-foreground 'default (cdr (assoc 'foreground-color (frame-parameters (selected-frame))))) (server-start)) > > > > I get a crash in get_glyph_face_and_encoding. Thanks for your report. It misses a few crucial details, though. What system is that? I couldn't reproduce the crash on my machine (MS-Windows). > I started emacs with something like > emacs --name=sawlist --title=sawlist -ms "#14892b" -cr red -fn "-Misc-Fixed-bold-R-*--15-*-*-*-C-90-ISO8859-1" -bg "#E0EDED" -fg "#751503" -q -load sawlist.el > > I can send my sawlist.el if needed Does the crash happen if you start Emacs with "emacs -Q"? Without -Q, your customizations on ~/.emacs also come into play. > I obtained a core file after rebuilding to get the debugging information and here is the relevant piece > (gdb) bt > #0 0x00d57424 in __kernel_vsyscall () > #1 0x00876006 in kill () at ../sysdeps/unix/syscall-template.S:82 > #2 0x0810fe76 in fatal_error_signal (sig=11) at emacs.c:402 > #3 > #4 get_glyph_face_and_encoding (f=0x920c4f0, glyph=0x946b9a0, char2b=0xbfbeb890, two_byte_p=0xbfbeb85c) at xdisp.c:19511 > #5 0x0806bc58 in fill_glyph_string (s=0xbfbeb8b0, face_id=0, start=, end=1, overlaps=0) at xdisp.c:19681 > #6 0x0806c68b in draw_glyphs (w=0x920c670, x=27, row=0x93fa530, area=TEXT_AREA, start=0, end=1, hl=DRAW_NORMAL_TEXT, overlaps=0) > at xdisp.c:20297 Please show the full backtrace, including the Lisp backtrace (shown if you start GDB from the src directory). The above only shows the top 6 stack frames. Also, if you could rebuild without optimizations (-O0), it would help, because the stack trace in an optimized build cannot be trusted and too many variables have their values shown as ``optimized out'', which doesn't really help debugging. > This patch (below) fixes one obvious mistake (but not the cause) and also works around the problem. This mistake is that the assert is located after the dereference of the face pointer - should be before. But that just changes the crash to an assert failure. The workaround to is to try all other faces cached on the frame. I don't know what the correct fix is for the default face being null. Sorry, but I don't think this is the right fix. The default face should always be realized. Looking up some face, any face, in the face cache is not TRT.