Subject: bug#66151: 29.1.50; daemon crashing after X forwarding disconnects

From: Eli Zaretskii <[email-masked]>
Date: Fri, 22 Sep 2023 16:16:48 +0300

> From: Po Lu <[email-masked]>
> Cc: Benjamin Schwehn <[email-masked]>,  [email-masked]
> Date: Fri, 22 Sep 2023 21:12:49 +0800
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> >> deliver_thread_signal.constprop.0 at
> >> /home/ben/install/emacs/emacs/src/sysdep.c:1765
> >> ?? ??:0
> >> make_lisp_ptr at /home/ben/install/emacs/emacs/src/lisp.h:1364
> >>  (inlined by) realize_default_face at
> >> /home/ben/install/emacs/emacs/src/xfaces.c:5802
> >>  (inlined by) realize_basic_faces at
> >> /home/ben/install/emacs/emacs/src/xfaces.c:5736
> >
> > The segfault seems to be caused by the frame's output_data.x being
> > NULL or invalid.  Po Lu, is this caused by stopping the server or
> > cutting the network connection between client and server?  If so, is
> > there any remedy?
> 
> The cause is the network connection being cut.  If a display disconnect
> transpires while Emacs is operating on live frames connected to that
> display, Emacs will crash, as the Xlib error handler deletes such frames
> promptly.  There are no simple solutions or means of circumventing this
> problem.

I think in this case there were no live frames connected to the
display, only the initial (non-GUI) daemon frame.  Benjamin, is that
true?

> > Btw, I don't quite understand this part:
> >
> >> recompute_basic_faces at /home/ben/install/emacs/emacs/src/xfaces.c:682
> >>  (inlined by) recompute_basic_faces at
> >> /home/ben/install/emacs/emacs/src/xfaces.c:677
> >>  (inlined by) free_realized_fontsets at
> >> /home/ben/install/emacs/emacs/src/fontset.c:1345
> >> Fset_fontset_font at /home/ben/install/emacs/emacs/src/fontset.c:1696
> >
> > Why do we need to call set-fontset-font here?  What kind of
> > emacsclient command line causes this?
> 
> I don't know, but the answer to that question might yield some
> information that could concievably be used to avoid the set of
> circumstances which precipitated this particular crash.

Yes, which is why I asked Benjamin to try to provide that information ;-)