all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: schwab@linux-m68k.org, 62845@debbugs.gnu.org
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	[thread overview]
Message-ID: <87354axr54.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <83r0s0nq93.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 01 May 2023 16:19:20 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Eric Abrahamsen <eric@ericabrahamsen.net>
>> Cc: Eli Zaretskii <eliz@gnu.org>,  62845@debbugs.gnu.org
>> Date: Wed, 26 Apr 2023 20:08:53 -0700
>> 
>> Andreas Schwab <schwab@linux-m68k.org> 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 <loop>
    <timer could kill nntp-server-buffer somewhere in here>
    (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





  reply	other threads:[~2023-05-06  0:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-14 21:47 bug#62845: 29.0.90; nntp-with-open-group-function kills current buffer on timeout Andreas Schwab
2023-04-15  6:45 ` Eli Zaretskii
2023-04-26 23:49   ` Andreas Schwab
2023-04-27  3:08     ` Eric Abrahamsen
2023-05-01 13:19       ` Eli Zaretskii
2023-05-06  0:03         ` Eric Abrahamsen [this message]
2023-05-06  3:35           ` Eric Abrahamsen
2023-05-06  5:41             ` Eric Abrahamsen
2023-05-06  6:13               ` Andreas Schwab
2023-05-06 16:58                 ` Eric Abrahamsen
2023-05-06 17:43                   ` Andreas Schwab
2023-05-07  5:52                     ` Eric Abrahamsen
2023-05-07  7:30                       ` Andreas Schwab
2023-05-10 15:53                       ` Eli Zaretskii
2023-05-10 18:21                         ` Eric Abrahamsen
2023-05-11 10:01                           ` Eli Zaretskii
2023-05-11 15:28                             ` Eric Abrahamsen
2023-05-06  6:31           ` Eli Zaretskii
2023-05-06 17:05             ` Eric Abrahamsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87354axr54.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=62845@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=schwab@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.