syncthing-gtk icon indicating copy to clipboard operation
syncthing-gtk copied to clipboard

Segfault on startup in Kubuntu 17.04

Open danyill opened this issue 7 years ago • 10 comments

On opening in Ubuntu 17.04 the application never opens and instead segfaults.

This is true using the zesty deb builds and the webupd8 PPA:

syncthing-gtk

(syncthing-gtk:5982): Gtk-WARNING **: Theme parsing error: gtk.css:68:35: The style property GtkButton:child-displacement-x is deprecated and shouldn't be used anymore. It will be removed in a future version

(syncthing-gtk:5982): Gtk-WARNING **: Theme parsing error: gtk.css:69:35: The style property GtkButton:child-displacement-y is deprecated and shouldn't be used anymore. It will be removed in a future version

(syncthing-gtk:5982): Gtk-WARNING **: Theme parsing error: gtk.css:73:46: The style property GtkScrolledWindow:scrollbars-within-bevel is deprecated and shouldn't be used anymore. It will be removed in a future version
Segmentation fault (core dumped)

dmesg indicates:

[ 2288.649269] syncthing-gtk[2643]: segfault at 0 ip           (null) sp 00007fff572e4588 error 14 in python2.7[55862e49e000+324000]
[ 2310.015090] python[3733]: segfault at 0 ip           (null) sp 00007ffff92e0148 error 14 in python2.7[55da63fc0000+324000]
[ 2404.913122] syncthing-gtk[4469]: segfault at 0 ip           (null) sp 00007ffd2369c558 error 14 in python2.7[556036a5c000+324000]
[ 2410.104155] syncthing-gtk[4477]: segfault at 0 ip           (null) sp 00007ffc2b1cc2c8 error 14 in python2.7[55a77ac0e000+324000]
[ 2506.499029] syncthing-gtk[5982]: segfault at 0 ip           (null) sp 00007ffd4754cf68 error 14 in python2.7[558d48059000+324000]

Nothing of particular syslog. I am using Linux Kernel 4.12-rc2. Other than that fairly ordinary Kubuntu system:

~/Downloads$ uname -a
Linux XPS-13-9360 4.12.0-041200rc2-generic #201705212331 SMP Mon May 22 03:32:26 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 17.04
Release:        17.04
Codename:       zesty

danyill avatar May 26 '17 03:05 danyill

I'll try to replicate problem in VM.

kozec avatar May 27 '17 16:05 kozec

So, problem no.1 is that it kinda works on fresh install... Where did you got that kernel from?

kozec avatar May 27 '17 18:05 kozec

Hmmm... Thanks for looking.

I installed the kernel using ukuu without any issues - mainly to make sure I had hardware support (fairly new laptop). It's possible I have fouled up my system somehow. I'll try to replicate when 4.12-rc3 comes out which should be fairly soon.

danyill avatar May 28 '17 19:05 danyill

I don't think it's the kernel. On another machine running (also) Kubuntu 17.04:

someone@gerbra:~/Downloads$ sudo dpkg -i syncthing-gtk_0.9.2.4-1-webupd8-zesty0_all.deb
[sudo] password for someone: 
Selecting previously unselected package syncthing-gtk.
(Reading database ... 501684 files and directories currently installed.)
Preparing to unpack syncthing-gtk_0.9.2.4-1-webupd8-zesty0_all.deb ...
Unpacking syncthing-gtk (0.9.2.4-1~webupd8~zesty0) ...
dpkg: dependency problems prevent configuration of syncthing-gtk:
 syncthing-gtk depends on gir1.2-appindicator3-0.1; however:
  Package gir1.2-appindicator3-0.1 is not installed.
 syncthing-gtk depends on gir1.2-rsvg-2.0; however:
  Package gir1.2-rsvg-2.0 is not installed.
 syncthing-gtk depends on gir1.2-notify-0.7; however:
  Package gir1.2-notify-0.7 is not installed.

dpkg: error processing package syncthing-gtk (--install):
 dependency problems - leaving unconfigured
Processing triggers for desktop-file-utils (0.23-1ubuntu2) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.15-1) ...
Processing triggers for man-db (2.7.6.1-2) ...
Errors were encountered while processing:
 syncthing-gtk

someone@gerbra:~/Downloads$ sudo apt install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  gir1.2-appindicator3-0.1 gir1.2-notify-0.7 gir1.2-rsvg-2.0
The following NEW packages will be installed:
  gir1.2-appindicator3-0.1 gir1.2-notify-0.7 gir1.2-rsvg-2.0
0 upgraded, 3 newly installed, 0 to remove and 56 not upgraded.
1 not fully installed or removed.
Need to get 12.1 kB of archives.
After this operation, 78.8 kB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://nz.archive.ubuntu.com/ubuntu zesty/main amd64 gir1.2-appindicator3-0.1 amd64 12.10.1+17.04.20170215-0ubuntu1 [3,346 B]
Get:2 http://nz.archive.ubuntu.com/ubuntu zesty/main amd64 gir1.2-rsvg-2.0 amd64 2.40.16-2~svn1 [3,644 B]
Get:3 http://nz.archive.ubuntu.com/ubuntu zesty/main amd64 gir1.2-notify-0.7 amd64 0.7.7-1 [5,136 B]
Fetched 12.1 kB in 1s (9,587 B/s)            
Selecting previously unselected package gir1.2-appindicator3-0.1.
(Reading database ... 501915 files and directories currently installed.)
Preparing to unpack .../gir1.2-appindicator3-0.1_12.10.1+17.04.20170215-0ubuntu1_amd64.deb ...
Unpacking gir1.2-appindicator3-0.1 (12.10.1+17.04.20170215-0ubuntu1) ...
Selecting previously unselected package gir1.2-rsvg-2.0:amd64.
Preparing to unpack .../gir1.2-rsvg-2.0_2.40.16-2~svn1_amd64.deb ...
Unpacking gir1.2-rsvg-2.0:amd64 (2.40.16-2~svn1) ...
Selecting previously unselected package gir1.2-notify-0.7:amd64.
Preparing to unpack .../gir1.2-notify-0.7_0.7.7-1_amd64.deb ...
Unpacking gir1.2-notify-0.7:amd64 (0.7.7-1) ...
Setting up gir1.2-notify-0.7:amd64 (0.7.7-1) ...
Setting up gir1.2-rsvg-2.0:amd64 (2.40.16-2~svn1) ...
Setting up gir1.2-appindicator3-0.1 (12.10.1+17.04.20170215-0ubuntu1) ...
Setting up syncthing-gtk (0.9.2.4-1~webupd8~zesty0) ...

someone@gerbra:~/Downloads$ syncthing-gtk
W Configuration Failed to load configuration; Creating new one.
W Configuration Reason: (IOError(2, 'No such file or directory'),)

(syncthing-gtk:9277): Gtk-WARNING **: Theme parsing error: gtk.css:68:35: The style property GtkButton:child-displacement-x is deprecated and shouldn't be used anymore. It will be removed in a future version

(syncthing-gtk:9277): Gtk-WARNING **: Theme parsing error: gtk.css:69:35: The style property GtkButton:child-displacement-y is deprecated and shouldn't be used anymore. It will be removed in a future version

(syncthing-gtk:9277): Gtk-WARNING **: Theme parsing error: gtk.css:73:46: The style property GtkScrolledWindow:scrollbars-within-bevel is deprecated and shouldn't be used anymore. It will be removed in a future version
Segmentation fault (core dumped)

someone@gerbra:~/Downloads$ uname -a
Linux gerbra 4.10.0-20-generic #22-Ubuntu SMP Thu Apr 20 09:22:42 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

someone@gerbra:~/Downloads$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 17.04
Release:        17.04
Codename:       zesty
someone@gerbra:~/Downloads$ 

Note some dependency packaging issues and an earlier (stock) kernel. Maybe an issue specific to Kubuntu?

danyill avatar May 29 '17 09:05 danyill

(also) Kubuntu 17.04:

Wait, you wrote Ubuntu in issue title :D

Yeah, having half of OS replaced by KDE is that kind of change what can cause crashes, especially because GTK is able to crash just from broken theme.

I'll try to grab Kubuntu VM for a change and check if I can do anything with that.

kozec avatar May 29 '17 18:05 kozec

Sorry @kozec, my bad. Very unrighteous of me to miss this important detail.

danyill avatar May 30 '17 06:05 danyill

I have traced this bug to statusicon.py(429) which reads:

self._tray.activateRequested.connect(self._on_click)

A quick workaround is to comment that line out. Full path is /usr/lib/python2.7/dist-packages/syncthing_gtk/statusicon.py when installed from the PPA.

This bug is obviously GTK's (something about the way it handles tray icons on KDE?) but it would be nice if we had a (better) workaround here. I'll try to look into it when I have more time.

Ubuntu 16.10 running KDE (do we call it Kubuntu?)

aib avatar Jun 28 '17 09:06 aib

Yes, that's Kubuntu. Thanks for looking into this, I confirm that commenting this line out fixes the segfault.

Perhaps this problem is a compatibility between the Python bindings for KDE4 used in KDE5/Plasma (see the class definition).

Also it seems like the equivalent KDE5 bindings only support Python 3.

danyill avatar Jun 29 '17 01:06 danyill

Perhaps this problem is a compatibility between the Python bindings for KDE4 used in KDE5/Plasma (see the class definition).

Also it seems like the equivalent KDE5 bindings only support Python 3.

In that case, running with SYNCTHING_STATUS_BACKEND=Dummy syncthing-gtk (or AppIndicator, if you actually want to use tray) should prevent crashing. Plus, I can add code that automatically chooses AppIndicator on KDE5.

And before anyone asks, fixing KDE5 backwards incompatibility or porting entire thing to py3 is kinda out of realm of possibilities :D

kozec avatar Jun 29 '17 07:06 kozec

I can confirm that using either status backend (Dummy or AppIndicator) solves the problem. AppIndicator gets us a nice icon on the tray.

Thanks! And I think you should go forward with

I can add code that automatically chooses AppIndicator on KDE5.

aib avatar Jun 29 '17 08:06 aib