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#31312: Segmentation fault with doom-emacs, NeoTree and Zoom Date: Wed, 02 May 2018 14:52:55 +0300 Message-ID: References: <87r2mvo6c8.fsf@gmail.com> <5AE87AA3.6050602@gmx.at> <87o9hznfam.fsf@gmail.com> <5AE957BA.6000809@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1525261934 3150 195.159.176.226 (2 May 2018 11:52:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 2 May 2018 11:52:14 +0000 (UTC) User-Agent: K-9 Mail for Android Cc: cyrus.and@gmail.com To: 31312@debbugs.gnu.org, rudalics@gmx.at, npostavs@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 02 13:52:10 2018 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 1fDqIr-0000ia-OH for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 May 2018 13:52:09 +0200 Original-Received: from localhost ([::1]:49843 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDqKy-00054e-EH for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 May 2018 07:54:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49009) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDqKo-000535-2P for bug-gnu-emacs@gnu.org; Wed, 02 May 2018 07:54:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDqKi-0004wb-5B for bug-gnu-emacs@gnu.org; Wed, 02 May 2018 07:54:10 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38524) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fDqKi-0004wX-16 for bug-gnu-emacs@gnu.org; Wed, 02 May 2018 07:54:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fDqKg-0006rE-1G for bug-gnu-emacs@gnu.org; Wed, 02 May 2018 07:54:03 -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, 02 May 2018 11:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31312 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed X-Debbugs-Original-To: bug-gnu-emacs@gnu.org, martin rudalics , Noam Postavsky X-Debbugs-Original-Cc: 31312@debbugs.gnu.org, Andrea Cardaci Original-Received: via spool by submit@debbugs.gnu.org id=B.152526199726296 (code B ref -1); Wed, 02 May 2018 11:54:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 May 2018 11:53:17 +0000 Original-Received: from localhost ([127.0.0.1]:46418 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fDqJx-0006q4-6i for submit@debbugs.gnu.org; Wed, 02 May 2018 07:53:17 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57758) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fDqJu-0006pq-OU for submit@debbugs.gnu.org; Wed, 02 May 2018 07:53:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDqJo-0004g1-J4 for submit@debbugs.gnu.org; Wed, 02 May 2018 07:53:09 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:50515) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fDqJo-0004fv-FG for submit@debbugs.gnu.org; Wed, 02 May 2018 07:53:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDqJn-0004Wc-2J for bug-gnu-emacs@gnu.org; Wed, 02 May 2018 07:53:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDqJi-0004eR-86 for bug-gnu-emacs@gnu.org; Wed, 02 May 2018 07:53:07 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45925) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDqJi-0004eK-3R; Wed, 02 May 2018 07:53:02 -0400 Original-Received: from [109.253.190.64] (port=43456 helo=[10.128.97.191]) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1fDqJh-0008MS-4u; Wed, 02 May 2018 07:53:01 -0400 In-Reply-To: <5AE957BA.6000809@gmx.at> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:145918 Archived-At: On May 2, 2018 9:16:26 AM GMT+03:00, martin rudalics wr= ote: > >> Is w in reconsider_clip_changes the same as XWINDOW > (selected_window) > >> when it fails? > > > > Nope=2E In fact, doing > > > > break 13939 if (w !=3D XWINDOW(selected_window)) > > > > triggers only just before the bad reconsider_clip_changes call=2E > > > > #0 redisplay_internal () at =2E=2E/=2E=2E/src/xdisp=2Ec:13939 > > #1 0x0000000000463c16 in redisplay () at =2E=2E/=2E=2E/src/xdisp=2Ec= :13518 > > #2 0x00000000005851ae in read_char (commandflag=3D1, > map=3DXIL(0x5e99db3), prev_event=3DXIL(0), > > used_mouse_menu=3D0x7fffffffe41f, end_time=3D0x0) at > =2E=2E/=2E=2E/src/keyboard=2Ec:2480 > > #3 0x00000000005957c5 in read_key_sequence (keybuf=3D0x7fffffffe570, > bufsize=3D30, prompt=3DXIL(0), > > dont_downcase_last=3Dfalse, can_return_switch_frame=3Dtrue, > fix_current_buffer=3Dtrue, > > prevent_redisplay=3Dfalse) at =2E=2E/=2E=2E/src/keyboard=2Ec:914= 7 > > #4 0x0000000000581d55 in command_loop_1 () at > =2E=2E/=2E=2E/src/keyboard=2Ec:1368 > > (More stack frames follow=2E=2E=2E) > > (gdb) p w > > $16 =3D (struct window *) 0x47d22f0 > > (gdb) p sw > > $17 =3D (struct window *) 0x47d22f0 > > (gdb) p XWINDOW(selected_window) > > $18 =3D (struct window *) 0x61109d0 > > (gdb) p w->contents > > $19 =3D XIL(0) > > (gdb) p XWINDOW(selected_window)->contents > > $20 =3D XIL(0x493e565) > > (gdb) xpr > > Lisp_Vectorlike > > PVEC_BUFFER > > $21 =3D (struct buffer *) 0x493e560 > > (unsigned char *) 0x4a34568 " *NeoTree*" >=20 > I'm probably too silly to understand this=2E IIUC we are here >=20 > /* do_pending_window_change could change the selected_window due to > frame resizing which makes the selected window too small=2E */ > if (WINDOWP (selected_window) && (w =3D XWINDOW (selected_window)) !=3D > sw) > sw =3D w; >=20 > /* Clear frames marked as garbaged=2E */ > clear_garbaged_frames (); >=20 > /* Build menubar and tool-bar items=2E */ > if (NILP (Vmemory_full)) > prepare_menu_bars (); >=20 > reconsider_clip_changes (w); >=20 > and the only ways this could cause w !=3D XWINDOW(selected_window) > before the last call is either !WINDOWP (selected_window) or that > clear_garbaged_frames or prepare_menu_bars change selected_window=2E > Can you find the responsible? >=20 > martin Those are exactly the questions I'd like to have answers for=2E Btw, I tried to run the recipe in "emacs -Q", and it didn't crash, so I gu= ess something in doom-land is a necessary piece of this puzzle=2E Also, please take a look at zoom=2Eel: it hooks window-size-change-functio= ns and resizes the windows in that hook(!)=2E And prepare_menu_bars runs window-size-change-functions, which resets the frame's window-configuration-changed flag, assuming that no one in their right mind will change the configuration from a hook that notifies about changes in configuration=2E After all this madness, it's small wonder that we end up with a dead window in W=2E Of course, we need to protect us against such calamities in any case=2E=2E= =2E