From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#44502: 28.0.50; Emacs crash using new frame Date: Sun, 8 Nov 2020 13:37:21 +0000 Message-ID: <20201108133721.GA18190@ACM> References: <5aa738a4-cfd8-6c4e-3174-4489a289cca9@gmail.com> <83blg96z40.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27606"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 44502@debbugs.gnu.org, acm@muc.de, Andy Moreton To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 08 14:38:18 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 1kbkte-000755-Lm for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 08 Nov 2020 14:38:18 +0100 Original-Received: from localhost ([::1]:33460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kbktd-0004Mp-2n for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 08 Nov 2020 08:38:17 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43228) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kbktO-0004Mc-TQ for bug-gnu-emacs@gnu.org; Sun, 08 Nov 2020 08:38:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48422) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kbktO-0004rH-Jh for bug-gnu-emacs@gnu.org; Sun, 08 Nov 2020 08:38:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kbktO-0003Rw-Fs for bug-gnu-emacs@gnu.org; Sun, 08 Nov 2020 08:38:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Nov 2020 13:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44502 X-GNU-PR-Package: emacs Original-Received: via spool by 44502-submit@debbugs.gnu.org id=B44502.160484265013220 (code B ref 44502); Sun, 08 Nov 2020 13:38:02 +0000 Original-Received: (at 44502) by debbugs.gnu.org; 8 Nov 2020 13:37:30 +0000 Original-Received: from localhost ([127.0.0.1]:59968 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kbksr-0003RA-Ly for submit@debbugs.gnu.org; Sun, 08 Nov 2020 08:37:29 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:54541 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1kbksq-0003Qv-Di for 44502@debbugs.gnu.org; Sun, 08 Nov 2020 08:37:29 -0500 Original-Received: (qmail 21887 invoked by uid 3782); 8 Nov 2020 13:37:22 -0000 Original-Received: from acm.muc.de (p2e5d5c96.dip0.t-ipconnect.de [46.93.92.150]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Sun, 08 Nov 2020 14:37:21 +0100 Original-Received: (qmail 18615 invoked by uid 1000); 8 Nov 2020 13:37:21 -0000 Content-Disposition: inline In-Reply-To: <83blg96z40.fsf@gnu.org> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de 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:192877 Archived-At: Hello, Eli and Andy. On Sat, Nov 07, 2020 at 16:05:51 +0200, Eli Zaretskii wrote: > > From: Andy Moreton > > Date: Sat, 7 Nov 2020 13:27:30 +0000 > > Emacs crashed when using a new frame. After a bootstrap of master, I > > could repeat the crash witht he following recipe: > > - Run "emacs -Q" > > - Type "C-x 5 2 RET" to create a new frame (which becomes selected) > > - Type "C-x C-f" and emacs crashes > > I bisected this using the recipe above, with: > > git checkout master > > git bisect start > > git bisect bad > > git bisect good c3a20804a8 > > Bisect reports the bad commit as: > > 2ecbf4cfae Allow minibuffer to stay in its original frame. > > (2020-11-05 Alan Mackenzie) > Thanks. Yes, the above recipe causes an assertion violation. Alan, > can you take a look, please? Thanks for the backtrace, which was helpful. I've committed the following patch, which appears to fix the bug: commit cfe8a73cab5e7a9c6a6fcc212bd9df980f233895 (HEAD -> master, origin/master, origin/HEAD) Author: Alan Mackenzie Date: Sun Nov 8 13:28:55 2020 +0000 Don't set the selected window to the miniwindow on a frame change. Intended to fix bug #44502. * src/minibuf.c (move_minibuffer_onto_frame): Remove the lines of code which set the selected window to the minibuffer. diff --git a/src/minibuf.c b/src/minibuf.c index 068086ead8..8c19559b08 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -142,10 +142,6 @@ void move_minibuffer_onto_frame (void) set_window_buffer (sf->minibuffer_window, buffer, 0, 0); minibuf_window = sf->minibuffer_window; - if (EQ (XWINDOW (minibuf_window)->frame, selected_frame)) - /* The minibuffer might be on another frame. */ - Fset_frame_selected_window (selected_frame, sf->minibuffer_window, - Qnil); set_window_buffer (of->minibuffer_window, get_minibuffer (0), 0, 0); } } > Here's a backtrace from an unoptimized build: > window.c:554: Emacs fatal error: assertion failed: EQ (window, selected_window) > Thread 1 hit Breakpoint 1, terminate_due_to_signal (sig=22, > backtrace_limit=2147483647) at emacs.c:378 > 378 signal (sig, SIG_DFL); [ .... ] > Lisp Backtrace: > "redisplay_internal (C function)" (0x0) > "read-from-minibuffer" (0x82c8a0) > "completing-read-default" (0x82cf00) > "completing-read" (0x82d210) > "read-file-name-default" (0x82d9c0) > "read-file-name" (0x82dfa0) > "find-file-read-args" (0x82e560) > "byte-code" (0x82ea18) > "call-interactively" (0x82ef80) > "command-execute" (0x82f5c8) -- Alan Mackenzie (Nuremberg, Germany).