PCMan / gtk3-nocsd

A hack to disable gtk+ 3 client side decoration
GNU Lesser General Public License v2.1
320 stars 41 forks source link

DeaDBeeF MPRIS2 plugin crashes #18

Closed Xylemon closed 8 years ago

Xylemon commented 8 years ago

gtk3-nocsd seems to conflict with a DeaDBeeF plugin that implements MPRIS. It crashes DB with the following error:

(deadbeef:9117): GLib-GObject-WARNING **: cannot register existing type 'GtkBuildable'

(deadbeef:9117): GLib-GObject-CRITICAL **: g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE (interface_type)' failed

(deadbeef:9117): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed

(deadbeef:9117): GLib-GObject-WARNING **: cannot register existing type 'GtkWidget'

(deadbeef:9117): GLib-GObject-WARNING **: cannot add class private field to invalid type '<invalid>'

(deadbeef:9117): GLib-GObject-WARNING **: cannot add private field to invalid (non-instantiatable) type '<invalid>'

You can view the plugin here: https://github.com/Serranya/deadbeef-mpris2-plugin

Doing,

GTK_CSD=1 deadbeef

does result in a successful launch. You get some errors but it still works fine:

(deadbeef:24428): GLib-GObject-WARNING **: cannot register existing type 'GdkScreen'

(deadbeef:24428): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed

(deadbeef:24428): Gdk-CRITICAL **: gdk_screen_is_composited: assertion 'GDK_IS_SCREEN (screen)' failed
chris-se commented 8 years ago

What version of gtk3-nocsd are you using? I've tried to reproduce this myself, and after having installed the latest released deadbeef version, plus installed a build of the latest git master of that plugin. I see no differences in the console output at all, with or without gtk3-nocsd (the latest release, version 3) when starting deadbeef. Now I don't know what that plugin does, or how to use it. Therefore, it would be great to know the precise versions of deadbeef, that plugin, gtk3-nocsd, gtk3 and glib that you are using. Furthermore, it would be helpful if you could give a short introduction how to use the plugin (and the program itself) in such a way that it triggers your problem.

Xylemon commented 8 years ago

@chris-se Sure, I am using latest git of gtk3-nocsd along with the DeaDBeeF 0.7.2 and the DB MPRIS2 plugin is the 1.9 version with glib2 2.48 on Arch Linux 64-bit. The plugin implements the MPRIS2 interface for DeaDBeeF for controlling the player via stuff like KDEConnect and so on, you can read about it here: https://specifications.freedesktop.org/mpris-spec/latest/

I tend to use the plugin in combination with a XFCE4 plugin: https://github.com/matiasdelellis/xfce4-soundmenu-plugin along with KDEConnect, but neither of these affect this not working. DeaDBeeF just simply refuses to start with the MPRIS2 plugin installed. I'm guessing because it loads the gtk3-nocsd lib at some point and has the conflict. That's why passing the environment variable GTK_CSD=1 seems to allow DeaDBeeF and the plugin to start fine. Here's an ldd of the mpris2 plugin to show everything it's reading from:

ldd /usr/lib/deadbeef/mpris.so
    linux-vdso.so.1 (0x00007ffc8b734000)
    /usr/lib/libgtk3-nocsd.so.0 (0x00007fb6f63b6000)
    libgio-2.0.so.0 => /usr/lib/libgio-2.0.so.0 (0x00007fb6f5ffa000)
    libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0x00007fb6f5da8000)
    libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0x00007fb6f5ba5000)
    libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00007fb6f5896000)
    libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007fb6f5679000)
    libc.so.6 => /usr/lib/libc.so.6 (0x00007fb6f52d7000)
    libdl.so.2 => /usr/lib/libdl.so.2 (0x00007fb6f50d3000)
    libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x00007fb6f4ecf000)
    libz.so.1 => /usr/lib/libz.so.1 (0x00007fb6f4cb8000)
    libresolv.so.2 => /usr/lib/libresolv.so.2 (0x00007fb6f4aa1000)
    libffi.so.6 => /usr/lib/libffi.so.6 (0x00007fb6f4898000)
    libpcre.so.1 => /usr/lib/libpcre.so.1 (0x00007fb6f4627000)
    /usr/lib64/ld-linux-x86-64.so.2 (0x000055a0b182a000)
chris-se commented 8 years ago

Sorry, I simply can't reproduce this on Debian sid with DeaDBeeF 0.7.2 and the MPRIS2 plugin version 1.9. (glib 2.48.1, gtk+ 3.20.6, gtk3-nocsd from git master) I see no difference between the case with gtk3-nocsd and the case without... I've been issuing DBus commands via

qdbus org.mpris.MediaPlayer2.DeaDBeeF /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Play
qdbus org.mpris.MediaPlayer2.DeaDBeeF /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause

and they all seem to work...

Does the error also occur if you compile gtk3-nocsd manually (I assume you're using the Arch AUR?) and running the gtk3-nocsd wrapper in that directory? e.g.

git clone httsp://github.com/PCMan/gtk3-nocsd
cd gtk3-nocsd
make
./gtk3-nocsd deadbeef

Could you also check the following?

and post the result of the grep? I'd like to see what's loaded when the program is actually executed.

Xylemon commented 8 years ago

@chris-se OK it seems this issue isn't actually a crash, but stopping DeaDBeeF from loading its GTK UI.

Perhaps I should mention that I'm using the Nouveau drivers atm, I haven't tried reproducing this on the proprietary drivers (just in case it's some odd graphical error).

Also, I am indeed using the AUR package, I proceeded to try it with the latest git manually as you asked above.

So, with gtk3-nocsd active on DeaDBeeF, my MPRIS2 XFCE plugin picks up DB, I can control it via qdbus fine, but just no GUI or notification area icon.

And sometimes when loading DB with GTK_CSD=1, I notice the interface freezes (but DB is still controllable via dbus).

Here is the grep'd library list you asked for, I did one for the freezing GUI scenario as well.

./gtk3-nocsd deadbeef (the one that causes no GUI)

grep -iE 'gtk|gdk|glib|gobject' /proc/5983/maps
7f3f865f0000-7f3f865fc000 r-xp 00000000 08:42 13768111                   /usr/lib/gtk-2.0/2.10.0/engines/libxfce.so
7f3f865fc000-7f3f867fb000 ---p 0000c000 08:42 13768111                   /usr/lib/gtk-2.0/2.10.0/engines/libxfce.so
7f3f867fb000-7f3f867fc000 r--p 0000b000 08:42 13768111                   /usr/lib/gtk-2.0/2.10.0/engines/libxfce.so
7f3f867fc000-7f3f867fd000 rw-p 0000c000 08:42 13768111                   /usr/lib/gtk-2.0/2.10.0/engines/libxfce.so
7f3fa26c2000-7f3fa26c9000 r-xp 00000000 08:42 14554700                   /usr/lib/deadbeef/shellexecui_gtk2.so
7f3fa26c9000-7f3fa28c8000 ---p 00007000 08:42 14554700                   /usr/lib/deadbeef/shellexecui_gtk2.so
7f3fa28c8000-7f3fa28c9000 r--p 00006000 08:42 14554700                   /usr/lib/deadbeef/shellexecui_gtk2.so
7f3fa28c9000-7f3fa28ca000 rw-p 00007000 08:42 14554700                   /usr/lib/deadbeef/shellexecui_gtk2.so
7f3fa3e4f000-7f3fa3e56000 r-xp 00000000 08:42 14554738                   /usr/lib/deadbeef/pltbrowser_gtk2.so
7f3fa3e56000-7f3fa4055000 ---p 00007000 08:42 14554738                   /usr/lib/deadbeef/pltbrowser_gtk2.so
7f3fa4055000-7f3fa4056000 r--p 00006000 08:42 14554738                   /usr/lib/deadbeef/pltbrowser_gtk2.so
7f3fa4056000-7f3fa4057000 rw-p 00007000 08:42 14554738                   /usr/lib/deadbeef/pltbrowser_gtk2.so
7f3fb069b000-7f3fb069f000 r-xp 00000000 08:42 12877475                   /usr/lib/libcanberra-gtk.so.0.1.9
7f3fb069f000-7f3fb089e000 ---p 00004000 08:42 12877475                   /usr/lib/libcanberra-gtk.so.0.1.9
7f3fb089e000-7f3fb089f000 r--p 00003000 08:42 12877475                   /usr/lib/libcanberra-gtk.so.0.1.9
7f3fb089f000-7f3fb08a0000 rw-p 00004000 08:42 12877475                   /usr/lib/libcanberra-gtk.so.0.1.9
7f3fb0bae000-7f3fb0bb9000 r-xp 00000000 08:42 14556711                   /usr/lib/deadbeef/ddb_misc_waveform_GTK2.so
7f3fb0bb9000-7f3fb0db9000 ---p 0000b000 08:42 14556711                   /usr/lib/deadbeef/ddb_misc_waveform_GTK2.so
7f3fb0db9000-7f3fb0dba000 r--p 0000b000 08:42 14556711                   /usr/lib/deadbeef/ddb_misc_waveform_GTK2.so
7f3fb0dba000-7f3fb0dbb000 rw-p 0000c000 08:42 14556711                   /usr/lib/deadbeef/ddb_misc_waveform_GTK2.so
7f3fb1124000-7f3fb112f000 r-xp 00000000 08:42 14556706                   /usr/lib/deadbeef/ddb_infobar_gtk2.so
7f3fb112f000-7f3fb132f000 ---p 0000b000 08:42 14556706                   /usr/lib/deadbeef/ddb_infobar_gtk2.so
7f3fb132f000-7f3fb1330000 r--p 0000b000 08:42 14556706                   /usr/lib/deadbeef/ddb_infobar_gtk2.so
7f3fb1330000-7f3fb1331000 rw-p 0000c000 08:42 14556706                   /usr/lib/deadbeef/ddb_infobar_gtk2.so
7f3fb1592000-7f3fb15a3000 r-xp 00000000 08:42 14556708                   /usr/lib/deadbeef/ddb_customizabletb_gtk2.so
7f3fb15a3000-7f3fb17a2000 ---p 00011000 08:42 14556708                   /usr/lib/deadbeef/ddb_customizabletb_gtk2.so
7f3fb17a2000-7f3fb17a3000 r--p 00010000 08:42 14556708                   /usr/lib/deadbeef/ddb_customizabletb_gtk2.so
7f3fb17a3000-7f3fb17a5000 rw-p 00011000 08:42 14556708                   /usr/lib/deadbeef/ddb_customizabletb_gtk2.so
7f3fb3d51000-7f3fb3d58000 r-xp 00000000 08:42 12872675                   /usr/lib/libcairo-gobject.so.2.11400.6
7f3fb3d58000-7f3fb3f57000 ---p 00007000 08:42 12872675                   /usr/lib/libcairo-gobject.so.2.11400.6
7f3fb3f57000-7f3fb3f59000 r--p 00006000 08:42 12872675                   /usr/lib/libcairo-gobject.so.2.11400.6
7f3fb3f59000-7f3fb3f5a000 rw-p 00008000 08:42 12872675                   /usr/lib/libcairo-gobject.so.2.11400.6
7f3fb3f5a000-7f3fb402a000 r-xp 00000000 08:42 12873482                   /usr/lib/libgdk-3.so.0.2000.6
7f3fb402a000-7f3fb422a000 ---p 000d0000 08:42 12873482                   /usr/lib/libgdk-3.so.0.2000.6
7f3fb422a000-7f3fb422f000 r--p 000d0000 08:42 12873482                   /usr/lib/libgdk-3.so.0.2000.6
7f3fb422f000-7f3fb4232000 rw-p 000d5000 08:42 12873482                   /usr/lib/libgdk-3.so.0.2000.6
7f3fb4232000-7f3fb48fc000 r-xp 00000000 08:42 12873483                   /usr/lib/libgtk-3.so.0.2000.6
7f3fb48fc000-7f3fb4afb000 ---p 006ca000 08:42 12873483                   /usr/lib/libgtk-3.so.0.2000.6
7f3fb4afb000-7f3fb4b06000 r--p 006c9000 08:42 12873483                   /usr/lib/libgtk-3.so.0.2000.6
7f3fb4b06000-7f3fb4b0d000 rw-p 006d4000 08:42 12873483                   /usr/lib/libgtk-3.so.0.2000.6
7f3fb4b1e000-7f3fb4b23000 r-xp 00000000 08:42 13769241                   /usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so
7f3fb4b23000-7f3fb4d22000 ---p 00005000 08:42 13769241                   /usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so
7f3fb4d22000-7f3fb4d23000 r--p 00004000 08:42 13769241                   /usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so
7f3fb4d23000-7f3fb4d24000 rw-p 00005000 08:42 13769241                   /usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so
7f3fb4d24000-7f3fb4d35000 r-xp 00000000 08:42 14554716                   /usr/lib/deadbeef/converter_gtk2.so
7f3fb4d35000-7f3fb4f34000 ---p 00011000 08:42 14554716                   /usr/lib/deadbeef/converter_gtk2.so
7f3fb4f34000-7f3fb4f35000 r--p 00010000 08:42 14554716                   /usr/lib/deadbeef/converter_gtk2.so
7f3fb4f35000-7f3fb4f36000 rw-p 00011000 08:42 14554716                   /usr/lib/deadbeef/converter_gtk2.so
7f3fbd9c7000-7f3fbdad4000 r-xp 00000000 08:42 12858210                   /usr/lib/libglib-2.0.so.0.4800.1
7f3fbdad4000-7f3fbdcd3000 ---p 0010d000 08:42 12858210                   /usr/lib/libglib-2.0.so.0.4800.1
7f3fbdcd3000-7f3fbdcd4000 r--p 0010c000 08:42 12858210                   /usr/lib/libglib-2.0.so.0.4800.1
7f3fbdcd4000-7f3fbdcd5000 rw-p 0010d000 08:42 12858210                   /usr/lib/libglib-2.0.so.0.4800.1
7f3fbe3dc000-7f3fbe42d000 r-xp 00000000 08:42 12858213                   /usr/lib/libgobject-2.0.so.0.4800.1
7f3fbe42d000-7f3fbe62c000 ---p 00051000 08:42 12858213                   /usr/lib/libgobject-2.0.so.0.4800.1
7f3fbe62c000-7f3fbe62d000 r--p 00050000 08:42 12858213                   /usr/lib/libgobject-2.0.so.0.4800.1
7f3fbe62d000-7f3fbe62e000 rw-p 00051000 08:42 12858213                   /usr/lib/libgobject-2.0.so.0.4800.1
7f3fbee15000-7f3fbee39000 r-xp 00000000 08:42 12873067                   /usr/lib/libgdk_pixbuf-2.0.so.0.3400.0
7f3fbee39000-7f3fbf039000 ---p 00024000 08:42 12873067                   /usr/lib/libgdk_pixbuf-2.0.so.0.3400.0
7f3fbf039000-7f3fbf03a000 r--p 00024000 08:42 12873067                   /usr/lib/libgdk_pixbuf-2.0.so.0.3400.0
7f3fbf03a000-7f3fbf03b000 rw-p 00025000 08:42 12873067                   /usr/lib/libgdk_pixbuf-2.0.so.0.3400.0
7f3fbf79d000-7f3fbf84d000 r-xp 00000000 08:42 12873101                   /usr/lib/libgdk-x11-2.0.so.0.2400.30
7f3fbf84d000-7f3fbfa4d000 ---p 000b0000 08:42 12873101                   /usr/lib/libgdk-x11-2.0.so.0.2400.30
7f3fbfa4d000-7f3fbfa51000 r--p 000b0000 08:42 12873101                   /usr/lib/libgdk-x11-2.0.so.0.2400.30
7f3fbfa51000-7f3fbfa53000 rw-p 000b4000 08:42 12873101                   /usr/lib/libgdk-x11-2.0.so.0.2400.30
7f3fbfa53000-7f3fbfe88000 r-xp 00000000 08:42 12873102                   /usr/lib/libgtk-x11-2.0.so.0.2400.30
7f3fbfe88000-7f3fc0087000 ---p 00435000 08:42 12873102                   /usr/lib/libgtk-x11-2.0.so.0.2400.30
7f3fc0087000-7f3fc008e000 r--p 00434000 08:42 12873102                   /usr/lib/libgtk-x11-2.0.so.0.2400.30
7f3fc008e000-7f3fc0092000 rw-p 0043b000 08:42 12873102                   /usr/lib/libgtk-x11-2.0.so.0.2400.30
7f3fc0095000-7f3fc012d000 r-xp 00000000 08:42 14554699                   /usr/lib/deadbeef/ddb_gui_GTK2.so
7f3fc012d000-7f3fc032c000 ---p 00098000 08:42 14554699                   /usr/lib/deadbeef/ddb_gui_GTK2.so
7f3fc032c000-7f3fc0336000 r--p 00097000 08:42 14554699                   /usr/lib/deadbeef/ddb_gui_GTK2.so
7f3fc0336000-7f3fc0339000 rw-p 000a1000 08:42 14554699                   /usr/lib/deadbeef/ddb_gui_GTK2.so
7f3fc0e07000-7f3fc0e0d000 r-xp 00000000 08:42 12881389                   /usr/lib/libgtk3-nocsd.so.0
7f3fc0e0d000-7f3fc100d000 ---p 00006000 08:42 12881389                   /usr/lib/libgtk3-nocsd.so.0
7f3fc100d000-7f3fc100e000 r--p 00006000 08:42 12881389                   /usr/lib/libgtk3-nocsd.so.0
7f3fc100e000-7f3fc100f000 rw-p 00007000 08:42 12881389                   /usr/lib/libgtk3-nocsd.so.0

And here's with GTK_CSD=1 deadbeef (GUI sometimes freezes after a while). I did try GTK_CSD=1 ./gtk3-nocsd deadbeef but it actually resulted in no GUI at all like above.

grep -iE 'gtk|gdk|glib|gobject' /proc/5411/maps
7f928cfbd000-7f928cfc9000 r-xp 00000000 08:42 13768111                   /usr/lib/gtk-2.0/2.10.0/engines/libxfce.so
7f928cfc9000-7f928d1c8000 ---p 0000c000 08:42 13768111                   /usr/lib/gtk-2.0/2.10.0/engines/libxfce.so
7f928d1c8000-7f928d1c9000 r--p 0000b000 08:42 13768111                   /usr/lib/gtk-2.0/2.10.0/engines/libxfce.so
7f928d1c9000-7f928d1ca000 rw-p 0000c000 08:42 13768111                   /usr/lib/gtk-2.0/2.10.0/engines/libxfce.so
7f92a0d8b000-7f92a0d90000 r-xp 00000000 08:42 13634200                   /usr/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-jpeg.so
7f92a0d90000-7f92a0f8f000 ---p 00005000 08:42 13634200                   /usr/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-jpeg.so
7f92a0f8f000-7f92a0f90000 r--p 00004000 08:42 13634200                   /usr/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-jpeg.so
7f92a0f90000-7f92a0f91000 rw-p 00005000 08:42 13634200                   /usr/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-jpeg.so
7f92a0f91000-7f92a0f98000 r-xp 00000000 08:42 14554700                   /usr/lib/deadbeef/shellexecui_gtk2.so
7f92a0f98000-7f92a1197000 ---p 00007000 08:42 14554700                   /usr/lib/deadbeef/shellexecui_gtk2.so
7f92a1197000-7f92a1198000 r--p 00006000 08:42 14554700                   /usr/lib/deadbeef/shellexecui_gtk2.so
7f92a1198000-7f92a1199000 rw-p 00007000 08:42 14554700                   /usr/lib/deadbeef/shellexecui_gtk2.so
7f92a271e000-7f92a2725000 r-xp 00000000 08:42 14554738                   /usr/lib/deadbeef/pltbrowser_gtk2.so
7f92a2725000-7f92a2924000 ---p 00007000 08:42 14554738                   /usr/lib/deadbeef/pltbrowser_gtk2.so
7f92a2924000-7f92a2925000 r--p 00006000 08:42 14554738                   /usr/lib/deadbeef/pltbrowser_gtk2.so
7f92a2925000-7f92a2926000 rw-p 00007000 08:42 14554738                   /usr/lib/deadbeef/pltbrowser_gtk2.so
7f92aef6a000-7f92aef6e000 r-xp 00000000 08:42 12877475                   /usr/lib/libcanberra-gtk.so.0.1.9
7f92aef6e000-7f92af16d000 ---p 00004000 08:42 12877475                   /usr/lib/libcanberra-gtk.so.0.1.9
7f92af16d000-7f92af16e000 r--p 00003000 08:42 12877475                   /usr/lib/libcanberra-gtk.so.0.1.9
7f92af16e000-7f92af16f000 rw-p 00004000 08:42 12877475                   /usr/lib/libcanberra-gtk.so.0.1.9
7f92af47d000-7f92af488000 r-xp 00000000 08:42 14556711                   /usr/lib/deadbeef/ddb_misc_waveform_GTK2.so
7f92af488000-7f92af688000 ---p 0000b000 08:42 14556711                   /usr/lib/deadbeef/ddb_misc_waveform_GTK2.so
7f92af688000-7f92af689000 r--p 0000b000 08:42 14556711                   /usr/lib/deadbeef/ddb_misc_waveform_GTK2.so
7f92af689000-7f92af68a000 rw-p 0000c000 08:42 14556711                   /usr/lib/deadbeef/ddb_misc_waveform_GTK2.so
7f92af9f3000-7f92af9fe000 r-xp 00000000 08:42 14556706                   /usr/lib/deadbeef/ddb_infobar_gtk2.so
7f92af9fe000-7f92afbfe000 ---p 0000b000 08:42 14556706                   /usr/lib/deadbeef/ddb_infobar_gtk2.so
7f92afbfe000-7f92afbff000 r--p 0000b000 08:42 14556706                   /usr/lib/deadbeef/ddb_infobar_gtk2.so
7f92afbff000-7f92afc00000 rw-p 0000c000 08:42 14556706                   /usr/lib/deadbeef/ddb_infobar_gtk2.so
7f92afe61000-7f92afe72000 r-xp 00000000 08:42 14556708                   /usr/lib/deadbeef/ddb_customizabletb_gtk2.so
7f92afe72000-7f92b0071000 ---p 00011000 08:42 14556708                   /usr/lib/deadbeef/ddb_customizabletb_gtk2.so
7f92b0071000-7f92b0072000 r--p 00010000 08:42 14556708                   /usr/lib/deadbeef/ddb_customizabletb_gtk2.so
7f92b0072000-7f92b0074000 rw-p 00011000 08:42 14556708                   /usr/lib/deadbeef/ddb_customizabletb_gtk2.so
7f92b2620000-7f92b2627000 r-xp 00000000 08:42 12872675                   /usr/lib/libcairo-gobject.so.2.11400.6
7f92b2627000-7f92b2826000 ---p 00007000 08:42 12872675                   /usr/lib/libcairo-gobject.so.2.11400.6
7f92b2826000-7f92b2828000 r--p 00006000 08:42 12872675                   /usr/lib/libcairo-gobject.so.2.11400.6
7f92b2828000-7f92b2829000 rw-p 00008000 08:42 12872675                   /usr/lib/libcairo-gobject.so.2.11400.6
7f92b2829000-7f92b28f9000 r-xp 00000000 08:42 12873482                   /usr/lib/libgdk-3.so.0.2000.6
7f92b28f9000-7f92b2af9000 ---p 000d0000 08:42 12873482                   /usr/lib/libgdk-3.so.0.2000.6
7f92b2af9000-7f92b2afe000 r--p 000d0000 08:42 12873482                   /usr/lib/libgdk-3.so.0.2000.6
7f92b2afe000-7f92b2b01000 rw-p 000d5000 08:42 12873482                   /usr/lib/libgdk-3.so.0.2000.6
7f92b2b01000-7f92b31cb000 r-xp 00000000 08:42 12873483                   /usr/lib/libgtk-3.so.0.2000.6
7f92b31cb000-7f92b33ca000 ---p 006ca000 08:42 12873483                   /usr/lib/libgtk-3.so.0.2000.6
7f92b33ca000-7f92b33d5000 r--p 006c9000 08:42 12873483                   /usr/lib/libgtk-3.so.0.2000.6
7f92b33d5000-7f92b33dc000 rw-p 006d4000 08:42 12873483                   /usr/lib/libgtk-3.so.0.2000.6
7f92b33ed000-7f92b33f2000 r-xp 00000000 08:42 13769241                   /usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so
7f92b33f2000-7f92b35f1000 ---p 00005000 08:42 13769241                   /usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so
7f92b35f1000-7f92b35f2000 r--p 00004000 08:42 13769241                   /usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so
7f92b35f2000-7f92b35f3000 rw-p 00005000 08:42 13769241                   /usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so
7f92b35f3000-7f92b3604000 r-xp 00000000 08:42 14554716                   /usr/lib/deadbeef/converter_gtk2.so
7f92b3604000-7f92b3803000 ---p 00011000 08:42 14554716                   /usr/lib/deadbeef/converter_gtk2.so
7f92b3803000-7f92b3804000 r--p 00010000 08:42 14554716                   /usr/lib/deadbeef/converter_gtk2.so
7f92b3804000-7f92b3805000 rw-p 00011000 08:42 14554716                   /usr/lib/deadbeef/converter_gtk2.so
7f92bc296000-7f92bc3a3000 r-xp 00000000 08:42 12858210                   /usr/lib/libglib-2.0.so.0.4800.1
7f92bc3a3000-7f92bc5a2000 ---p 0010d000 08:42 12858210                   /usr/lib/libglib-2.0.so.0.4800.1
7f92bc5a2000-7f92bc5a3000 r--p 0010c000 08:42 12858210                   /usr/lib/libglib-2.0.so.0.4800.1
7f92bc5a3000-7f92bc5a4000 rw-p 0010d000 08:42 12858210                   /usr/lib/libglib-2.0.so.0.4800.1
7f92bccab000-7f92bccfc000 r-xp 00000000 08:42 12858213                   /usr/lib/libgobject-2.0.so.0.4800.1
7f92bccfc000-7f92bcefb000 ---p 00051000 08:42 12858213                   /usr/lib/libgobject-2.0.so.0.4800.1
7f92bcefb000-7f92bcefc000 r--p 00050000 08:42 12858213                   /usr/lib/libgobject-2.0.so.0.4800.1
7f92bcefc000-7f92bcefd000 rw-p 00051000 08:42 12858213                   /usr/lib/libgobject-2.0.so.0.4800.1
7f92bd6e4000-7f92bd708000 r-xp 00000000 08:42 12873067                   /usr/lib/libgdk_pixbuf-2.0.so.0.3400.0
7f92bd708000-7f92bd908000 ---p 00024000 08:42 12873067                   /usr/lib/libgdk_pixbuf-2.0.so.0.3400.0
7f92bd908000-7f92bd909000 r--p 00024000 08:42 12873067                   /usr/lib/libgdk_pixbuf-2.0.so.0.3400.0
7f92bd909000-7f92bd90a000 rw-p 00025000 08:42 12873067                   /usr/lib/libgdk_pixbuf-2.0.so.0.3400.0
7f92be06c000-7f92be11c000 r-xp 00000000 08:42 12873101                   /usr/lib/libgdk-x11-2.0.so.0.2400.30
7f92be11c000-7f92be31c000 ---p 000b0000 08:42 12873101                   /usr/lib/libgdk-x11-2.0.so.0.2400.30
7f92be31c000-7f92be320000 r--p 000b0000 08:42 12873101                   /usr/lib/libgdk-x11-2.0.so.0.2400.30
7f92be320000-7f92be322000 rw-p 000b4000 08:42 12873101                   /usr/lib/libgdk-x11-2.0.so.0.2400.30
7f92be322000-7f92be757000 r-xp 00000000 08:42 12873102                   /usr/lib/libgtk-x11-2.0.so.0.2400.30
7f92be757000-7f92be956000 ---p 00435000 08:42 12873102                   /usr/lib/libgtk-x11-2.0.so.0.2400.30
7f92be956000-7f92be95d000 r--p 00434000 08:42 12873102                   /usr/lib/libgtk-x11-2.0.so.0.2400.30
7f92be95d000-7f92be961000 rw-p 0043b000 08:42 12873102                   /usr/lib/libgtk-x11-2.0.so.0.2400.30
7f92be964000-7f92be9fc000 r-xp 00000000 08:42 14554699                   /usr/lib/deadbeef/ddb_gui_GTK2.so
7f92be9fc000-7f92bebfb000 ---p 00098000 08:42 14554699                   /usr/lib/deadbeef/ddb_gui_GTK2.so
7f92bebfb000-7f92bec05000 r--p 00097000 08:42 14554699                   /usr/lib/deadbeef/ddb_gui_GTK2.so
7f92bec05000-7f92bec08000 rw-p 000a1000 08:42 14554699                   /usr/lib/deadbeef/ddb_gui_GTK2.so
7f92bf6d6000-7f92bf6dc000 r-xp 00000000 08:42 12881389                   /usr/lib/libgtk3-nocsd.so.0
7f92bf6dc000-7f92bf8dc000 ---p 00006000 08:42 12881389                   /usr/lib/libgtk3-nocsd.so.0
7f92bf8dc000-7f92bf8dd000 r--p 00006000 08:42 12881389                   /usr/lib/libgtk3-nocsd.so.0
7f92bf8dd000-7f92bf8de000 rw-p 00007000 08:42 12881389                   /usr/lib/libgtk3-nocsd.so.0
chris-se commented 8 years ago

Ok, that helps a lot. I think I found the problem: deadbeef has plugins for both gtk2 and gtk3 - and both are loaded at the same time (because it loads all plugins at the same time). I didn't have the issue, because on my test system where I compiled deadbeef I didn't have the gtk2 headers installed (so the gtk2 plugins weren't built, only the gtk3 ones), and I was testing it under a DE where deadbeef defaults to the gtk3 plugins anyway.

What happens is that gtk3-nocsd tries to identify whether gtk2 or gtk3 is active by determining if gtk3 is loaded. Which is fine in 99.99% of cases, but you've hit the corner case where both gtk2 and gtk3 are loaded, but only gtk2 used. This now causes gtk3-nocsd to forward all overridden functions from gtk/gdk to gtk3 (because gtk3 is loaded), instead of gtk2. This in turn causes gtk3 to initialize itself, which doesn't work at all if gtk2 is also initialized, causing your headaches.

Could you verify that by renaming all deadbeef plugins with gtk3 in their name from xxx_gtk3.so to xxx_gtk3.so.disabled? This is not a solution (just a workaround), but if everything works after that, it will confirm for me that that is indeed the problem. In the mean time, I'll think about how to best cope with these cases where both gtk2 and gtk3 are loaded, but only gtk2 is used.

Xylemon commented 8 years ago

@chris-se That solved it, no more errors in terminal and DeaDBeeF works as expected. I suppose for now I'll just delete the GTK3 plugins (they won't be missed). Thanks for the help with this odd bug.

chris-se commented 8 years ago

Well, that's not really a solution, as other people could have the same problem (maybe with a different software); I'll work on having gtk3-nocsd somehow detect at runtime which gtk version is used if both are loaded... It would be great if you could test that once I'm done with it.

Xylemon commented 8 years ago

@chris-se Sure, I can test any fixes.

chris-se commented 8 years ago

Could you rename all the gtk3 plugins back (and verify that it crashes with the current gtk3-nocsd), and then test the branch test-multi-gtk I just pushed to git? It contains a single commit on top of the current commits that tries to detect your situation at runtime - and should cause gtk3-nocsd work properly with your setup.

Xylemon commented 8 years ago

OK so I just got back the GTK3 plugins and tested DeaDBeeF just to make sure everything should fail as expected. I then got the multi-gtk branch installed and it seems that it doesn't detect DB's multiple GTK version setup so it fails, but it does seem to not spit out any errors and works fine when passing GTK_CSD=1

chris-se commented 8 years ago

So you're saying that it still doesn't work unless you set GTK_CSD=1? If GTK_CSD=0, are there any error messages?

Xylemon commented 8 years ago

Yeah, using the branch, 'GTK_CSD=0 deadbeef' still results in no GUI with the error messages in my original post. However, passing GTK_CSD=1 now results in no errors in terminal (unlike before) and the GUI appears to work fine.

chris-se commented 8 years ago

I just pushed an additional commit to the same branch, could you test with that?

Xylemon commented 8 years ago

That one did it! Everything seems to load fine now.

chris-se commented 8 years ago

I've committed a slightly different version of the fix (that takes a lower performance hit) to master, it would be great if you could also test that. If that works, I'll consider this bug fixed and you may close the issue.

Xylemon commented 8 years ago

Tried latest commit, everything seems good. Thanks for investigating and fixing.