You are not logged in.

#1 2016-07-27 04:09:44

ender4
Member
Registered: 2011-01-11
Posts: 16

emacs daemon as systemd crashes and shutdown fails

I have a user unit in systemd for emacs:

[Unit]
Description=Emacs: the extensible, self-documenting text editor

[Service]
Type=forking
ExecStart=/usr/bin/emacs --daemon
ExecStop=/usr/bin/emacsclient --eval "(kill-emacs)"
Restart=always

[Install]
WantedBy=default.target


When I try to shutdown from KDE, emacs crashes with a core dump, and the shutdown fails, instead just logging me out. This happens most of the time but not all of the time.

This is the stack trace from journalctl:

Jul 26 00:00:47 tardis systemd-coredump[4563]: Process 559 (emacs) of user 1000 dumped core.
                                               
                                               Stack trace of thread 559:
                                               #0  0x00007f074ef32dd9 raise (libpthread.so.0)
                                               #1  0x00000000004e7ae6 n/a (emacs-24.5)
                                               #2  0x00000000005014f3 n/a (emacs-24.5)
                                               #3  0x00000000004bc23f n/a (emacs-24.5)
                                               #4  0x00000000004bc2fd n/a (emacs-24.5)
                                               #5  0x00007f075221691e _XIOError (libX11.so.6)
                                               #6  0x00007f075221425d _XEventsQueued (libX11.so.6)
                                               #7  0x00007f0752205b87 XPending (libX11.so.6)
                                               #8  0x00007f0753a377ae n/a (libgdk-3.so.0)
                                               #9  0x00007f075298b50d g_main_context_prepare (libglib-2.0.so.0)
                                               #10 0x00007f075298befb n/a (libglib-2.0.so.0)
                                               #11 0x00007f075298c097 g_main_context_pending (libglib-2.0.so.0)
                                               #12 0x00007f0753ed2acd gtk_events_pending (libgtk-3.so.0)
                                               #13 0x00000000004bc377 n/a (emacs-24.5)
                                               #14 0x00000000004ee949 n/a (emacs-24.5)
                                               #15 0x00000000004effa5 n/a (emacs-24.5)
                                               #16 0x00000000005405ea n/a (emacs-24.5)
                                               #17 0x00000000005609d5 n/a (emacs-24.5)
                                               #18 0x0000000000561030 n/a (emacs-24.5)
                                               #19 0x00000000004ed5a2 n/a (emacs-24.5)
                                               #20 0x00000000004edae1 n/a (emacs-24.5)
                                               #21 0x00000000004eea68 n/a (emacs-24.5)
                                               #22 0x00000000004f1d08 n/a (emacs-24.5)
                                               #23 0x000000000059a19b n/a (emacs-24.5)
                                               #24 0x00000000004ef3b1 n/a (emacs-24.5)
                                               #25 0x00000000004f2dcf n/a (emacs-24.5)
                                               #26 0x00000000004f3e1b n/a (emacs-24.5)
                                               #27 0x00000000004f5b10 n/a (emacs-24.5)
                                               #28 0x0000000000558ed7 n/a (emacs-24.5)
                                               #29 0x00000000004e7e8e n/a (emacs-24.5)
                                               #30 0x0000000000558dbb n/a (emacs-24.5)
                                               #31 0x00000000004ec4e7 n/a (emacs-24.5)
                                               #32 0x00000000004ec828 n/a (emacs-24.5)
                                               #33 0x0000000000417931 n/a (emacs-24.5)
                                               #34 0x00007f074eb9a741 __libc_start_main (libc.so.6)
                                               #35 0x0000000000418479 n/a (emacs-24.5)
                                               
                                               Stack trace of thread 2581:
                                               #0  0x00007f074ef2f0af pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0)
                                               #1  0x00007f073f996403 n/a (radeonsi_dri.so)
                                               #2  0x00007f073f995b47 n/a (radeonsi_dri.so)
                                               #3  0x00007f074ef29484 start_thread (libpthread.so.0)
                                               #4  0x00007f074ec616dd __clone (libc.so.6)
                                              Stack trace of thread 2593:
                                               #0  0x00007f074ec586cd poll (libc.so.6)
                                               #1  0x00007f075298bfd6 n/a (libglib-2.0.so.0)
                                               #2  0x00007f075298c362 g_main_loop_run (libglib-2.0.so.0)
                                               #3  0x00007f0752f8e726 n/a (libgio-2.0.so.0)
                                               #4  0x00007f07529b22b5 n/a (libglib-2.0.so.0)
                                               #5  0x00007f074ef29484 start_thread (libpthread.so.0)
                                               #6  0x00007f074ec616dd __clone (libc.so.6)
                                               
                                               Stack trace of thread 2626:
                                               #0  0x00007f074ec586cd poll (libc.so.6)
                                               #1  0x00007f075298bfd6 n/a (libglib-2.0.so.0)
                                               #2  0x00007f075298c0ec g_main_context_iteration (libglib-2.0.so.0)
                                               #3  0x00007f073a10943d n/a (libdconfsettings.so)
                                               #4  0x00007f07529b22b5 n/a (libglib-2.0.so.0)
                                               #5  0x00007f074ef29484 start_thread (libpthread.so.0)
                                               #6  0x00007f074ec616dd __clone (libc.so.6)
                                               
                                               Stack trace of thread 560:
                                               #0  0x00007f074ec586cd poll (libc.so.6)
                                               #1  0x00007f075298bfd6 n/a (libglib-2.0.so.0)
                                               #2  0x00007f075298c0ec g_main_context_iteration (libglib-2.0.so.0)
                                               #3  0x00007f075298c131 n/a (libglib-2.0.so.0)
                                               #4  0x00007f07529b22b5 n/a (libglib-2.0.so.0)
                                               #5  0x00007f074ef29484 start_thread (libpthread.so.0)
                                               #6  0x00007f074ec616dd __clone (libc.so.6)

I think it has something to do with https://bugzilla.gnome.org/show_bug.cgi?id=85715

How can I make sure the emacs daemon is stopped before X stops?

Offline

#2 2016-07-27 04:13:33

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: emacs daemon as systemd crashes and shutdown fails

Please use code tags when pasting to the boards: https://wiki.archlinux.org/index.php/Co … s_and_code


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2016-07-29 04:55:00

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: emacs daemon as systemd crashes and shutdown fails

Is using an emacs configured with --x-toolkit=lucid an option for you?

Offline

Board footer

Powered by FluxBB