bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#62845: 29.0.90; nntp-with-open-group-function kills current buffer o


From: Eric Abrahamsen
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
User-agent: Gnus/5.13 (Gnus v5.13)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]