From: Visuwesh <visuweshm@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: luangruo@yahoo.com, 56528@debbugs.gnu.org
Subject: bug#56528: 29.0.50; Emacs lucid segfaults when X dies
Date: Wed, 13 Jul 2022 22:50:30 +0530 [thread overview]
Message-ID: <871qup7wv5.fsf@gmail.com> (raw)
In-Reply-To: <83v8s1uecy.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 13 Jul 2022 20:11:41 +0300")
[புதன் ஜூலை 13, 2022] Eli Zaretskii wrote:
>> In the past, when I start Emacs daemon by `emacs --daemon' in my
>> ~/.xsession file and eventually kill X, Emacs will not die. I can still
>> access the Emacs session in the tty or a fresh Xorg session using
>> emacsclient. But I seem to recall M-x server-start RET working
>> identical to --daemon here.
>
> That's probably just sheer luck. When you kill the X server, any code
> in Emacs that tries to display something will crash and burn, because
> there's generally no way for us to display anything in that case.
I don't think so. Lucid toolkit has been the suggested method to
survive X crashes, and so far, it has worked. If it involved more than
sheer luck, then I don't think people would suggest it.
>> > Why not close Emacs before that -- this way you get to keep all your
>> > edits, instead of relying on error handling to succeed in doing that.
>>
>> That's not a solution, sorry. Just saving the buffers is not going to
>> cut it, I would like to have my shell session, other processes stay
>> alive.
>
> Our solution to this is desktop.el. You can customize it to save and
> restore more than it does by default. But expecting Emacs to survive
> the killing of X is unreasonable.
I know about desktop.el and I do use it, but it is not the same.
>> Hmm, trying it with --fg-daemon, sometimes Emacs survives, sometimes it
>> dies. Backtrace follows,
>>
>> (gdb) run -Q --fg-daemon
>> Starting program: /home/viz/lib/ports/emacs/src/emacs -Q --fg-daemon
>> [Switching to thread 1 (process 7339)](running)
>> [Thread debugging using libthread_db enabled]
>> Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
>> [New Thread 0x7ffff15fe640 (LWP 7340)]
>> [New Thread 0x7ffff0c6d640 (LWP 7356)]
>> [New Thread 0x7fffebfff640 (LWP 7357)]
>> [Detaching after vfork from child process 7393]
>>
>> Thread 1 "emacs" received signal SIGSEGV, Segmentation fault.
>> message3_nolog (m=...) at xdisp.c:11770
>> 11770 if (FRAME_TERMINAL (f)->frame_up_to_date_hook)
>> (gdb) bt
>> #0 message3_nolog (m=XIL(0x555556066254)) at xdisp.c:11770
>> #1 0x00005555555f3449 in message3 (m=XIL(0x555556066254)) at xdisp.c:11698
>> #2 0x0000555555848e28 in Fmessage (nargs=2, args=0x7ffff15ff250) at editfns.c:2881
>
> Here's an excellent example of what I was trying to say: this says
> that Emacs tried to show some message, and crashed because that
> requires a valid frame with a terminal connection. What do you expect
> Emacs to do here?
Ignore it? Or write it to stdout? One can see the message in
*Messages* anyway. I killed X the same way I did here last month and
Emacs coped just fine; the same way being M-! pkill X RET.
> I think we should close this bug as wontfix. It's unreasonable to
> expect a GUI program to stay in the air when its GUI infrastructure is
> forcibly killed.
Please reconsider. I will finally quote etc/PROBLEMS here,
** When Emacs is compiled with Gtk+, closing a display kills Emacs.
There is a long-standing bug in GTK that prevents it from recovering
from disconnects: https://gitlab.gnome.org/GNOME/gtk/issues/221
Thus, for instance, when Emacs is run as a server on a text terminal,
and an X frame is created, and the X server for that frame crashes or
exits unexpectedly, Emacs must exit to prevent a GTK error that would
result in an endless loop.
If you need Emacs to be able to recover from closing displays, compile
it with the Lucid toolkit instead of GTK.
next prev parent reply other threads:[~2022-07-13 17:20 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-13 4:32 bug#56528: 29.0.50; Emacs lucid segfaults when X dies visuweshm
2022-07-13 10:45 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-13 11:05 ` Visuwesh
2022-07-13 12:17 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-13 13:06 ` Visuwesh
2022-07-13 13:13 ` Eli Zaretskii
2022-07-13 13:15 ` Eli Zaretskii
2022-07-13 13:23 ` Visuwesh
2022-07-13 13:49 ` Eli Zaretskii
2022-07-13 14:18 ` Visuwesh
2022-07-13 17:11 ` Eli Zaretskii
2022-07-13 17:18 ` Eli Zaretskii
2022-07-13 17:29 ` Visuwesh
2022-07-13 17:54 ` Eli Zaretskii
2022-07-13 17:20 ` Visuwesh [this message]
2022-07-13 17:50 ` Eli Zaretskii
2022-07-14 1:06 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-14 5:41 ` Eli Zaretskii
2022-07-14 6:27 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-14 7:18 ` Eli Zaretskii
2022-07-14 1:04 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-14 5:39 ` Eli Zaretskii
2022-07-14 6:26 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-14 7:18 ` Eli Zaretskii
2022-07-14 7:21 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-15 16:17 ` Andrés Ramírez
2022-07-16 3:17 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-14 0:39 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-14 5:36 ` Eli Zaretskii
2022-07-14 6:24 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-14 3:47 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-14 4:24 ` Visuwesh
2022-07-14 4:52 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-14 5:37 ` Visuwesh
2022-07-14 6:25 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871qup7wv5.fsf@gmail.com \
--to=visuweshm@gmail.com \
--cc=56528@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.