jonls / redshift

Redshift adjusts the color temperature of your screen according to your surroundings. This may help your eyes hurt less if you are working in front of the screen at night.
http://jonls.dk/redshift
GNU General Public License v3.0
5.9k stars 428 forks source link

redshift-gtk sometimes segfaults on startup #453

Closed jayhendren closed 7 years ago

jayhendren commented 7 years ago

I'm running redshift-gtk via a systemd user service I'm using a config file to store my coordinates instead of connecting to location services. Sometimes, when I log in, redshift-gtk will start and immediately segfault:

Mar 23 22:26:23 birdhouse systemd[1156]: Started Redshift display colour temperature adjustment (GUI).
Mar 23 22:26:24 birdhouse redshift-gtk[1218]: Unable to init server: Could not connect: Connection refused
Mar 23 22:26:24 birdhouse redshift-gtk[1218]: Unable to init server: Could not connect: Connection refused
Mar 23 22:26:24 birdhouse systemd[1156]: redshift-gtk.service: Main process exited, code=dumped, status=11/SEGV
Mar 23 22:26:24 birdhouse systemd[1156]: redshift-gtk.service: Unit entered failed state.
Mar 23 22:26:24 birdhouse systemd[1156]: redshift-gtk.service: Failed with result 'core-dump'.
Mar 23 22:26:24 birdhouse systemd-coredump[1249]: Process 1218 (redshift-gtk) of user 1000 dumped core.

                                                  Stack trace of thread 1218:
                                                  #0  0x00007fd486892db9 n/a (libgtk-3.so.0)
                                                  #1  0x00007fd48672ea28 n/a (libgtk-3.so.0)
                                                  #2  0x00007fd486743b24 n/a (libgtk-3.so.0)
                                                  #3  0x00007fd48672fd5c n/a (libgtk-3.so.0)
                                                  #4  0x00007fd486743a4c n/a (libgtk-3.so.0)
                                                  #5  0x00007fd486743aa5 n/a (libgtk-3.so.0)
                                                  #6  0x00007fd4867306c2 n/a (libgtk-3.so.0)
                                                  #7  0x00007fd48ee4e30f g_type_create_instance (libgobject-2.0.so.0)
                                                  #8  0x00007fd48ee301fb n/a (libgobject-2.0.so.0)
                                                  #9  0x00007fd48ee31c0d g_object_newv (libgobject-2.0.so.0)
                                                  #10 0x00007fd48ee323c4 g_object_new (libgobject-2.0.so.0)
                                                  #11 0x00007fd48674bf8a n/a (libgtk-3.so.0)
                                                  #12 0x00007fd486929e77 n/a (libgtk-3.so.0)
                                                  #13 0x00007fd48ee4e30f g_type_create_instance (libgobject-2.0.so.0)
                                                  #14 0x00007fd48ee301fb n/a (libgobject-2.0.so.0)
                                                  #15 0x00007fd48ee31c0d g_object_newv (libgobject-2.0.so.0)
                                                  #16 0x00007fd48f2b491c n/a (_gi.cpython-36m-x86_64-linux-gnu.so)
                                                  #17 0x00007fd48f2bb8c1 n/a (_gi.cpython-36m-x86_64-linux-gnu.so)
                                                  #18 0x00007fd4907205ee n/a (libpython3.6m.so.1.0)
                                                  #19 0x00007fd49072884c _PyObject_FastCallDict (libpython3.6m.so.1.0)
                                                  #20 0x00007fd4906d3b86 n/a (libpython3.6m.so.1.0)
                                                  #21 0x00007fd49068fd77 _PyEval_EvalFrameDefault (libpython3.6m.so.1.0)
                                                  #22 0x00007fd4906d2f9a _PyFunction_FastCallDict (libpython3.6m.so.1.0)
                                                  #23 0x00007fd490728a4e _PyObject_FastCallDict (libpython3.6m.so.1.0)
                                                  #24 0x00007fd490729852 _PyObject_Call_Prepend (libpython3.6m.so.1.0)
                                                  #25 0x00007fd49072991b PyObject_Call (libpython3.6m.so.1.0)
                                                  #26 0x00007fd4906bc790 n/a (libpython3.6m.so.1.0)
                                                  #27 0x00007fd4907205ee n/a (libpython3.6m.so.1.0)
                                                  #28 0x00007fd49072884c _PyObject_FastCallDict (libpython3.6m.so.1.0)
                                                  #29 0x00007fd4906d3b86 n/a (libpython3.6m.so.1.0)
                                                  #30 0x00007fd49068fd77 _PyEval_EvalFrameDefault (libpython3.6m.so.1.0)
                                                  #31 0x00007fd4906d2629 n/a (libpython3.6m.so.1.0)
                                                  #32 0x00007fd4906d378a n/a (libpython3.6m.so.1.0)
                                                  #33 0x00007fd4906d3af3 n/a (libpython3.6m.so.1.0)
                                                  #34 0x00007fd49068fd77 _PyEval_EvalFrameDefault (libpython3.6m.so.1.0)
                                                  #35 0x00007fd4906d3f47 PyEval_EvalCodeEx (libpython3.6m.so.1.0)
                                                  #36 0x00007fd49068fa5b PyEval_EvalCode (libpython3.6m.so.1.0)
                                                  #37 0x00007fd490758dc2 n/a (libpython3.6m.so.1.0)
                                                  #38 0x00007fd49075b62d PyRun_FileExFlags (libpython3.6m.so.1.0)
                                                  #39 0x00007fd49075b817 PyRun_SimpleFileExFlags (libpython3.6m.so.1.0)
                                                  #40 0x00007fd4907506f1 Py_Main (libpython3.6m.so.1.0)
                                                  #41 0x0000000000400a5d main (python3.6)
                                                  #42 0x00007fd490aeb511 __libc_start_main (libc.so.6)
                                                  #43 0x0000000000400b9a _start (python3.6)

                                                  Stack trace of thread 1245:
                                                  #0  0x00007fd490bad67d poll (libc.so.6)
                                                  #1  0x00007fd48eb527a6 n/a (libglib-2.0.so.0)
                                                  #2  0x00007fd48eb528bc g_main_context_iteration (libglib-2.0.so.0)
                                                  #3  0x00007fd48eb52901 n/a (libglib-2.0.so.0)
                                                  #4  0x00007fd48eb7a175 n/a (libglib-2.0.so.0)
                                                  #5  0x00007fd490e762e7 start_thread (libpthread.so.0)
                                                  #6  0x00007fd490bb754f __clone (libc.so.6)
Mar 23 22:26:24 birdhouse systemd[1156]: redshift-gtk.service: Service hold-off time over, scheduling restart.
Mar 23 22:26:24 birdhouse systemd[1156]: Stopped Redshift display colour temperature adjustment (GUI).
Mar 23 22:26:24 birdhouse systemd[1156]: redshift-gtk.service: Start request repeated too quickly.
Mar 23 22:26:24 birdhouse systemd[1156]: Failed to start Redshift display colour temperature adjustment (GUI).
Mar 23 22:26:24 birdhouse systemd[1156]: redshift-gtk.service: Unit entered failed state.
Mar 23 22:26:24 birdhouse systemd[1156]: redshift-gtk.service: Failed with result 'core-dump'.

This issue occurs on maybe 20% of logins, and I haven't been able to trigger this issue when manually running systemctl --user start redshift-gtk after I log in, so perhaps this is a timing bug?

Redshift version:

┌─[jay@birdhouse] - [~] - [2017-03-23 10:35:40]
└─[0] <> pacman -Qi redshift
Name            : redshift
Version         : 1.11-4
Description     : Adjusts the color temperature of your screen according to your surroundings.
Architecture    : x86_64
URL             : http://jonls.dk/redshift/
Licenses        : GPL3
Groups          : None
Provides        : None
Depends On      : geoclue2  libdrm  libxcb  libxxf86vm
Optional Deps   : python-gobject: for redshift-gtk [installed]
                  python-xdg: for redshift-gtk [installed]
                  librsvg: for redshift-gtk [installed]
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 690.00 KiB
Packager        : Felix Yan <felixonmars@archlinux.org>
Build Date      : Sun 25 Dec 2016 09:29:37 AM MST
Install Date    : Mon 16 Jan 2017 05:43:32 PM MST
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature
jayhendren commented 7 years ago

Here is the core dump. Sorry I had to compress the .lz4 archive into a .zip archive; GitHub wouldn't allow me to attach an .lz4 archive.

core.redshift-gtk.lz4.zip

imrehg commented 7 years ago

It seems I hit the same thing (the stack trace is the same). On first login redshift-gtk starts fine, if log out and log back in, reliably does not start up at all. Usign ArchLinux + XFCE4.

jonls commented 7 years ago

This seems to be a segfault that is triggered inside of libgtk-3.so.0. I don't think there is anything we can do about this from Redshift. I think this would probably be more useful to the GTK developers who may be able to provide a fix. I'm closing this issue for now.

joostrijneveld commented 7 years ago

Was there a follow-up issue filed at GTK? I cannot find any, but I may be overlooking it

jayhendren commented 7 years ago

@joostrijneveld Not that I'm aware of.

finex commented 1 year ago

Unfortunately the segfault is still an issue after six years.