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#48337: Fwd: 28.0.50; Emacs crashing randomly (possibly minibuffer activity related) Date: Tue, 11 May 2021 16:42:26 +0300 Message-ID: <83zgx14cal.fsf@gnu.org> References: <87tunasd2u.fsf@linaro.org> <83fsyu57oj.fsf@gnu.org> <838s4l5uld.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17688"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, 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 Tue May 11 15:43:24 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 1lgSfT-0004UQ-Ed for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 11 May 2021 15:43:23 +0200 Original-Received: from localhost ([::1]:55990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgSfS-0000GT-HT for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 11 May 2021 09:43:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33616) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgSf8-0000Ex-2Y for bug-gnu-emacs@gnu.org; Tue, 11 May 2021 09:43:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52136) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lgSf7-0001tN-Ra for bug-gnu-emacs@gnu.org; Tue, 11 May 2021 09:43:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lgSf7-0000jo-Pu for bug-gnu-emacs@gnu.org; Tue, 11 May 2021 09:43:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 May 2021 13:43: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.16207405502798 (code B ref 48337); Tue, 11 May 2021 13:43:01 +0000 Original-Received: (at 48337) by debbugs.gnu.org; 11 May 2021 13:42:30 +0000 Original-Received: from localhost ([127.0.0.1]:35449 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgSeb-0000j4-Tv for submit@debbugs.gnu.org; Tue, 11 May 2021 09:42:30 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:51348) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgSea-0000is-36 for 48337@debbugs.gnu.org; Tue, 11 May 2021 09:42:28 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:49210) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgSeU-0001Vr-5B; Tue, 11 May 2021 09:42:22 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4457 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgSeT-0004ZY-2t; Tue, 11 May 2021 09:42:21 -0400 In-Reply-To: (message from Alex =?UTF-8?Q?Benn=C3=A9e?= on Tue, 11 May 2021 13:54:02 +0100) 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:206240 Archived-At: > From: Alex Bennée > Date: Tue, 11 May 2021 13:54:02 +0100 > Cc: 48337@debbugs.gnu.org, Alan Mackenzie > > (gdb) pp Vminibuffer_list > (# #) Thanks. Alan, the code in nth_minibuffer and its callers is unsafe. First, Fnthcdr can return nil, and then XCAR of that in nth_minibuffer crashes. I fixed that now on the master branch, but there're more problems: some the callers of nth_minibuffer don't seem to be protected from it returning nil. For example, we have this in read_minibuf_unwind: Fset_buffer (nth_minibuffer (minibuf_level)); and this in minibuffer_unwind: set_window_buffer (window, nth_minibuffer (0), 0, 0); In other cases you compare windows with nil, which can never be true, so a preliminary test for nil would be nice to avoid a loop that can never find anything useful. Please make this code more robust. Thanks.