#977945 redshift-gtk: [Xfce4] Odd autostart behavior and segfault

#977945#5
Date:
2020-12-23 07:56:50 UTC
From:
To:
Hello,
I'm noticing and odd behavior after installing redshift-gtk.  Even though is
not set to autostart from Xfce's settings,  redshift-gtk does autostart
annoyingly after every boot. Killing it (or clicking on exit) will cause
redshift-gtk to close, but it restarts immediately,  like a zombie,  it is
impossible to kill it, unless you delete ~/.config/autostart/redshift-
gtk.desktop,  an then logout and login.

What is also happening is that if you say ok, I'm not closing/killing redshift-
gtk but decide to simply disable it (uncheck activated),  after a few seconds
it will flick (the screen will look warm as if enabled) for a fraction of a
second, or sometimes more, and then it goes to normal again.  After a few
seconds it will flick again,  all in a loop that never ends.
A workaround is to this is to delete ~/.config/autostart/redshift-gtk.desktop,
an then logout and login, as well.

This redshift-gtk.desktop will get recreated after every boot

I noticed this in my dmesg while this flickering happens
[   24.926777] redshift-gtk[775]: segfault at 18 ip 00007f920d3257e0 sp
00007ffe6859d1a8 error 4 in libgtk-3.so.0.2404.20[7f920d0ca000+374000]
[   25.330365] redshift-gtk[810]: segfault at 18 ip 00007f85faadf7e0 sp
00007ffccb3601d8 error 4 in libgtk-3.so.0.2404.20[7f85fa884000+374000]
[   25.603818] redshift-gtk[823]: segfault at 18 ip 00007f0e1bfec7e0 sp
00007fffb8f07a48 error 4 in libgtk-3.so.0.2404.20[7f0e1bd91000+374000]
[   26.009628] redshift-gtk[838]: segfault at 18 ip 00007f4969eb97e0 sp
00007fff5e26b788 error 4 in libgtk-3.so.0.2404.20[7f4969c5e000+374000]
[   26.343454] redshift-gtk[861]: segfault at 18 ip 00007f111fefb7e0 sp
00007ffe7dc04048 error 4 in libgtk-3.so.0.2404.20[7f111fca0000+374000]
[   37.455122] redshift-gtk[913]: segfault at 18 ip 00007f898ea0b7e0 sp
00007fff314bbcc8 error 4 in libgtk-3.so.0.2404.20[7f898e7b0000+374000]
[  207.235367] redshift-gtk[1499]: segfault at 18 ip 00007f7c1bf937e0 sp
00007ffc1c6e1538 error 4 in libgtk-3.so.0.2404.20[7f7c1bd38000+374000]
[  207.628210] redshift-gtk[1565]: segfault at 18 ip 00007eff1bb027e0 sp
00007ffc9f25e268 error 4 in libgtk-3.so.0.2404.20[7eff1b8a7000+374000]
[  207.637113] redshift-gtk[1562]: segfault at 18 ip 00007f57c240a7e0 sp
00007ffee60a75c8 error 4 in libgtk-3.so.0.2404.20[7f57c21af000+374000]
[  208.143993] redshift-gtk[1631]: segfault at 18 ip 00007f493072d7e0 sp
00007fff868cdcb8 error 4 in libgtk-3.so.0.2404.20[7f49304d2000+374000]
[  208.162928] redshift-gtk[1632]: segfault at 18 ip 00007efca8bad7e0 sp
00007fffc70356a8 error 4 in libgtk-3.so.0.2404.20[7efca8952000+374000]
[  208.590207] redshift-gtk[1660]: segfault at 18 ip 00007f475ab127e0 sp
00007ffd79082738 error 4 in libgtk-3.so.0.2404.20[7f475a8b7000+374000]
[  208.595169] redshift-gtk[1661]: segfault at 18 ip 00007f04f44717e0 sp
00007ffdb845fb38 error 4 in libgtk-3.so.0.2404.20[7f04f4216000+374000]
[  208.848298] redshift-gtk[1677]: segfault at 18 ip 00007f535d23e7e0 sp
00007ffe9572f098 error 4 in libgtk-3.so.0.2404.20[7f535cfe3000+374000]
[  209.072648] redshift-gtk[1687]: segfault at 18 ip 00007f3d676057e0 sp
00007fff810e6098 error 4 in libgtk-3.so.0.2404.20[7f3d673aa000+374000]
[  209.335188] redshift-gtk[1694]: segfault at 18 ip 00007f991243c7e0 sp
00007ffd0f1bdf68 error 4 in libgtk-3.so.0.2404.20[7f99121e1000+374000]

Sorry if this bug is related to libgtk-3.0, or any other package.
Or if it is related to 824443@bugs.debian.org.



(I installed Debian testing from the alpha 3 netinstall (minimal installation,
and then xfce4 along some other packages, like redshift-gtk)).
Thank you for reading,  happy holidays.

#977945#10
Date:
2021-03-18 09:00:35 UTC
From:
To:
Dear Maintainer,
I have tried to reproduce these segfaults and received them
when redshift-gtk is installed and lightdm is used as login manager.

It looks like redshift-gtk installs a systemd user unit,
which is executed also for the lightdm login screen.
But it looks like the 'systemd --user' processes for
user lightdm does not receive which DISPLAY and XAUTHORITY
environments it should deliver to the redshift-gtk process.
Therefore redshift fails to connect to the xserver which
leads to the segfault.

So I am not sure if redshift is supposed to run at the login
screen in the first place.

If yes, it looks like "someone" has to tell the 'systemd --user'
process by something like this:
     systemctl --user import-environment DISPLAY XAUTHORITY

Unfortunately I did not find any obvious place for that,
or how it is delivered for a regular logged in
'systemd --user' process.

Kind regards,
Bernhard



[    6.829265] redshift-gtk[692]: segfault at 18 ip 00007fc62e9db690 sp 00007ffdaacafbc8 error 4 in libgtk-3.so.0.2404.20[7fc62e780000+374000]
[    6.829275] Code: da ff 48 8b 44 24 08 64 48 2b 04 25 28 00 00 00 75 0f 48 83 c4 18 5b 5d 41 5c 41 5d 41 5e 41 5f c3 e8 54 96 da ff 0f 1f 40 00 <48> 8b 47 18 48 8b 40 10 c3 0f 1f 80 00 00 00 00 53 48 8b 5f 18 48

(gdb) bt
#0  _gtk_settings_get_screen (settings=0x0) at ../../../../gtk/gtksettings.c:3359
#1  0x00007fc62e87c2c4 in gtk_css_value_icon_theme_compute (icon_theme=<optimized out>, property_id=<optimized out>, provider=<optimized out>, style=<optimized out>, parent_style=<optimized out>) at ../../../../gtk/gtkcssiconthemevalue.c:84
#2  0x00007fc62e89dad8 in gtk_css_static_style_compute_value (style=0x213c040, provider=0x0, parent_style=<optimized out>, id=3, specified=0x7fc62eea4e20 <inherit>, section=0x0) at ../../../../gtk/gtkcssstaticstyle.c:237
#3  0x00007fc62e88821a in _gtk_css_lookup_resolve (lookup=lookup@entry=0x213a320, provider=provider@entry=0x0, style=style@entry=0x213c040, parent_style=parent_style@entry=0x0) at ../../../../gtk/gtkcsslookup.c:122
#4  0x00007fc62e89d9a8 in gtk_css_static_style_new_compute (parent=0x0, matcher=0x0, provider=0x0) at ../../../../gtk/gtkcssstaticstyle.c:195
#5  gtk_css_static_style_get_default () at ../../../../gtk/gtkcssstaticstyle.c:164
#6  0x00007fc62e888b62 in gtk_css_node_init (cssnode=0x21352c0) at ../../../../gtk/gtkcssnode.c:667
#7  0x00007fc6306a3357 in g_type_create_instance (type=<optimized out>) at ../../../gobject/gtype.c:1862
...

(gdb) py-bt
Traceback (most recent call first):
   File "/usr/lib/python3/dist-packages/redshift_gtk/statusicon.py", line 326, in __init__

   File "/usr/lib/python3/dist-packages/redshift_gtk/statusicon.py", line 879, in run
   File "/usr/bin/redshift-gtk", line 27, in <module>
     run()


https://github.com/jonls/redshift/issues/265
https://gitlab.gnome.org/GNOME/gtk/-/issues/3310
https://superuser.com/questions/759759/writing-a-service-that-depends-on-xorg

#977945#15
Date:
2023-04-10 16:20:00 UTC
From:
To:
I can't reproduce this anymore, how should I proceed?

I am not sure if it was caused by a bad implementation of start x on
tty, I am currently using the following on my .profile file:

if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then
    exec startxfce4
fi


It was either that or an update.   I believe I was using startx instead
of xfce4, something like:

if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then
   exec startx
fi

Anyhow, seems to be fixed/not a bug per se?