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#48337: Fwd: 28.0.50; Emacs crashing randomly (possibly minibuffer activity related) Date: Fri, 14 May 2021 18:40:03 +0000 Message-ID: References: <87tunasd2u.fsf@linaro.org> <83fsyu57oj.fsf@gnu.org> <87y2ckgby0.fsf@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29042"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 48337@debbugs.gnu.org To: Alex =?UTF-8?Q?Benn=C3=A9e?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 14 20:41:12 2021 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 1lhckK-0007Qh-84 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 May 2021 20:41:12 +0200 Original-Received: from localhost ([::1]:46854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhckI-0003EU-8U for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 May 2021 14:41:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhck9-0003EG-W6 for bug-gnu-emacs@gnu.org; Fri, 14 May 2021 14:41:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35507) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lhck9-0000wk-Nj for bug-gnu-emacs@gnu.org; Fri, 14 May 2021 14:41:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lhck9-0008HT-Kn for bug-gnu-emacs@gnu.org; Fri, 14 May 2021 14:41:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 May 2021 18:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48337 X-GNU-PR-Package: emacs Original-Received: via spool by 48337-submit@debbugs.gnu.org id=B48337.162101761431763 (code B ref 48337); Fri, 14 May 2021 18:41:01 +0000 Original-Received: (at 48337) by debbugs.gnu.org; 14 May 2021 18:40:14 +0000 Original-Received: from localhost ([127.0.0.1]:47053 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhcjO-0008GF-31 for submit@debbugs.gnu.org; Fri, 14 May 2021 14:40:14 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:18410 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1lhcjK-0008Ft-HE for 48337@debbugs.gnu.org; Fri, 14 May 2021 14:40:12 -0400 Original-Received: (qmail 72671 invoked by uid 3782); 14 May 2021 18:40:04 -0000 Original-Received: from acm.muc.de (p4fe158f3.dip0.t-ipconnect.de [79.225.88.243]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 14 May 2021 20:40:04 +0200 Original-Received: (qmail 12400 invoked by uid 1000); 14 May 2021 18:40:03 -0000 Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) 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:206551 Archived-At: Hello, Alex. On Fri, May 14, 2021 at 17:52:46 +0100, Alex Bennée wrote: > Sadly not, testing with 780b1db126fcfdbb50da5c1acf24b3c6e614dd9f I got a > crash when I tried to switch buffer. Thanks for the two dumps. They make it obvious what has happened. buffer-list-update-hook is getting called before the new minibuffer has been pushed onto the minnibuffer list. Could I ask you to try out the following patch which should fix that problem. Thanks! diff --git a/src/minibuf.c b/src/minibuf.c index 428998a639..d4702ee684 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -653,11 +653,11 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, return unbind_to (count, val); } - minibuf_level++; /* Before calling choose_minibuf_frame. */ /* Ensure now that the latest minibuffer has been created, in case anything happens which depends on MINNIBUF_LEVEL and Vminibuffer_list being consistent with eachother. */ - minibuffer = get_minibuffer (minibuf_level); + minibuffer = get_minibuffer (minibuf_level + 1); + minibuf_level++; /* Before calling choose_minibuf_frame. */ /* Choose the minibuffer window and frame, and take action on them. */ > On Fri, 14 May 2021 at 17:31, Alan Mackenzie wrote: > > Hello, Alex. > > On Tue, May 11, 2021 at 23:07:01 +0100, Alex Bennée wrote: > > > Alan Mackenzie writes: > > > > On Tue, May 11, 2021 at 07:51:20 +0100, Alex Bennée wrote: > > > >> I can now recreate at will with a magit sequence (l o hackbox/ TAB) > > which > > > >> triggers a minibuffer re-size to accommodate the list of git branches: > > > > Could you possibly give us a precise recipe to reproduce this bug, and > > a > > > > GDB backtrace with Emacs compiled with CFLAGS='-O0 g3' (or similar)? > > So > > > > much of the needed information in your large dump post has been > > > > optimised away by the compiler. Would you please also make sure that > > > > the Lisp backtrace is at the end of the GDB backtrace. I think this > > > > should happen automatically if you have an Emacs .gdbinit in the > > > > directory where you start GDB from. > > I now understand what the bug was, and have just committed a patch which > > should have fixed it. Could you please update your Emacs and test your > > bug scenario, and either confirm to me that the bug is fixed, or say what > > is still wrong. If this has to wait until Monday that's OK, but please > > let us know that. > > Then, hopefully, we can close the bug. > > > The later rr dumps have more symbols but didn't have the benefit of the > > > Emacs' .gdbinit Lips backtrace. However I'm fairly confident it's being > > > triggered by doom-modeline: > > The actual trigger was something on buffer-list-update-hook. That should > > now no longer cause a problem. > > [ .... ] > -- > Alex Bennée > KVM/QEMU Hacker for Linaro > +bt > #0 0x00007ffff4e955cb in raise (sig=6) at ../sysdeps/unix/sysv/linux/raise.c:50 > #1 0x0000555555728708 in terminate_due_to_signal (sig=6, backtrace_limit=40) at emacs.c:437 > #2 0x000055555575daa0 in emacs_abort () at sysdep.c:2282 > #3 0x0000555555783080 in Factive_minibuffer_window () at minibuf.c:231 > #4 0x0000555555810a6e in funcall_subr (subr=0x555555e0c6c0 , numargs=0, args=0x7fffffffad70) at eval.c:3109 > #5 0x000055555581053e in Ffuncall (nargs=1, args=0x7fffffffad68) at eval.c:3036 > #6 0x000055555586ad5b in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=1, args=0x7fffffffb238) at bytecode.c:632 > #7 0x0000555555810d06 in fetch_and_exec_byte_code (fun=..., syms_left=..., nargs=1, args=0x7fffffffb230) at eval.c:3160 > #8 0x000055555581118c in funcall_lambda (fun=..., nargs=1, arg_vector=0x7fffffffb230) at eval.c:3241 > #9 0x0000555555810592 in Ffuncall (nargs=2, args=0x7fffffffb228) at eval.c:3040 > #10 0x000055555586ad5b in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0, args=0x7fffffffb7a0) at bytecode.c:632 > #11 0x0000555555810d06 in fetch_and_exec_byte_code (fun=..., syms_left=..., nargs=0, args=0x7fffffffb7a0) at eval.c:3160 > #12 0x000055555581118c in funcall_lambda (fun=..., nargs=0, arg_vector=0x7fffffffb7a0) at eval.c:3241 > #13 0x0000555555810592 in Ffuncall (nargs=1, args=0x7fffffffb798) at eval.c:3040 > #14 0x000055555580f7a4 in funcall_nil (nargs=1, args=0x7fffffffb798) at eval.c:2677 > #15 0x000055555580fcce in run_hook_with_args (nargs=1, args=0x7fffffffb798, funcall=0x55555580f781 ) at eval.c:2854 > #16 0x000055555580f82a in Frun_hook_with_args (nargs=1, args=0x7fffffffb798) at eval.c:2719 > #17 0x000055555580fd66 in run_hook (hook=...) at eval.c:2867 > #18 0x000055555580f7e5 in Frun_hooks (nargs=1, args=0x7fffffffb8f8) at eval.c:2701 > #19 0x0000555555810978 in funcall_subr (subr=0x555555e15660 , numargs=1, args=0x7fffffffb8f8) at eval.c:3091 > #20 0x000055555581053e in Ffuncall (nargs=2, args=0x7fffffffb8f0) at eval.c:3036 > #21 0x000055555580fe5b in call1 (fn=..., arg1=...) at eval.c:2896 > #22 0x00005555557650a0 in run_buffer_list_update_hook (buf=0x555555f4ba60) at buffer.c:529 > #23 0x0000555555765504 in Fget_buffer_create (buffer_or_name=..., inhibit_buffer_hooks=...) at buffer.c:635 > #24 0x0000555555785d94 in get_minibuffer (depth=1) at minibuf.c:1028 <======================================= > #25 0x00005555557841fd in read_minibuf (map=..., initial=..., prompt=..., expflag=false, histvar=..., histpos=..., defalt=..., allow_props=false, inherit_input_method=false) at minibuf.c:660 -- Alan Mackenzie (Nuremberg, Germany).