Subject: Re: bug#47244: 28.0.50; SIGSEGV in long-runnning Emacs

From: Michael Welsh Duggan <[email-masked]>
Date: Mon, 29 Mar 2021 12:23:57 -0400

Eli Zaretskii <[email-masked]> writes:

>> From: Michael Welsh Duggan <[email-masked]>
>> Cc: "[email-masked]" <[email-masked]>,
>>         "[email-masked]"
>>  <[email-masked]>,
>>         "[email-masked]" <[email-masked]>
>> Date: Mon, 29 Mar 2021 11:33:02 -0400
>> 
>> >> `g` calls the following function:
>> >> 
>> >>     (defun gnus-server-exit ()
>> >>       "Return to the group buffer."
>> >>       (interactive nil gnus-server-mode)
>> >>       (gnus-run-hooks 'gnus-server-exit-hook)
>> >>       (gnus-kill-buffer (current-buffer))
>> >
>> > What is current-buffer at this point?
>> 
>> #<buffer *Server*>
>
> I guess this means kill-buffer replaced "*Server*" with " *nntpd*",
> but the selected-window's buffer is still "*Server*", which is being
> killed?

Eli Zaretskii <[email-masked]> writes:

>> From: Michael Welsh Duggan <[email-masked]>
>> Cc: "[email-masked]" <[email-masked]>,
>>         "[email-masked]"
>>  <[email-masked]>,
>>         "[email-masked]" <[email-masked]>
>> Date: Mon, 29 Mar 2021 11:33:02 -0400
>> 
>> >> `g` calls the following function:
>> >> 
>> >>     (defun gnus-server-exit ()
>> >>       "Return to the group buffer."
>> >>       (interactive nil gnus-server-mode)
>> >>       (gnus-run-hooks 'gnus-server-exit-hook)
>> >>       (gnus-kill-buffer (current-buffer))
>> >
>> > What is current-buffer at this point?
>> 
>> #<buffer *Server*>
>
> I guess this means kill-buffer replaced "*Server*" with " *nntpd*",
> but the selected-window's buffer is still "*Server*", which is being
> killed?

No idea.  Here's the few places I can see things going wrong, though I
don't know how or why.

kill-buffer calls `replace-buffer-in-windows`, which does a lot of stuff
that I can't account for one way or another.

Hmm...  Maybe the `(gnus-configure-windows 'group t)` call is important.
Tracing through it, it's trying to set it to the `group` setting, which
is:

    (group
      (vertical 1.0
                (group 1.0 point)))

This is from `gnus-buffer-configuration`.  When I debug
`gnus-all-windows-visible-p` from this `gnus-configure-windows` in a
session that does *not* hit the breakpoint, this function does return
a frame that has the ` *nntpd*` name in its print representation.

But frankly, I'll stick with my original "no idea" statement.

-- 
Michael Welsh Duggan
([email-masked])