profanity
profanity copied to clipboard
Crash when xserver stops
I run profanity inside a tmux session. When I restart xserver, profanity crashes. I thought I once saw a related error message in the logs or somewhere else, but I can't find it anymore.
Expected Behavior
I expect profanity to keep running in the tmux session.
Current Behavior
Profanity crashes.
Possible Solution
Steps to Reproduce (for bugs)
- Run tmux in a terminal emulator window of Xorg
- Run profanity in this tmux session
- Restart the xserver
- Resume the tmux session with
tmux a
. Observe that profanity has crashed.
Context
I just want profanity to persist. It's annoying to restart it every time after I restart xserver.
Environment
$ profanity -v
Profanity, version 0.9.5
Copyright (C) 2012 - 2019 James Booth <[email protected]>.
Copyright (C) 2019 - 2020 Michael Vetter <[email protected]>.
License GPLv3+: GNU GPL version 3 or later <https://www.gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Build information:
XMPP library: libstrophe
Desktop notification support: Enabled
OTR support: Enabled (libotr 4.1.1)
PGP support: Enabled (libgpgme 1.14.0-unknown)
OMEMO support: Enabled
C plugins: Enabled
Python plugins: Enabled (3.8.5)
GTK icons: Enabled
Debian unstable (Debian GLIBC 2.31-3)
This probably is due to the enabled notifications and icon. It probably registers this somewhere and suddenly there is nothing.
Maybe we can catch this, maybe you just need to disable it when building.
As you are running debian you could also try profanity-light which doesn't have notifications and tray icon.
@AdrianVollmer can you attach a stack trace?
So the last couple of entries in profanity.log
are like this:
14/10/2020 09:30:30: stderr: ERR: (profanity:2063091): GLib-CRITICAL **: 09:30:27.476: g_hash_table_lookup: assertion 'hash_table != NULL' failed
Not sure if that's related.
Do you mean the output of strace
? Doesn't look all that interesting to me... this is the end of it:
gettimeofday({tv_sec=1602660637, tv_usec=683802}, NULL) = 0
poll([{fd=0, events=POLLIN}], 1, 0) = 0 (Timeout)
poll([{fd=0, events=POLLIN}], 1, 0) = 0 (Timeout)
recvmsg(10, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="", iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 0
ioctl(2, TCGETS, 0x7ffcf6b40410) = -1 ENOTTY (Inappropriate ioctl for device)
gettimeofday({tv_sec=1602660637, tv_usec=684226}, NULL) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2326, ...}) = 0
write(2, "Gdk-Message: 09:30:37.684: profa"..., 104) = 104
exit_group(1) = ?
+++ exited with 1 +++
I run profanity inside a tmux session. When I restart xserver, profanity crashes.
I thought when you run it with gdb it should tell when it stops?
I'd have to compile profanity for this, no? Sorry, I don't have a lot of experience with gdb
I see! No problem! I'll try to look into it :)
Does it also happen with:
/tray off
/notify off
Yes.
Also, I have since figured out how to install debug symbols on Debian, but I can't manage to get a stacktrace:
(gdb) b exit
Breakpoint 1 at 0x7f2773bc8600: file exit.c, line 139.
(gdb) continue
Continuing.
[Inferior 1 (process 716045) exited with code 01]
(gdb) bt
No stack.
A workaround is to unset the environment variable DISPLAY
.
This prevents the connection to the X server in the first place.
E.g. run in bash: DISPLAY= profanity
With breakpoint set on _exit
(rather than exit
) I get this backtrace:
Breakpoint 1, __GI__exit (status=1) at ../sysdeps/unix/sysv/linux/_exit.c:27
27 ../sysdeps/unix/sysv/linux/_exit.c: No such file or directory.
(gdb) bt
#0 __GI__exit (status=1) at ../sysdeps/unix/sysv/linux/_exit.c:27
#1 0x00007ffff627b8cc in () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#2 0x00007ffff60ee523 in _XIOError () at /lib/x86_64-linux-gnu/libX11.so.6
#3 0x00007ffff60f1e05 in _XEventsQueued () at /lib/x86_64-linux-gnu/libX11.so.6
#4 0x00007ffff60de511 in XPending () at /lib/x86_64-linux-gnu/libX11.so.6
#5 0x00007ffff626f079 in () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#6 0x00007ffff6cd2467 in g_main_context_prepare () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#7 0x00007ffff6d25dd3 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#8 0x00007ffff6cd0003 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#9 0x00007ffff739fbf5 in gtk_main_iteration_do () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#10 0x0000555555614cd2 in tray_update () at src/ui/tray.c:179
#11 0x000055555558ce79 in prof_run (log_level=0x555555649edc "WARN", account_name=0x0, config_file=0x0, log_file=0x0, theme_name=0x0) at src/profanity.c:135
#12 0x000055555561e98b in main (argc=1, argv=0x7fffffffe038) at src/main.c:186
tray_update()
is calling gtk_main_iteration_do()
even when tray is disabled.
Probably for cases like that profanity should use XSetIOErrorExitHandler
API to set a custom handler which would be automatically disabling all X-related functionality and /not/ exit. Inspired by discussion about Emacs daemon mode having similar issue: https://gitlab.gnome.org/GNOME/gtk/-/issues/2315 .