From: Benjamin Schwehn <bschwehn@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Po Lu <luangruo@yahoo.com>, 66151@debbugs.gnu.org
Subject: bug#66151: 29.1.50; daemon crashing after X forwarding disconnects
Date: Fri, 22 Sep 2023 16:28:40 +0200 [thread overview]
Message-ID: <CA+CxCG91KQO_X8y9pvkN_pjA-rGMS6viFa+5cezb6XNtU92Lwg@mail.gmail.com> (raw)
In-Reply-To: <83ttrm5ovz.fsf@gnu.org>
Thanks a lot for helping me with this!
> > - emacs running as daemon via systemd user service
> > - running "emacsclient -nc" via ssh -X session
> > - stop X server on client machine or cut network connection between
> > client and server
> > - run emacsclient -nc again
> >
> > Result:
> > emacs window opens for about a second, then the daemon crashes.
>
> Does this happen with any emacsclient command in this situation? What
> if you don't use -c, for example, or use -t instead?
emacsclient -t also causes the crash, with this backtrace (looks the same to me)
emacs_backtrace at /home/ben/install/emacs/emacs/src/sysdep.c:2304
terminate_due_to_signal at /home/ben/install/emacs/emacs/src/emacs.c:458
deliver_process_signal at /home/ben/install/emacs/emacs/src/sysdep.c:1741
(inlined by) deliver_fatal_signal at
/home/ben/install/emacs/emacs/src/sysdep.c:1789
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
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
eval_sub at /home/ben/install/emacs/emacs/src/eval.c:2515
Fprogn at /home/ben/install/emacs/emacs/src/eval.c:436
(inlined by) Flet at /home/ben/install/emacs/emacs/src/eval.c:1026
eval_sub at /home/ben/install/emacs/emacs/src/eval.c:2449
Fprogn at /home/ben/install/emacs/emacs/src/eval.c:436
(inlined by) prog_ignore at /home/ben/install/emacs/emacs/src/eval.c:447
(inlined by) Fwhile at /home/ben/install/emacs/emacs/src/eval.c:1047
eval_sub at /home/ben/install/emacs/emacs/src/eval.c:2449
Fprogn at /home/ben/install/emacs/emacs/src/eval.c:436
(inlined by) Flet at /home/ben/install/emacs/emacs/src/eval.c:1026
eval_sub at /home/ben/install/emacs/emacs/src/eval.c:2449
eval_sub at /home/ben/install/emacs/emacs/src/eval.c:2593
Fprogn at /home/ben/install/emacs/emacs/src/eval.c:436
eval_sub at /home/ben/install/emacs/emacs/src/eval.c:2449
eval_sub at /home/ben/install/emacs/emacs/src/eval.c:2449
eval_sub at /home/ben/install/emacs/emacs/src/eval.c:2593
Fprogn at /home/ben/install/emacs/emacs/src/eval.c:436
(inlined by) funcall_lambda at /home/ben/install/emacs/emacs/src/eval.c:3233
Ffuncall at /home/ben/install/emacs/emacs/src/eval.c:2997
funcall_nil at /home/ben/install/emacs/emacs/src/eval.c:2679
run_hook_with_args at /home/ben/install/emacs/emacs/src/eval.c:2822
Frun_hooks at /home/ben/install/emacs/emacs/src/eval.c:2700 (discriminator 3)
eval_sub at /home/ben/install/emacs/emacs/src/eval.c:2472
Fprogn at /home/ben/install/emacs/emacs/src/eval.c:436
(inlined by) funcall_lambda at /home/ben/install/emacs/emacs/src/eval.c:3233
Ffuncall at /home/ben/install/emacs/emacs/src/eval.c:2997
funcall_nil at /home/ben/install/emacs/emacs/src/eval.c:2679
run_hook_with_args at /home/ben/install/emacs/emacs/src/eval.c:2822
Frun_hooks at /home/ben/install/emacs/emacs/src/eval.c:2700 (discriminator 3)
Ffuncall at /home/ben/install/emacs/emacs/src/eval.c:2997
?? ??:0
funcall_subr at /home/ben/install/emacs/emacs/src/eval.c:3046
exec_byte_code at /home/ben/install/emacs/emacs/src/bytecode.c:809
Ffuncall at /home/ben/install/emacs/emacs/src/eval.c:2997
Ffuncall at /home/ben/install/emacs/emacs/src/eval.c:2997
?? ??:0
Ffuncall at /home/ben/install/emacs/emacs/src/eval.c:2997
safe_free at /home/ben/install/emacs/emacs/src/lisp.h:5373
(inlined by) Fapply at /home/ben/install/emacs/emacs/src/eval.c:2668
> > >> 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?
The crash is triggered when a live frame was connected when the network
connection was cut, but the crash happens only later, the next time I open a
frame. But I am not fully sure I correctly understand the question. Let me try
to explain better the circumstances:
I have emacs running in server mode on a VM. I have a windows machine running an
X server. Both machines are connected via a VPN which somtimes loses connection.
The issues comes after this connection loss. To reproduce I do this:
1. ssh -X into the machine and run emacsclient -nc. Emacs frame opens on the
client (windows) machine.
2. While the frame is open, I disconnect (C-d, C-c in the terminal that has the
ssh -X connection).
3. I reconnect to the server via ssh. At this point, the emacs server process
has not yet crashed.
4. I run emacsclient -nc
5. On the client machine, an emacs frame opens and does some initial draw, then
the server process crashes
If in step 4, I run emacclient -t instead, the server process also crashes. I
can't see an initial draw happening in this case.
If in step 2, I first close the frame, then disconnect, the crash in step 5 does
not happen (neither for -nc nor -t) and opening a frame works fine.
It's not a terrible issue for me, but annoyingly happens every time the VPN
connection is lost (~twice a day) and I have emacs open (~all the time :)).
Thanks, Ben
next prev parent reply other threads:[~2023-09-22 14:28 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-22 10:22 bug#66151: 29.1.50; daemon crashing after X forwarding disconnects Benjamin Schwehn
2023-09-22 12:22 ` Eli Zaretskii
2023-09-22 13:12 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-22 13:16 ` Eli Zaretskii
2023-09-22 14:28 ` Benjamin Schwehn [this message]
2023-09-22 15:07 ` Eli Zaretskii
2023-09-22 16:51 ` Benjamin Schwehn
2023-09-22 23:42 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-09 15:02 ` bug#66151: George P
2024-04-09 15:16 ` bug#66151: 29.1.50; daemon crashing after X forwarding disconnects George P
2024-04-09 17:28 ` George P
2024-04-10 2:02 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-10 15:42 ` George P
2024-04-11 0:50 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-12 2:03 ` George P
2024-04-13 1:51 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-13 7:46 ` George P
2024-04-13 11:45 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-13 17:56 ` George P
2024-04-18 10:40 ` Eli Zaretskii
2024-04-19 9:07 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19 11:15 ` Eli Zaretskii
2024-04-19 12:00 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-27 8:37 ` Eli Zaretskii
2024-05-05 16:25 ` George P
2024-05-06 11:02 ` Eli Zaretskii
2024-05-07 0:49 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-09 20:36 ` George P
2024-05-07 20:26 ` Benjamin Schwehn
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CA+CxCG91KQO_X8y9pvkN_pjA-rGMS6viFa+5cezb6XNtU92Lwg@mail.gmail.com \
--to=bschwehn@gmail.com \
--cc=66151@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=luangruo@yahoo.com \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).