From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#62845: 29.0.90; nntp-with-open-group-function kills current buffer on timeout Date: Fri, 05 May 2023 17:03:35 -0700 Message-ID: <87354axr54.fsf@ericabrahamsen.net> References: <87a5zauofc.fsf@igel.home> <83pm85ej9b.fsf@gnu.org> <87edo619wx.fsf@igel.home> <87leieqawq.fsf@ericabrahamsen.net> <83r0s0nq93.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38179"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: schwab@linux-m68k.org, 62845@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 06 02:04:16 2023 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 1pv5PM-0009j0-9z for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 May 2023 02:04:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pv5PA-0006i2-0S; Fri, 05 May 2023 20:04:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pv5P8-0006hq-B9 for bug-gnu-emacs@gnu.org; Fri, 05 May 2023 20:04:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pv5P8-0006B4-2o for bug-gnu-emacs@gnu.org; Fri, 05 May 2023 20:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pv5P7-00057Y-UF for bug-gnu-emacs@gnu.org; Fri, 05 May 2023 20:04:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 May 2023 00:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62845 X-GNU-PR-Package: emacs Original-Received: via spool by 62845-submit@debbugs.gnu.org id=B62845.168333143319670 (code B ref 62845); Sat, 06 May 2023 00:04:01 +0000 Original-Received: (at 62845) by debbugs.gnu.org; 6 May 2023 00:03:53 +0000 Original-Received: from localhost ([127.0.0.1]:57802 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pv5Oz-00057B-8S for submit@debbugs.gnu.org; Fri, 05 May 2023 20:03:53 -0400 Original-Received: from mail.ericabrahamsen.net ([52.70.2.18]:35648) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pv5Ot-00056t-Qr for 62845@debbugs.gnu.org; Fri, 05 May 2023 20:03:51 -0400 Original-Received: from localhost (c-71-197-232-41.hsd1.wa.comcast.net [71.197.232.41]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 651A7FA0D6; Sat, 6 May 2023 00:03:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1683331417; bh=jj8YXgx8e1deIsAq99QHrJospjw4lcyGvnLjeXkRGW8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=X34uBf3Kz1vdGkSiufCZxDqVwPAdKHlIWiYneaw2OlEly6o+lwAnEWM4AVWpi4+5E ZpGm7pybLFuf8hXA7uO0pj43NzGoHsAngJux54taGQ81wVd4l/AocigL0i2wb0AAXk YyyFxZmksZ5KdVjkKKZPfK973FSd5DASlEvu0Jmk= In-Reply-To: <83r0s0nq93.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 01 May 2023 16:19:20 +0300") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:261148 Archived-At: Eli Zaretskii writes: >> From: Eric Abrahamsen >> Cc: Eli Zaretskii , 62845@debbugs.gnu.org >> Date: Wed, 26 Apr 2023 20:08:53 -0700 >> >> Andreas Schwab writes: >> >> > commit 032969e8c65 "Don't have nntp-report signal an error" >> >> Ooh, I knew this would end up being me. Give me a couple of days, it >> might not be the weekend before I have time to dig through this. > > Eric, > > Any progress? I'd like to make another pretest of Emacs 29 soon, and > I'm waiting for this fix. TIA. Sorry this has been slow! First of all, thanks very much to Andreas for pinpointing the cause of this. I'd seen this before and looked for the cause a couple of times, but obviously didn't look hard enough. So in `nntp-finish-retrieve-group-infos' we have code that does this (with all the extraneous bits left out): (with-current-buffer nntp-server-buffer (while (nntp-accept-response)) (nnheader-strip-cr)) Where `nntp-accept-response' calls `nntp-report' if it can't find its process, which it can't if `nntp-server-buffer` has been killed in the interim. `nntp-report' used to raise an error in this case, so it didn't matter what happened afterwards. That error would derail the entire process of Gnus checking for news/mail, so I took it out so that other servers could continue doing their work even if this one had lost its connection. But then the current buffer of `with-current-buffer` is gone, which as Andreas notes dumps us in the most-recently-used buffer, which could be anything. The `nnheader-strip-cr' acts on that buffer, and terrible things result. Other code in this library checks if the timer has killed the process buffer in the meantime. There's probably a safe solution in here somewhere, but if you're looking for a reliable regression fix to include in Emacs 29, it's probably best just to revert 032969e8c65. That behavior is annoying, but at least not buggy. WDYT? Eric