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#47244: 28.0.50; SIGSEGV in long-runnning Emacs Date: Tue, 30 Mar 2021 18:13:29 +0300 Message-ID: <83ft0ck73a.fsf@gnu.org> References: <87im5ofp3z.fsf@md5i.com> <83czvvdw7o.fsf@gnu.org> <14e14f28-7ece-cd98-5e49-d4583a0153a0@gmx.at> <16b279ef-a1c2-cd41-b18c-69383174c72a@gmx.at> <87a6qs7z60.fsf@md5i.com> <83eeg3kawg.fsf@gnu.org> <83y2e6kp9t.fsf@gnu.org> <83tuouknpb.fsf@gnu.org> <83sg4eknh5.fsf@gnu.org> <83r1jykmt0.fsf@gnu.org> <2d0dbdc8-3678-cd21-234a-9c63bb004629@gmx.at> <83h7ksk89q.fsf@gnu.org> <9f6993e1-642b-75f9-1820-f7521d047943@gmx.at> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36194"; mail-complaints-to="usenet@ciao.gmane.io" Cc: mwd@md5i.com, schwab@linux-m68k.org, 47244@debbugs.gnu.org, mwd@cert.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 30 17:14:15 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 1lRG4N-0009Ic-EB for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 30 Mar 2021 17:14:15 +0200 Original-Received: from localhost ([::1]:54912 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRG4L-0005Rb-W7 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 30 Mar 2021 11:14:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57010) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRG4A-0005RS-1k for bug-gnu-emacs@gnu.org; Tue, 30 Mar 2021 11:14:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41104) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lRG49-0001v8-RE for bug-gnu-emacs@gnu.org; Tue, 30 Mar 2021 11:14:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lRG49-0004iS-Lg for bug-gnu-emacs@gnu.org; Tue, 30 Mar 2021 11:14: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, 30 Mar 2021 15:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47244 X-GNU-PR-Package: emacs Original-Received: via spool by 47244-submit@debbugs.gnu.org id=B47244.161711721418082 (code B ref 47244); Tue, 30 Mar 2021 15:14:01 +0000 Original-Received: (at 47244) by debbugs.gnu.org; 30 Mar 2021 15:13:34 +0000 Original-Received: from localhost ([127.0.0.1]:52650 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lRG3d-0004hW-Pp for submit@debbugs.gnu.org; Tue, 30 Mar 2021 11:13:34 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:35484) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lRG3c-0004hJ-A7 for 47244@debbugs.gnu.org; Tue, 30 Mar 2021 11:13:28 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:39517) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRG3U-0001S3-RI; Tue, 30 Mar 2021 11:13:20 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3806 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lRG3R-0003qu-BT; Tue, 30 Mar 2021 11:13:18 -0400 In-Reply-To: <9f6993e1-642b-75f9-1820-f7521d047943@gmx.at> (message from martin rudalics on Tue, 30 Mar 2021 17:05:14 +0200) 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:203314 Archived-At: > Cc: mwd@cert.org, mwd@md5i.com, schwab@linux-m68k.org, 47244@debbugs.gnu.org > From: martin rudalics > Date: Tue, 30 Mar 2021 17:05:14 +0200 > > > Maybe instead of trying to find the exact culprit, we should simply > > protect this code: > > > > /* Make sure the current window's buffer is selected. */ > > set_buffer_internal (XBUFFER (XWINDOW (selected_window)->contents)); > > > > from selecting a dead buffer? For example, by using > > other_buffer_safely if the selected-window's buffer is dead. > > The problem is that we already detect this situation too late in order > to tell who the real culprit is. For example, a dead buffer stored in > the selected_window's contents field could have been a dead > current_buffer before. So for some time we could have been already > running with a dead buffer in that filed. Long enough maybe to cause > havoc elsewhere. And what happened in between might not have used > set_buffer_internal but accessed that buffer more directly. The above code runs every iteration through the main loop, so fixing it there will go along way towards avoiding the havoc. Or are you saying it could cause harm in some situation?