dkondor/cairo-dock-core

Cairo Dock crashes when running under plasma 6 + wayland

Closed this issue · 26 comments

I am trying to run cairo-dock under plasma 6 on ArchLinux (from extra-testing) and I get the following error. I suspect that it has to do with gtk-layer-shell because when I compiled it without it, cairo-dock managed to launch, although it was just an empty window.

dbus-glib: 0.112
glu: 9.0.3
gtk3: 1:3.24.41
librsvg: 2:2.57.1
wayland: 1.22
gtk-layer-shell: 0.8.2

`argyros@argyros ~/builds/cairo-dock-wayland-git $ cairo-dock
EGL version: 1;5

============================================================================
Cairo-Dock version: 3.5.99.alpha1
compiled date: Feb 29 2024 11:59:12

Cairo-Dock was built with support for:

  • GTK version: 3.24
  • X11: yes
  • Wayland: yes
  • GLX: no
  • EGL: yes
  • gtk-layer-shell: yes
  • additional Wayland protocols: yes

Cairo-Dock is currently running with:

  • display backend: Wayland
  • layer-shell: yes
  • OpenGL: yes
  • taskbar backend: plasma
  • desktop manager backend(s): plasma-window-management; plasma-virtual-desktop
  • detected desktop environment: KDE
    ============================================================================

warning : (/home/argyros/.cache/yay/cairo-dock-wayland-git/src/cairo-dock/src/gldit/cairo-dock-module-manager.c:gldi_module_new_from_so_file:160)
while opening module '/usr/lib/cairo-dock/libcd-Help.so' : (/usr/lib/cairo-dock/libcd-Help.so: undefined symbol: cairo_dock_show_items_gui)
warning : (/home/argyros/.cache/yay/cairo-dock-wayland-git/src/cairo-dock/src/gldit/cairo-dock-config.c:cairo_dock_get_boolean_key_value:70)
Key file does not have key “X11_new_rendering_code” in group “System”
warning : (/home/argyros/.cache/yay/cairo-dock-wayland-git/src/cairo-dock/src/cairo-dock.c:_cairo_dock_intercept_signal:187)
Cairo-Dock has crashed (sig 11).
It will be restarted now.
Feel free to report this bug on glx-dock.org to help improving the dock!
info on the system :
Linux argyros 6.6.18-1-lts #1 SMP PREEMPT_DYNAMIC Fri, 23 Feb 2024 14:58:40 +0000 x86_64 GNU/Linux
Couldn't guess if it was an applet's fault or not. It may have crashed inside the core or inside a thread
`

Hi,

thank you for reporting! Unfortunately, I cannot test under Plasma 6 right now. Would you be able to generate a backtrace? (run with gdb: gdb cairo-dock and run -T and then bt after the crash)

Also, does the crash happen if you run without OpenGL? (cairo-dock -c)

Thank you!

Hello and thanks for the quick response!

Apologies for the delay. I am abroad with no access to my PC with the issue. FYI on my laptop with Plasma 6 + latest version cairo-dock works smoothly.

When I get back home (about 2 weeks) I will check and update you on the condition.

OK I managed to return home and get the debug output.
With cairo-dock -c there is no crash.

Let me know how can I help on this :)

#0  ___pthread_mutex_lock (mutex=mutex@entry=0x555000db302f) at pthread_mutex_lock.c:80
#1  0x00007ffff13ae67d in destroy_callback (data=0x5555559f7800) at ../egl-wayland/src/wayland-eglsurface.c:2204
#2  0x00007ffff61071a7 in wl_egl_window_destroy (egl_window=0x5555559f7760) at ../wayland-1.22.0/egl/wayland-egl.c:106
#3  0x00007ffff7a9ee8e in _destroy_surface (pWidget=<optimized out>, pContainer=0x5555558f1ac0) at /usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/implementations/cairo-dock-egl.c:220
#4  0x00007ffff7ea36c0 in g_closure_invoke (closure=0x555555889360, return_value=0x0, n_param_values=1, param_values=0x7fffffffd130, invocation_hint=0x7fffffffd080) at ../glib/gobject/gclosure.c:832
#5  0x00007ffff7ed1a36 in signal_emit_unlocked_R.isra.0 (node=node@entry=0x7fffffffd200, detail=detail@entry=0, instance=instance@entry=0x5555558f0d00, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffd130)
    at ../glib/gobject/gsignal.c:3980
#6  0x00007ffff7ec2a42 in signal_emit_valist_unlocked (instance=instance@entry=0x5555558f0d00, signal_id=signal_id@entry=57, detail=detail@entry=0, var_args=var_args@entry=0x7fffffffd360) at ../glib/gobject/gsignal.c:3612
#7  0x00007ffff7ec2c77 in g_signal_emit_valist (instance=0x5555558f0d00, signal_id=57, detail=0, var_args=var_args@entry=0x7fffffffd360) at ../glib/gobject/gsignal.c:3355
#8  0x00007ffff7ec2d34 in g_signal_emit (instance=instance@entry=0x5555558f0d00, signal_id=<optimized out>, detail=detail@entry=0) at ../glib/gobject/gsignal.c:3675
#9  0x00007ffff753fd16 in gtk_widget_unmap (widget=0x5555558f0d00 [GtkWindow]) at ../gtk/gtk/gtkwidget.c:5085
#10 gtk_widget_unmap (widget=0x5555558f0d00 [GtkWindow]) at ../gtk/gtk/gtkwidget.c:5068
#11 0x00007ffff755f653 in gtk_window_hide (widget=0x5555558f0d00 [GtkWindow]) at ../gtk/gtk/gtkwindow.c:6245
#12 0x00007ffff7ea36c0 in g_closure_invoke (closure=0x555555642aa0, return_value=0x0, n_param_values=1, param_values=0x7fffffffd650, invocation_hint=0x7fffffffd5a0) at ../glib/gobject/gclosure.c:832
#13 0x00007ffff7ed1b7a in signal_emit_unlocked_R.isra.0 (node=node@entry=0x7fffffffd720, detail=detail@entry=0, instance=instance@entry=0x5555558f0d00, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffd650)
    at ../glib/gobject/gsignal.c:3813
#14 0x00007ffff7ec2a42 in signal_emit_valist_unlocked (instance=instance@entry=0x5555558f0d00, signal_id=signal_id@entry=55, detail=detail@entry=0, var_args=var_args@entry=0x7fffffffd880) at ../glib/gobject/gsignal.c:3612
#15 0x00007ffff7ec2c77 in g_signal_emit_valist (instance=0x5555558f0d00, signal_id=55, detail=0, var_args=var_args@entry=0x7fffffffd880) at ../glib/gobject/gsignal.c:3355
#16 0x00007ffff7ec2d34 in g_signal_emit (instance=instance@entry=0x5555558f0d00, signal_id=<optimized out>, detail=detail@entry=0) at ../glib/gobject/gsignal.c:3675
#17 0x00007ffff7544b01 in gtk_widget_hide (widget=0x5555558f0d00 [GtkWindow]) at ../gtk/gtk/gtkwidget.c:4953
#18 gtk_widget_hide (widget=0x5555558f0d00 [GtkWindow]) at ../gtk/gtk/gtkwidget.c:4928
#19 0x00007ffff6013f1a in custom_shell_surface_remap (self=<optimized out>) at ../gtk-layer-shell-0.8.2/src/custom-shell-surface.c:132
#20 0x00007ffff7a4051b in init_object (attr=0x7fffffffda00, obj=0x5555558f1ac0) at /usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-dock-manager.c:1848
#21 init_object (obj=0x5555558f1ac0, attr=0x7fffffffda00) at /usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-dock-manager.c:1771
#22 0x00007ffff7a19c0c in gldi_object_init (obj=obj@entry=0x5555558f1ac0, pMgr=<optimized out>, pMgr@entry=0x555555586b60 <myDockObjectMgr>, attr=attr@entry=0x7fffffffda00) at /usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-object.c:51
#23 0x00007ffff7a19cba in gldi_object_new (pMgr=0x555555586b60 <myDockObjectMgr>, attr=attr@entry=0x7fffffffda00) at /usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-object.c:60
#24 0x00007ffff7a457bf in gldi_dock_new (cDockName=cDockName@entry=0x7ffff7aa6b2d "_MainDock_") at /usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-dock-factory.c:2246
#25 0x00007ffff7a81a07 in cairo_dock_load_current_theme () at /usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-config.c:459
#26 0x000055555556022f in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/cairo-dock.c:852


Thank you! This gives me some ideas, but no definite solution yet. Would you be able to compile cairo-dock from this branch:
https://github.com/dkondor/cairo-dock-core/tree/egl_test_output
and paste the output when trying to run it? (No need to run in gdb, just the normal output -- I've added some diagnostic messages and error handling)

Also, do you have multiple monitors? If yes, are they using multiple GPUs?

I just compiled from the egl_test_output branch, run and got the following:

EGL version: 1;5

 ============================================================================
Cairo-Dock version: 3.5.99.alpha1
   compiled date: Mar 19 2024 15:36:04

Cairo-Dock was built with support for:
 * GTK version:                  3.24
 * X11:                          yes
 * Wayland:                      yes
 * GLX:                          no
 * EGL:                          yes
 * gtk-layer-shell:              yes
 * additional Wayland protocols: yes

Cairo-Dock is currently running with:
 * display backend:              Wayland
 * layer-shell:                  yes
 * OpenGL:                       yes
 * taskbar backend:              none
 * desktop manager backend(s):   plasma-virtual-desktop
 * detected desktop environment: KDE
 ============================================================================

warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-module-manager.c:gldi_module_new_from_so_file:162)  
  while opening module '/usr/lib/cairo-dock/libcd-Help.so' : (/usr/lib/cairo-dock/libcd-Help.so: undefined symbol: cairo_dock_show_items_gui)
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/implementations/cairo-dock-egl.c:_init_surface:204)  
  pWidget: 0x64b30e968de0, pContainer: 0x64b30e968800
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/implementations/cairo-dock-egl.c:_destroy_surface:216)  
  pWidget: 0x64b30e968de0, pContainer: 0x64b30e968800
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/cairo-dock.c:_cairo_dock_intercept_signal:188)  
  Cairo-Dock has crashed (sig 11).
It will be restarted now.
Feel free to report this bug on glx-dock.org to help improving the dock!
info on the system :
Linux argyros 6.6.21-1-lts #1 SMP PREEMPT_DYNAMIC Wed, 06 Mar 2024 16:59:55 +0000 x86_64 GNU/Linux
Couldn't guess if it was an applet's fault or not. It may have crashed inside the core or inside a thread
restarting with './cairo-dock -w 2 -q 1'...
EGL version: 1;5

 ============================================================================
Cairo-Dock version: 3.5.99.alpha1
   compiled date: Mar 19 2024 15:36:04

Cairo-Dock was built with support for:
 * GTK version:                  3.24
 * X11:                          yes
 * Wayland:                      yes
 * GLX:                          no
 * EGL:                          yes
 * gtk-layer-shell:              yes
 * additional Wayland protocols: yes

Cairo-Dock is currently running with:
 * display backend:              Wayland
 * layer-shell:                  yes
 * OpenGL:                       yes
 * taskbar backend:              none
 * desktop manager backend(s):   plasma-virtual-desktop
 * detected desktop environment: KDE
 ============================================================================

warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-module-manager.c:gldi_module_new_from_so_file:162)  
  while opening module '/usr/lib/cairo-dock/libcd-Help.so' : (/usr/lib/cairo-dock/libcd-Help.so: undefined symbol: cairo_dock_show_items_gui)
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/implementations/cairo-dock-egl.c:_init_surface:204)  
  pWidget: 0x627bfba8ffb0, pContainer: 0x627bfba8f9d0
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/implementations/cairo-dock-egl.c:_destroy_surface:216)  
  pWidget: 0x627bfba8ffb0, pContainer: 0x627bfba8f9d0
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/cairo-dock.c:_cairo_dock_intercept_signal:188)  
  Cairo-Dock has crashed (sig 11).
It will be restarted now.
Feel free to report this bug on glx-dock.org to help improving the dock!
info on the system :
Linux argyros 6.6.21-1-lts #1 SMP PREEMPT_DYNAMIC Wed, 06 Mar 2024 16:59:55 +0000 x86_64 GNU/Linux
Couldn't guess if it was an applet's fault or not. It may have crashed inside the core or inside a thread
restarting with './cairo-dock -w 2 -q 2'...
EGL version: 1;5

 ============================================================================
Cairo-Dock version: 3.5.99.alpha1
   compiled date: Mar 19 2024 15:36:04

Cairo-Dock was built with support for:
 * GTK version:                  3.24
 * X11:                          yes
 * Wayland:                      yes
 * GLX:                          no
 * EGL:                          yes
 * gtk-layer-shell:              yes
 * additional Wayland protocols: yes

Cairo-Dock is currently running with:
 * display backend:              Wayland
 * layer-shell:                  yes
 * OpenGL:                       yes
 * taskbar backend:              none
 * desktop manager backend(s):   plasma-virtual-desktop
 * detected desktop environment: KDE
 ============================================================================

warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-module-manager.c:gldi_module_new_from_so_file:162)  
  while opening module '/usr/lib/cairo-dock/libcd-Help.so' : (/usr/lib/cairo-dock/libcd-Help.so: undefined symbol: cairo_dock_show_items_gui)
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/implementations/cairo-dock-egl.c:_init_surface:204)  
  pWidget: 0x5ee032624cf0, pContainer: 0x5ee032624710
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/implementations/cairo-dock-egl.c:_destroy_surface:216)  
  pWidget: 0x5ee032624cf0, pContainer: 0x5ee032624710
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/cairo-dock.c:_cairo_dock_intercept_signal:188)  
  Cairo-Dock has crashed (sig 11).
It will be restarted now.
Feel free to report this bug on glx-dock.org to help improving the dock!
info on the system :
Linux argyros 6.6.21-1-lts #1 SMP PREEMPT_DYNAMIC Wed, 06 Mar 2024 16:59:55 +0000 x86_64 GNU/Linux
Couldn't guess if it was an applet's fault or not. It may have crashed inside the core or inside a thread
restarting with './cairo-dock -m -q 3'...
EGL version: 1;5

 ============================================================================
Cairo-Dock version: 3.5.99.alpha1
   compiled date: Mar 19 2024 15:36:04

Cairo-Dock was built with support for:
 * GTK version:                  3.24
 * X11:                          yes
 * Wayland:                      yes
 * GLX:                          no
 * EGL:                          yes
 * gtk-layer-shell:              yes
 * additional Wayland protocols: yes

Cairo-Dock is currently running with:
 * display backend:              Wayland
 * layer-shell:                  yes
 * OpenGL:                       yes
 * taskbar backend:              none
 * desktop manager backend(s):   plasma-virtual-desktop
 * detected desktop environment: KDE
 ============================================================================

warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-module-manager.c:gldi_module_new_from_so_file:162)  
  while opening module '/usr/lib/cairo-dock/libcd-Help.so' : (/usr/lib/cairo-dock/libcd-Help.so: undefined symbol: cairo_dock_show_items_gui)
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/cairo-dock.c:main:769)  
  showing the maintenance mode ...

Thank you! It is still unclear to me (although probably a memory corruption issue somewhere). I have three follow-up questions:

  1. I've updated the branch with more diagnostics (https://github.com/dkondor/cairo-dock-core/tree/egl_test_output). Could you re-run and paste the output? (you can run as cairo-dock -T and then it will not try to restart once it has crashed.

  2. Would you be able to try running this simple test program: https://github.com/dkondor/egl_popup_test ? This is originally for a separate issue, but uses EGL in a trivial way, so it would inform me if there is some basic issue in how I manage EGL resources. Just run it as build/egl-popup-test -C (no need for any other options) and right click on the window that opened to close it.

  3. are you using an NVIDIA GPU? (just to confirm, since the stacktrace seems to end in their driver)

No problem! Please check the answers below :)

argyros@argyros ~ $ cairo-dock -T
EGL version: 1;5

============================================================================
Cairo-Dock version: 3.5.99.alpha1
  compiled date: Mar 20 2024 08:31:08

Cairo-Dock was built with support for:
* GTK version:                  3.24
* X11:                          yes
* Wayland:                      yes
* GLX:                          no
* EGL:                          yes
* gtk-layer-shell:              yes
* additional Wayland protocols: yes

Cairo-Dock is currently running with:
* display backend:              Wayland
* layer-shell:                  yes
* OpenGL:                       yes
* taskbar backend:              plasma
* desktop manager backend(s):   plasma-window-management; plasma-virtual-desktop
* detected desktop environment: KDE
============================================================================

warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-module-manager.c:gldi_module_new_from_so_file:162)  
 while opening module '/usr/lib/cairo-dock/libcd-Help.so' : (/usr/lib/cairo-dock/libcd-Help.so: undefined symbol: cairo_dock_show_items_gui)
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/implementations/cairo-dock-egl.c:_init_surface:205)  
 pWidget: 0x5d689187c500, pContainer: 0x5d689187bf20
surface: 0x5d689199a2f0, window: 0x5d689199a250, window->priv: 0x5d689199a2f0, window->destroy_callback: 0x7ce1549dd660
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/implementations/cairo-dock-egl.c:_destroy_surface:219)  
 pWidget: 0x5d689187c500, pContainer: 0x5d689187bf20, surface: 0x5d689199a2f0
window: 0x5d689199a250, window->priv: 0x5d689199a2f0, window->destroy_callback: 0x7ce1549dd660
Segmentation fault (core dumped)
  1. I managed to run it, also trying almost all the available flags, but it always crashes in the following assertion:
argyros@argyros ~/tmp/egl_popup_test/build $ ./egl-popup-test -r
egl-popup-test: ../egl-popup-test.c:537: main: Assertion `compositor && seat && xdg_wm_base && (is_child || toplevel_manager)' failed.
  1. Yes it's an NVIDIA RTX 4080.
2. I managed to run it, also trying almost all the available flags, but it always crashes in the following assertion:
argyros@argyros ~/tmp/egl_popup_test/build $ ./egl-popup-test -r
egl-popup-test: ../egl-popup-test.c:537: main: Assertion `compositor && seat && xdg_wm_base && (is_child || toplevel_manager)' failed.

Sorry, I forgot that it will not work on KWin by default. I've updated it now, so you should be able to run it with the -C option now.

Hi again, yes now it works properly

Popup configured 256x256@-27,73
Popup configured 256x256@-27,73

I have an idea what is the issue and created a potential fix. Could you test the following branch:
https://github.com/dkondor/cairo-dock-core/tree/egl_destroy_surface_fix
?

Also, could you specifically test if subdocks render correctly? (if multiple instances of an app are grouped or e.g. the "Shortcuts" plug-in) I'm a bit afraid of being affected by this issue, but I'm not sure if it would apply in this case.

Thanks!

I tried it with no luck.

argyros@argyros ~ $ cairo-dock -T
EGL version: 1;5
============================================================================
Cairo-Dock version: 3.5.99.alpha1
   compiled date: Mar 21 2024 19:49:49

Cairo-Dock was built with support for:
 * GTK version:                  3.24
 * X11:                          yes
 * Wayland:                      yes
 * GLX:                          no
 * EGL:                          yes
 * gtk-layer-shell:              yes
 * additional Wayland protocols: yes

Cairo-Dock is currently running with:
 * display backend:              Wayland
 * layer-shell:                  yes
 * OpenGL:                       yes
 * taskbar backend:              plasma
 * desktop manager backend(s):   plasma-window-management; plasma-virtual-desktop
 * detected desktop environment: KDE
 ==========================================================================

warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-module-manager.c:gldi_module_new_from_so_file:162)  
  while opening module '/usr/lib/cairo-dock/libcd-Help.so' : (/usr/lib/cairo-dock/libcd-Help.so: undefined symbol: cairo_dock_show_items_gui)
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/implementations/cairo-dock-egl.c:_init_surface:215)  
  pWidget: 0x5a1c7cbedf50, pContainer: 0x5a1c7cbed970
surface: 0x5a1c7cd0b190, window: 0x5a1c7cd0b0f0, window->priv: 0x5a1c7cd0b190, window->destroy_callback: 0x7ca6f19a1660
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/implementations/cairo-dock-egl.c:_destroy_surface:229)  
  pWidget: 0x5a1c7cbedf50, pContainer: 0x5a1c7cbed970, surface: 0x5a1c7cd0b190, is current: TRUE
window: 0x5a1c7cd0b0f0, window->priv: 0x5a1c7cd0b190, window-destroy_callback: 0x7ca6f19a1660
Segmentation fault (core dumped)

Subdocks render properly (at least in the case of multiple applications and containers), but their origin when I create a container is wrong (they start at the middle of the dock on the lower end towards the screen, instead of popping up on top on the center of the icon like when they do in the grouped apps)

I tried it with no luck.

Thank you, this is weird (it seems that this code is not run for some reason).
I've updated my branch:
https://github.com/dkondor/cairo-dock-core/tree/egl_destroy_surface_fix
could you test again? Also, in case it does not work (which is quite likely): are you building the NVIDIA library from source as well? I would be very interested to add a few debug statements to get a better sense of what's happening.

Subdocks render properly (at least in the case of multiple applications and containers), but their origin when I create a container is wrong (they start at the middle of the dock on the lower end towards the screen, instead of popping up on top on the center of the icon like when they do in the grouped apps)

To clarify, does this happen when you run without OpenGL on the other machine?

I tried again, with the obvious result :-/. I did again a debug session and it seems that now it crashes on a different point (please check below).

I can try to compile the egl-wayland from source. If it helps I can add also some custom flags in the compiler before doing that.

0  0x00007ffff70c48a4 in pthread_mutex_lock () at /usr/lib/libc.so.6
#1  0x00007fffebfa7413 in destroy_callback (data=0x5555559f59c0) at src/wayland-eglsurface.c:2204
#2  0x00007ffff614d1b7 in wl_egl_window_destroy () at /usr/lib/libwayland-egl.so.1
#3  0x00007ffff72c8a2f in _destroy_surface (pWidget=<optimized out>, pContainer=0x5555558d7e40)
    at /usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/implementations/cairo-dock-egl.c:362
#4  0x00007ffff7d626c0 in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0
#5  0x00007ffff7d90a36 in ??? () at /usr/lib/libgobject-2.0.so.0
#6  0x00007ffff7d81a42 in ??? () at /usr/lib/libgobject-2.0.so.0
#7  0x00007ffff7d81c77 in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#8  0x00007ffff7d81d34 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#9  0x00007ffff773fd16 in gtk_widget_unmap () at /usr/lib/libgtk-3.so.0
#10 0x00007ffff775f653 in ??? () at /usr/lib/libgtk-3.so.0
#11 0x00007ffff7d626c0 in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0
#12 0x00007ffff7d90b7a in ??? () at /usr/lib/libgobject-2.0.so.0
#13 0x00007ffff7d81a42 in ??? () at /usr/lib/libgobject-2.0.so.0
#14 0x00007ffff7d81c77 in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#15 0x00007ffff7d81d34 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#16 0x00007ffff7744b01 in gtk_widget_hide () at /usr/lib/libgtk-3.so.0
#17 0x00007ffff5b16f1a in custom_shell_surface_remap () at /usr/lib/libgtk-layer-shell.so.0
#18 0x00007ffff726951b in init_object (attr=0x7fffffffdb00, obj=0x5555558d7e40)
    at /usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-dock-manager.c:1848
#19 init_object (obj=0x5555558d7e40, attr=0x7fffffffdb00)
    at /usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-dock-manager.c:1771
#20 0x00007ffff7242c0c in gldi_object_init (obj=obj@entry=0x5555558d7e40, pMgr=<optimized out>, 
    pMgr@entry=0x555555586b60 <myDockObjectMgr>, attr=attr@entry=0x7fffffffdb00)
    at /usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-object.c:51
#21 0x00007ffff7242cba in gldi_object_new (pMgr=0x555555586b60 <myDockObjectMgr>, attr=attr@entry=0x7fffffffdb00)
    at /usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-object.c:60
#22 0x00007ffff726e7bf in gldi_dock_new (cDockName=cDockName@entry=0x7ffff72cfb2b "_MainDock_")
    at /usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-dock-factory.c:2246
#23 0x00007ffff72aaa07 in cairo_dock_load_current_theme ()
    at /usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-config.c:459
#24 0x000055555556022f in main (argc=<optimized out>, argv=<optimized out>)
    at /usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/cairo-dock.c:852

Thanks, could you try also:

I just tried the latest version:

  • Indeed the dock is running, it doesn't crash necessarily when trying to render subdocks, it does crash however when I am right clicking on icons having sub-docks
  • I did as you asked, here is the output:
argyros@argyros ~ $ cairo-dock -T
EGL version: 1;5
GetDisplay: 0x742582763ac0 0x742582763f70
CreateWindowSurface: 0x7425827655a0 0x7425827654d0
DestroySurface: 0x7425827656d0 0x7425827656d0


 ============================================================================
Cairo-Dock version: 3.5.99.alpha1
   compiled date: Mar 26 2024 13:41:50

Cairo-Dock was built with support for:
 * GTK version:                  3.24
 * X11:                          yes
 * Wayland:                      yes
 * GLX:                          no
 * EGL:                          yes
 * gtk-layer-shell:              yes
 * additional Wayland protocols: yes

Cairo-Dock is currently running with:
 * display backend:              Wayland
 * layer-shell:                  yes
 * OpenGL:                       yes
 * taskbar backend:              plasma
 * desktop manager backend(s):   plasma-window-management; plasma-virtual-desktop
 * detected desktop environment: KDE
 ============================================================================

warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-module-manager.c:gldi_module_new_from_so_file:162)  
  while opening module '/usr/lib/cairo-dock/libcd-Help.so' : (/usr/lib/cairo-dock/libcd-Help.so: undefined symbol: cairo_dock_show_items_gui)
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-config.c:cairo_dock_get_boolean_key_value:70)  
  Key file does not have key “X11_new_rendering_code” in group “System”
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/implementations/cairo-dock-egl.c:_init_surface:281)  
  pWidget: 0x577fa2128230, pContainer: 0x577fa2128f20 (1x1)
(src/wayland-eglsurface.c:2652 wlEglCreatePlatformWindowSurfaceHook 127704390479744): nativeWin = 0x577fa222f090
surface: 0x577fa222f0e0, window: 0x577fa222f090, window->priv: 0x577fa222f0e0, window->destroy_callback: 0x74257c13b69d
g_file_test: assertion 'filename != NULL' failed
g_file_test: assertion 'filename != NULL' failed
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/implementations/cairo-dock-egl.c:_destroy_surface:322)  
  pWidget: (nil), pContainer: 0x577fa22e25b0, surface: (nil), is current: FALSE
cairo_dock_redraw_icon: assertion 'pContainer != NULL' failed
cairo_dock_register_class_full: assertion 'cDesktopFile != NULL || cClassName != NULL' failed
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-user-icon-manager.c:gldi_user_icons_new_from_directory:133)  
  Unable to load a valid icon from '/home/argyros/.config/cairo-dock/current_theme/launchers/01ubuntu-software-center.desktop'; the file is either unreadable, unvalid or does not correspond to any installed program, and will be deleted
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-keybinder.c:init_object:358)  
  Couldn't bind '<Super>L' (Log out: Lock the screen)
 This shortkey is probably already used by another applet or another application
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-keybinder.c:init_object:358)  
  Couldn't bind '<Control>F12' (Log out: Show the logout menu)
 This shortkey is probably already used by another applet or another application
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-keybinder.c:init_object:358)  
  Couldn't bind '<Control>F10' (Recent-Events: Show/hide the Recent Events)
 This shortkey is probably already used by another applet or another application
Cairo-Dock - Launcher API Daemon is already running (2131)
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/implementations/cairo-dock-egl.c:_init_surface:281)  
  pWidget: 0x577fa2339120, pContainer: 0x577fa210c260 (1x1)
(src/wayland-eglsurface.c:2652 wlEglCreatePlatformWindowSurfaceHook 127704390479744): nativeWin = 0x577fa1dc6740
surface: 0x577fa264cf90, window: 0x577fa1dc6740, window->priv: 0x577fa264cf90, window->destroy_callback: 0x74257c13b69d
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-keybinder.c:init_object:358)  
  Couldn't bind '<Control>F1' (Applications Menu: Show/hide the Applications menu)
 This shortkey is probably already used by another applet or another application
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-keybinder.c:init_object:358)  
  Couldn't bind '<Control>F2' (Applications Menu: Show/hide the quick-launch dialogue)
 This shortkey is probably already used by another applet or another application
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-keybinder.c:init_object:358)  
  Couldn't bind '<Super>Return' (Control from keyboard: Enable/disable the keyboard control of the dock)
 This shortkey is probably already used by another applet or another application
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-keybinder.c:init_object:358)  
  Couldn't bind '<Control>F6' (Quick Browser: Show/hide the folder menu)
 This shortkey is probably already used by another applet or another application
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-keybinder.c:init_object:358)  
  Couldn't bind '<Shift><Ctrl>F4' (Show Desktop: Expose all the desktops)
 This shortkey is probably already used by another applet or another application
(src/wayland-eglsurface.c:628 destroy_surface_context 127704390479744): surf = 0x577fa224cea1
Gtk-Message: 16:07:37.160: Failed to load module "appmenu-gtk-module"
_on_configure (0x577fa2128f20, main dock : 1) : (0;0) (1x1)
GFileInfo created without standard::is-hidden
file ../glib/gio/gfileinfo.c: line 1632 (g_file_info_get_is_hidden): should not be reached
GFileInfo created without standard::content-type
file ../glib/gio/gfileinfo.c: line 1821 (g_file_info_get_content_type): should not be reached
GFileInfo created without standard::is-hidden
file ../glib/gio/gfileinfo.c: line 1632 (g_file_info_get_is_hidden): should not be reached
GFileInfo created without standard::content-type
file ../glib/gio/gfileinfo.c: line 1821 (g_file_info_get_content_type): should not be reached
GFileInfo created without standard::is-hidden
file ../glib/gio/gfileinfo.c: line 1632 (g_file_info_get_is_hidden): should not be reached
GFileInfo created without standard::content-type
file ../glib/gio/gfileinfo.c: line 1821 (g_file_info_get_content_type): should not be reached
GFileInfo created without standard::is-hidden
file ../glib/gio/gfileinfo.c: line 1632 (g_file_info_get_is_hidden): should not be reached
GFileInfo created without standard::content-type
file ../glib/gio/gfileinfo.c: line 1821 (g_file_info_get_content_type): should not be reached
GFileInfo created without standard::is-hidden
file ../glib/gio/gfileinfo.c: line 1632 (g_file_info_get_is_hidden): should not be reached
GFileInfo created without standard::content-type
file ../glib/gio/gfileinfo.c: line 1821 (g_file_info_get_content_type): should not be reached
GFileInfo created without standard::is-hidden
file ../glib/gio/gfileinfo.c: line 1632 (g_file_info_get_is_hidden): should not be reached
GFileInfo created without standard::content-type
file ../glib/gio/gfileinfo.c: line 1821 (g_file_info_get_content_type): should not be reached
warning :  (/usr/src/debug/cairo-dock-plug-ins-wayland-git/cairo-dock-plug-ins-wayland-git/kde-integration/src/applet-vfs.c:vfs_backend_get_file_info:307)  
  gnome_integration : Error when getting information for file “/home/argyros/NextCloud/orthophoto”: No such file or directory
_on_configure (0x577fa2128f20, main dock : 1) : (0;0) (3840x96)
(src/wayland-eglsurface.c:628 destroy_surface_context 127704390479744): surf = 0x577fa2005691
warning :  (/usr/src/debug/cairo-dock-plug-ins-wayland-git/cairo-dock-plug-ins-wayland-git/switcher/src/applet-load-icons.c:cd_switcher_load_desktop_bg_map_surface:197)  
  couldn't get the wallpaper
which: no compiz in (/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/cuda/bin:/opt/cuda/nsight_compute:/opt/cuda/nsight_systems/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/argyros/.bin/:/home/argyros/.bin/)

Thanks, this is good feedback! (and also I see that the extra outputs I added are working)
Sorry that I did not mention that I would also need the output around the crash. Maybe best if you could revert to the state when it crashes immediately when starting (just revert the last commit, or git checkout 02c3004d1c27919a76fd8f0f970cd75805033fce). Thanks!

OK I reverted as you suggested, here is the output:

argyros@argyros ~/builds/egl-wayland $ cairo-dock -T
EGL version: 1;5
GetDisplay: 0x7403ea961ac0 0x7403ea961f70
CreateWindowSurface: 0x7403ea9635a0 0x7403ea9634d0
DestroySurface: 0x7403ea9636d0 0x7403ea9636d0


 ============================================================================
Cairo-Dock version: 3.5.99.alpha1
   compiled date: Mar 27 2024 09:28:08

Cairo-Dock was built with support for:
 * GTK version:                  3.24
 * X11:                          yes
 * Wayland:                      yes
 * GLX:                          no
 * EGL:                          yes
 * gtk-layer-shell:              yes
 * additional Wayland protocols: yes

Cairo-Dock is currently running with:
 * display backend:              Wayland
 * layer-shell:                  yes
 * OpenGL:                       yes
 * taskbar backend:              plasma
 * desktop manager backend(s):   plasma-window-management; plasma-virtual-desktop
 * detected desktop environment: KDE
 ============================================================================

warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/gldit/cairo-dock-module-manager.c:gldi_module_new_from_so_file:162)  
  while opening module '/usr/lib/cairo-dock/libcd-Help.so' : (/usr/lib/cairo-dock/libcd-Help.so: undefined symbol: cairo_dock_show_items_gui)
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/implementations/cairo-dock-egl.c:_init_surface:281)  
  pWidget: 0x63d86270fed0, pContainer: 0x63d86270f8f0 (1x1)
(src/wayland-eglsurface.c:2652 wlEglCreatePlatformWindowSurfaceHook 127560109686656): nativeWin = 0x63d86282e260
surface: 0x63d86282e2b0, window: 0x63d86282e260, window->priv: 0x63d86282e2b0, window->destroy_callback: 0x7403e6f9669d
warning :  (/usr/src/debug/cairo-dock-core-wayland-git/cairo-dock-core-wayland-git/src/implementations/cairo-dock-egl.c:_destroy_surface:322)  
  pWidget: 0x63d86270fed0, pContainer: 0x63d86270f8f0, surface: 0x63d86282e2b0, is current: TRUE
(src/wayland-eglsurface.c:2979 wlEglDestroySurfaceHook 127560109686656): dpy = 0x63d86267cb60, surface = 0x63d86282e2b0
(src/wayland-eglsurface.c:2504 wlEglDestroySurface 127560109686656): display = 0x63d86267cb60, surface = 0x63d86282e2b0
                eglwin = 0x63d86282e260, isOffScreen = FALSE
(src/wayland-eglsurface.c:628 destroy_surface_context 127560109686656): surf = 0x63d862602461
window: 0x63d86282e260, window->priv: 0x63d86282e2b0, window->destroy_callback: 0x7403e6f9669d
(src/wayland-eglsurface.c:2599 destroy_callback 127560109686656): data = 0x63d86282e2b0
Segmentation fault (core dumped)

Thank you, this is very interesting and I think I found the cause, which is the incorrect order in which resources were freed when a dock / subdock is hidden. Could you test the following branch?
https://github.com/dkondor/cairo-dock-core/tree/egl_destroy_surface_fix2

OK now the dock launches properly, but there still the following issues:

  • The "mix launchers and applications" is broken (I suspect that you haven't merge the code from the other bug, so it should be OK if they are merged)
  • Indicator does not appear (but should be similar case to the above)
  • Subdock origin (if created by add Sub-dock) is still on the bottom center of the dock.

Thanks for the feedback! Yes, the first two issues should be fixed once I merge everything together. I'll clean a bit the code first.

I'll try to investigate the last issue more. Just to clarify, does this only happen when using OpenGL and on the desktop with NVIDIA?

Yes that's where I tested it, I don't have the laptop available atm to do it there as well

Subdock origin (if created by add Sub-dock) is still on the bottom center of the dock.

I'm trying to reproduce this, but I don't think I'm able to. What I've found is that subdocks of the "parabolic" style don't align well with their icon, but they are still on top of their icon, not centered on the dock. In theory, it is possible that this is an issue specific to KWin or NVIDIA, but that would be strange; more likely, this comes up with a specific combination of settings for style / behavior. Could you give some more info on how exactly you encounter this problem:

  • Does this only happen with OpenGL or also when running with Cairo (cairo-dock -c)?
  • Which theme is used (does it happen with all themes)?
  • Which view is used for subdocks? (Configuration -> Appearance -> Views -> sub-docks)
  • Is the dock set to auto-hide?
  • Does this only happen for manually added subdocks? (so not when multiple instances of an app are grouped into a subdock, or with e.g. the Shortcuts plugin)

Thanks!

First to answer your questions (tried with clean settings):

  • Yes
  • I've tried the default and MacOSX, it happens with both themes
  • Slide view
  • Yes, but setting the dock to always on top does not change the behaviour
  • Yes

I think I found a way to reproduce it:

  • Create a manual subdock
  • Add a couple of icons in it
  • If you try it before closing then you will see that everything is rendered properly
  • Close/Relaunch the dock and the issue should appear

What I suspect is that the origin of the subdock is initialized when cairo-dock launches and is not changed later on...

Hi,
thanks, this is really helpful, I see a problem with the order of loading launchers and subdocks. I've created a potential fix here:
https://github.com/dkondor/cairo-dock-core/commits/fix_subdock_loading/
could you try?
Note that if you try this branch, you will need to recompile the plug-ins, since I was in the middle of simplifying the API / ABI. If this is an issue, you can just apply 1a685ac on top of your current branch and it should work.

Hello,

I just tried it (recompiled plugins as well) and now the sub-dock renders properly!

Thank you! I have merged the fix