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

From: martin rudalics <[email-masked]>
Date: Tue, 23 Mar 2021 16:23:43 +0100

>>    break buffer.c:1840 if redisplaying_p != 0 && b->window_count > 0
 >
 > This triggered today.

Could you try running Emacs inserting before the last two lines of
`switch-to-prev-buffer'

     ;; Return new-buffer.
     new-buffer))

a check so this stretch appears as

     (when (and (eq bury-or-kill 'kill) (eq new-buffer old-buffer))
       (error "Could not replace buffer %s in window %s"
              old-buffer window))

     ;; Return new-buffer.
     new-buffer))

If `replace-buffer-in-windows' is the culprit, this should trigger the
bug sooner.

Thanks, martin