From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Welsh Duggan Newsgroups: gmane.emacs.bugs Subject: bug#47244: 28.0.50; SIGSEGV in long-runnning Emacs Date: Tue, 06 Apr 2021 10:40:56 -0400 Message-ID: References: <87im5ofp3z.fsf@md5i.com> <834kgrifrt.fsf@gnu.org> <106ce987-1a45-bbdf-3897-445baa99a476@gmx.at> <745cb501-d742-8797-d07c-00125f60f8ec@gmx.at> <7a37c708-0ac1-3b06-9042-b4b2b6d6c5d6@gmx.at> <87v990r41n.fsf@md5i.com> <4ad20b14-f4a5-07c0-3f86-698d0934d5af@gmx.at> <58c0bfca-02e6-760f-dcff-05fdc4cca135@gmx.at> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37769"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Michael Welsh Duggan , "schwab@linux-m68k.org" , "47244@debbugs.gnu.org" <47244@debbugs.gnu.org> To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 06 16:42:22 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 1lTmuG-0009XY-9V for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 06 Apr 2021 16:42:21 +0200 Original-Received: from localhost ([::1]:53264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lTmuF-0001IM-Bk for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 06 Apr 2021 10:42:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45556) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lTmu2-0001GK-OY for bug-gnu-emacs@gnu.org; Tue, 06 Apr 2021 10:42:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58089) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lTmu2-0002Ar-HU for bug-gnu-emacs@gnu.org; Tue, 06 Apr 2021 10:42:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lTmu2-0001Is-EL for bug-gnu-emacs@gnu.org; Tue, 06 Apr 2021 10:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Welsh Duggan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 06 Apr 2021 14:42:02 +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.16177200754939 (code B ref 47244); Tue, 06 Apr 2021 14:42:02 +0000 Original-Received: (at 47244) by debbugs.gnu.org; 6 Apr 2021 14:41:15 +0000 Original-Received: from localhost ([127.0.0.1]:41402 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lTmtG-0001Hb-N1 for submit@debbugs.gnu.org; Tue, 06 Apr 2021 10:41:15 -0400 Original-Received: from taper.sei.cmu.edu ([147.72.252.16]:35000) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lTmtD-0001HJ-43 for 47244@debbugs.gnu.org; Tue, 06 Apr 2021 10:41:13 -0400 Original-Received: from delp.sei.cmu.edu (delp.sei.cmu.edu [10.64.21.31]) by taper.sei.cmu.edu (8.14.7/8.14.7) with ESMTP id 136Ef4Xf005122; Tue, 6 Apr 2021 10:41:04 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 taper.sei.cmu.edu 136Ef4Xf005122 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cert.org; s=yc2bmwvrj62m; t=1617720064; bh=JINFjH7+cEAPQS3qVRYA4oJ2uxLNwS6+DTKDTg11ZyM=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Kn2k0qSm+TeMiqv6LqwJveO/Tkt66I5BpUT3BpFb+hEsoFl2u5W/pkFRKk8PZ9oa3 EhDZiK0cSKKdb4V8J1k5zjGd0qWJpzEDW/Lt+A47FJ/RfYBU70sDKZYCxkgmelTmF2 POGL1F9l+chtrrWosTyNy/l34H+PAhC0IrK0rBcA= Original-Received: from lx-birch.ad.sei.cmu.edu (lx-birch.ad.sei.cmu.edu [10.64.53.120]) by delp.sei.cmu.edu (8.14.7/8.14.7) with ESMTP id 136EewfZ011717; Tue, 6 Apr 2021 10:40:58 -0400 Original-Received: from lx-birch.ad.sei.cmu.edu (localhost [127.0.0.1]) by lx-birch.ad.sei.cmu.edu (8.14.7/8.14.7) with ESMTP id 136EevGh008845; Tue, 6 Apr 2021 10:40:57 -0400 Original-Received: (from mwd@localhost) by lx-birch.ad.sei.cmu.edu (8.14.7/8.14.7) id 136EevP7008841; Tue, 6 Apr 2021 10:40:57 -0400 X-Authentication-Warning: lx-birch.ad.sei.cmu.edu: mwd set sender to mwd@cert.org using -f In-Reply-To: <58c0bfca-02e6-760f-dcff-05fdc4cca135@gmx.at> (martin rudalics's message of "Tue, 6 Apr 2021 04:10:53 -0400") 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:203631 Archived-At: martin rudalics writes: >> Actually, what I did is use xbuffer, which as part of it outputs the >> name_. For example: >> >> (gdb) p w->contents >> $53 = XIL(0x5555578be555) >> (gdb) xbuffer >> $54 = (struct buffer *) 0x5555578be550 >> 0x555557241db0 "build.ninja" >> >> In this case the name_ field is "build.ninja". The definition of >> xbuffer is: > > OK. But please let me reassess what you said earlier: > >> There were three >> frames that we looped over in the FOR_EACH_FRAME() loop. Of these, only >> the first is interesting. In this case window_list_1() in window_loop() >> returned three windows. For each window, in the >> REPLACE_BUFFER_IN_WINDOWS_SAFELY case branch, EQ (w->contents, obj) >> returned false. > > So if one of these three windows on the first frame shows (showed) > "build.ninja" then what do (did) the other two windows show? I was somewhat incorrect. The first frame has two windows: build.ninja and a minibuffer. See below for more. >> As a result, best_window is Qnil at the end, and >> replace-buffer_in_windows_safely_count never gets incremented. For the >> other two frames the return value of window_list_1() was Qnil. > > The latter could be another problem but should not concern us for the > moment - do these frames get killed in the course? The two frames that returned no windows were the invisible daemon frame "F1" and the frame containing the window containing the "*Server*" buffer. >> When window_list_1() gets called with the window that has "*Server*" as >> the buffer, window_list() (as called on line 2866) does not return a >> list that contains that window. I do not know how Vwindow_list (which >> is what is returned by window_list() gets updated. > > Vwindow_list is a cache of the list of all windows and is (re-)built by > window_list when it is nil. It is set to nil (that is, the cache gets > invalidated) whenever a window is deleted or created. What is the value > of Vwindow_list when window_list_1() gets called with the window that > has "*Server*" as the buffer? Here is the state as I've been able to determine from the debugger: Vframe_list contains three entries: "build.ninja", "*Server*", and "F1". This matches reality. "F1" is the invisible frame created by --daemon. Frame "build.ninja" has a selected_window whose contents are the buffer "build.ninja". Frame "*Server*" has a selected_window whose contents are the buffer "*Server*". Frame "F1" has a selected_window whose contents are the buffer "*scratch*". Vwindow_list contains two entries: A window whose contents are "build.ninja", and a window whose contents are " *Minibuf-0*". Importantly, Vwindow_list does not contain the window whose contents are "*Server*". Since the window_list_1() call uses the value of Vwindow_list to create its result, the loop in window_loop() will never compare EQ in the REPLACE_BUFFER_IN_WINDOWS_SAFELY case clause. -- Michael Welsh Duggan (mwd@cert.org)