unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@gmail.com>
To: martin rudalics <rudalics@gmx.at>
Cc: 31312@debbugs.gnu.org, cyrus.and@gmail.com
Subject: bug#31312: Segmentation fault with doom-emacs, NeoTree and Zoom
Date: Wed, 02 May 2018 20:04:28 -0400	[thread overview]
Message-ID: <87d0ydob8z.fsf@gmail.com> (raw)
In-Reply-To: <5AE9C062.9010203@gmx.at> (martin rudalics's message of "Wed, 02 May 2018 15:42:58 +0200")

martin rudalics <rudalics@gmx.at> writes:

>> So we need the same defense after prepare_menu_bars as we
>> have after do_pending_changes, I think.
>
> If you mean something like
>
>   if (WINDOWP (selected_window) && (w = XWINDOW (selected_window)) != sw)
>     sw = w;
>
> I'm afraid that this would fail since selected_window has no buffer
> any more (or may have even been recycled already).  Or am I missing
> something?

It seems to work (I don't know enough about the code to explain why).  I
applied this patch:

--- i/src/xdisp.c
+++ w/src/xdisp.c
@@ -13936,6 +13936,11 @@ redisplay_internal (void)
   if (NILP (Vmemory_full))
     prepare_menu_bars ();
 
+  /* prepare_menu_bars may call lisp hooks and hence change the
+     selected_window.  */
+  if (WINDOWP (selected_window) && (w = XWINDOW (selected_window)) != sw)
+    sw = w;
+
   reconsider_clip_changes (w);
 
   /* In most cases selected window displays current buffer.  */

And then following the original recipe does not segfault.  There is a
Lisp error, but I think that's already a bug in zoom and/or doom.

Debugger entered--Lisp error: (wrong-type-argument window-live-p #<window 39>)
  set-window-dedicated-p(#<window 39> t)
  neo-window--init(#<window 39> #<buffer  *NeoTree*>)
  neo-global--create-window()
  neo-global--get-window(t)
  neo-global--open-dir("/home/npostavs/src/doom/")
  neo-global--open()
  neotree-show()
  funcall-interactively(neotree-show)
  call-interactively(neotree-show record nil)
  command-execute(neotree-show record)
  #f(compiled-function (cmd) #<bytecode 0x1289c19>)("neotree-show")
  ivy-call()
  ivy-read("M-x " ("toggle-debug-on-error" "zoom-mode" [...]
  counsel-M-x()
  funcall-interactively(counsel-M-x)
  call-interactively(counsel-M-x nil nil)
  command-execute(counsel-M-x)






  parent reply	other threads:[~2018-05-03  0:04 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-29 10:56 bug#31312: Segmentation fault with doom-emacs, NeoTree and Zoom Andrea Cardaci
2018-05-01 13:25 ` Noam Postavsky
2018-05-01 14:33   ` martin rudalics
2018-05-01 23:10     ` Noam Postavsky
2018-05-02  6:16       ` martin rudalics
2018-05-02 11:52         ` Eli Zaretskii
2018-05-02 12:21         ` Noam Postavsky
2018-05-02 12:45           ` Eli Zaretskii
2018-05-02 13:27             ` Andrea Cardaci
2018-05-02 13:47               ` martin rudalics
2018-05-02 15:06                 ` Andrea Cardaci
2018-05-02 15:06               ` Eli Zaretskii
2018-05-02 15:14                 ` Andrea Cardaci
2018-05-02 15:30                   ` Eli Zaretskii
2018-05-02 13:42             ` martin rudalics
2018-05-02 15:03               ` Eli Zaretskii
2018-05-02 18:43                 ` martin rudalics
2018-05-02 19:02                   ` Eli Zaretskii
2018-05-03  7:11                     ` martin rudalics
2018-05-03  0:04               ` Noam Postavsky [this message]
2018-05-03  2:32                 ` Eli Zaretskii
2018-05-03 12:21                   ` Noam Postavsky
2018-05-03 17:54                     ` Eli Zaretskii
2018-05-04  1:18                       ` Noam Postavsky
2018-05-02 13:42           ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d0ydob8z.fsf@gmail.com \
    --to=npostavs@gmail.com \
    --cc=31312@debbugs.gnu.org \
    --cc=cyrus.and@gmail.com \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).