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#44047: current HEAD has been crashing on startup Date: Wed, 21 Oct 2020 19:03:20 +0300 Message-ID: <83k0vjmurb.fsf@gnu.org> References: <83v9f8srih.fsf@gnu.org> <83wnzmpa5d.fsf@gnu.org> <835z76p2hp.fsf@gnu.org> <83a6wgoq4j.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1339"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 44047@debbugs.gnu.org To: Liam Stitt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 21 18:04:57 2020 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 1kVGbg-0000CE-HO for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 21 Oct 2020 18:04:56 +0200 Original-Received: from localhost ([::1]:56268 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVGbf-0003ZY-4U for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 21 Oct 2020 12:04:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51694) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVGao-0003X7-SC for bug-gnu-emacs@gnu.org; Wed, 21 Oct 2020 12:04:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38777) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kVGao-0001Gc-IS for bug-gnu-emacs@gnu.org; Wed, 21 Oct 2020 12:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kVGao-0005hI-Bs for bug-gnu-emacs@gnu.org; Wed, 21 Oct 2020 12:04: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: Wed, 21 Oct 2020 16:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44047 X-GNU-PR-Package: emacs Original-Received: via spool by 44047-submit@debbugs.gnu.org id=B44047.160329619921851 (code B ref 44047); Wed, 21 Oct 2020 16:04:02 +0000 Original-Received: (at 44047) by debbugs.gnu.org; 21 Oct 2020 16:03:19 +0000 Original-Received: from localhost ([127.0.0.1]:50323 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kVGa7-0005gM-AC for submit@debbugs.gnu.org; Wed, 21 Oct 2020 12:03:19 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:44606) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kVGa5-0005g4-ND for 44047@debbugs.gnu.org; Wed, 21 Oct 2020 12:03:18 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:52026) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVGZy-0001D2-9M; Wed, 21 Oct 2020 12:03:10 -0400 Original-Received: from [176.228.60.248] (port=3848 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kVGZx-0006P2-DY; Wed, 21 Oct 2020 12:03:10 -0400 In-Reply-To: (message from Liam Stitt on Tue, 20 Oct 2020 16:19:26 -0600 (MDT)) 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:191183 Archived-At: > Date: Tue, 20 Oct 2020 16:19:26 -0600 (MDT) > From: Liam Stitt > cc: 44047@debbugs.gnu.org > > (gdb) frame 1 > #1 0x0000555555597de8 in build_frame_matrix_from_leaf_window ( > frame_matrix=0x555555d4a2b0, w=0x555555d42420) at dispnew.c:2531 > 2531 fill_up_frame_row_with_spaces (frame_row, window_matrix->matrix_x); > (gdb) print frame_matrix->rows > $1 = (struct glyph_row *) 0x0 > (gdb) print frame_matrix->nrows > $2 = 0 OK, so this is the problem: the frame glyph matrix has no glyph rows allocated to it. The question is how did that happen? To find out, please run Emacs under GDB, after setting a breakpoint in adjust_frame_glyphs_for_frame_redisplay: (gdb) break adjust_frame_glyphs_for_frame_redisplay (gdb) run -Q -nw When the breakpoint breaks, step through the code with the "next" command. The first couple of times when the function is called, it should return immediately, here: if (!FRAME_LIVE_P (f)) return; In the call after those 2, it should allocate the glyph pools and the 2 glyph matrices, then call allocate_matrices_for_frame_redisplay, and return here: if (!FRAME_WINDOW_P (f) && pool_changed_p) SET_FRAME_GARBAGED (f); return; And in the next call, it should in addition allocate the glyph rows, here: else { adjust_glyph_matrix (NULL, f->desired_matrix, 0, 0, matrix_dim); adjust_glyph_matrix (NULL, f->current_matrix, 0, 0, matrix_dim); SET_FRAME_GARBAGED (f); } This last call's backtrace should look like this: (gdb) bt #0 adjust_frame_glyphs_for_frame_redisplay (f=0xf46948) at dispnew.c:2008 #1 0x000000000041c905 in adjust_frame_glyphs (f=0xf46948) at dispnew.c:1828 #2 0x000000000042cdfd in adjust_frame_size (f=0xf46948, new_width=80, new_height=37, inhibit=5, pretend=false, parameter=XIL(0x3690)) at frame.c:819 #3 0x0000000000427657 in change_frame_size_1 (f=0xf46948, new_width=80, new_height=37, pretend=false, delay=false, safe=true, pixelwise=false) at dispnew.c:5798 #4 0x00000000004276aa in change_frame_size (f=0xf46948, new_width=80, new_height=37, pretend=false, delay=false, safe=true, pixelwise=false) at dispnew.c:5830 #5 0x00000000004290e2 in init_display_interactive () at dispnew.c:6397 #6 0x0000000000429561 in init_display () at dispnew.c:6449 #7 0x00000000005a892b in main (argc=3, argv=0x7fffffffe538) at emacs.c:1995 Does this happen to you as I described, or does something different happen? Also, each time allocate_matrices_for_frame_redisplay is called, please show the value of matrix_dim after the call: (gdb) p matrix_dim and also show the value of f->total_lines each time adjust_frame_glyphs_for_frame_redisplay is called: (gdb) p f->total_lines. Finally, the last time adjust_frame_glyphs_for_frame_redisplay is called, and goes on through all of its code, you should see non-NULL value of the frame's glyph_matrix's glyph_rows before the function returns. Here's what I see: (gdb) p f->desired_matrix->rows $11 = (struct glyph_row *) 0xf50140 (gdb) p f->desired_matrix->nrows $12 = 38 (In my case, the TTY window has height of 38 lines.) If what happens on your system matches the above description, then somehow the value of f->desired_matrix->rows is NULLified after this initialization. But if you get NULL as f->desired_matrix->rows in the last call to adjust_frame_glyphs_for_frame_redisplay, or if Emacs segfaults before it reaches that point, then something abnormal happens during initialization, and we will next look at that. Thanks.