mate-desktop / marco

MATE default window manager
https://mate-desktop.org
GNU General Public License v2.0
193 stars 86 forks source link

Leaking X resources (on virtual desktop switch?) #685

Closed jankratochvil closed 3 years ago

jankratochvil commented 3 years ago

Expected behaviour

System is responsible even after few weeks of runtime. After boot zrestop:

res-base Wins  GCs Fnts Pxms Misc   Pxm mem  Other   Total   PID Identifier    
0a00000    41    4    2 1686 2248   1181870K     55K 1181926K 11514 marco
2600000    19    6    1   13   92   127387K  3K 127391K 14352 Mozilla Firefox

Actual behaviour

After 3 weeks the system takes seconds to do virtual desktop switch or anything.

After 15 hours of uptime:
res-base Wins  GCs Fnts Pxms Misc   Pxm mem  Other   Total   PID Identifier    
0a00000    40    4    2 3847 2256   1130430K     55K 1130486K 11514 marco
2600000    27   10    1   19  119   131396K  4K 131400K 14352 Mozilla Firefox

Pxms is continually increasing by each virtual desktop switch.

Steps to reproduce the behaviour

Runtime of 3 weeks. I have 24 virtual desktops (3840x2160) and switching between them very often.

MATE general version

Fedora 34

Package version

marco-1.24.2-1.fc34.x86_64

Linux Distribution

Fedora 34 x86_64

Link to bugreport of your Distribution (requirement)

https://bugzilla.redhat.com/show_bug.cgi?id=1965944 There was issue 329 but that is probably fixed already.

jankratochvil commented 3 years ago

I have tried some fix but that does not help. marco-leak.patch.txt

jankratochvil commented 3 years ago

It looks to me like XRenderCreatePicture is leaked. Tried to downgrade cairo from F34 to F33 version but it still leaks. I may have to give up, it did cost me already a bit too much time.

Line 3633 of "compositor/compositor-xrender.c" starts at address 0x7f677993c230 <XRenderCreatePicture+144> and ends at 0x7f677993c236 <XRenderCreatePicture+150>. Line 1072 of "/usr/src/debug/cairo-1.17.4-3.fc34.x86_64/src/cairo-xlib-surface.c" starts at address 0x7f6778c17d5a <_cairo_xlib_surface_ensure_picture+106> and ends at 0x7f6778c17d61 <_cairo_xlib_surface_ensure_picture+113>. Line 702 of "/usr/src/debug/cairo-1.17.4-3.fc34.x86_64/src/cairo-xlib-render-compositor.c" starts at address 0x7f6778c1804d <fill_boxes+141> and ends at 0x7f6778c18051 <fill_boxes+145>. Line 1267 of "/usr/src/debug/cairo-1.17.4-3.fc34.x86_64/src/cairo-traps-compositor.c" starts at address 0x7f6778bfce25 <clip_and_composite_boxes+1525> and ends at 0x7f6778bfce28 <clip_and_composite_boxes+1528>. Line 1742 of "/usr/src/debug/cairo-1.17.4-3.fc34.x86_64/src/cairo-traps-compositor.c" starts at address 0x7f6778bfd1bd <_cairo_traps_compositor_paint+189> and ends at 0x7f6778bfd1c0 <_cairo_traps_compositor_paint+192>. Line 67 of "/usr/src/debug/cairo-1.17.4-3.fc34.x86_64/src/cairo-compositor.c" starts at address 0x7f6778ba5bf1 <_cairo_compositor_paint+81> and ends at 0x7f6778ba5bf4 <_cairo_compositor_paint+84>. Line 2199 of "/usr/src/debug/cairo-1.17.4-3.fc34.x86_64/src/cairo-surface.c" starts at address 0x7f6778bf2bf8 <_cairo_surface_paint+184> and ends at 0x7f6778bf2bfd <_cairo_surface_paint+189>. Line 1064 of "/usr/src/debug/cairo-1.17.4-3.fc34.x86_64/src/cairo-gstate.c" starts at address 0x7f6778bac0d6 <_cairo_gstate_paint+118> and ends at 0x7f6778bac0f1 <_cairo_gstate_paint+145>. Line 2219 of "/usr/src/debug/cairo-1.17.4-3.fc34.x86_64/src/cairo.c" starts at address 0x7f6778bffb89 <INT_cairo_paint+25> and ends at 0x7f6778bffb8b <INT_cairo_paint+27>. Line 3088 of "/usr/src/debug/gtk3-3.24.29-1.fc34.x86_64/gdk/gdkwindow.c" starts at address 0x7f6778d80022 <gdk_window_end_paint_internal+466> and ends at 0x7f6778d8002a <gdk_window_end_paint_internal+474>. Line 3311 of "/usr/src/debug/gtk3-3.24.29-1.fc34.x86_64/gdk/gdkwindow.c" starts at address 0x7f6778d802a0 <gdk_window_end_draw_frame+224> and ends at 0x7f6778d802b0 <gdk_window_end_draw_frame+240>. Line 17609 of "/usr/src/debug/gtk3-3.24.29-1.fc34.x86_64/gtk/gtkwidget.c" starts at address 0x7f67791e3a00 <gtk_widget_render+304> and ends at 0x7f67791e3a10 <gtk_widget_render+320>. Line 1946 of "/usr/src/debug/gtk3-3.24.29-1.fc34.x86_64/gtk/gtkmain.c" starts at address 0x7f677908920b <gtk_main_do_event+3451> and ends at 0x7f6779089213 <gtk_main_do_event+3459>. Line 786 of "/usr/src/debug/gtk3-3.24.29-1.fc34.x86_64/gdk/gdkdnd.c" starts at address 0x7f6778d697d3 <_gdk_event_emit+99> and ends at 0x7f6778d697d6 <_gdk_event_emit+102>. Line 3874 of "/usr/src/debug/gtk3-3.24.29-1.fc34.x86_64/gdk/gdkwindow.c" starts at address 0x7f6778d7c179 <_gdk_window_process_updates_recurse_helper+537> and ends at 0x7f6778d7c190 <_gdk_window_process_updates_recurse_helper+560>. Line 4022 of "/usr/src/debug/gtk3-3.24.29-1.fc34.x86_64/gdk/gdkwindow.c" starts at address 0x7f6778d81251 <gdk_window_process_updates_internal+337> and ends at 0x7f6778d81258 <gdk_window_process_updates_internal+344>. Line 3767 of "/usr/src/debug/gtk3-3.24.29-1.fc34.x86_64/gdk/gdkwindow.c" starts at address 0x7f6778d81448 <gdk_window_process_updates_with_mode+264> and ends at 0x7f6778d8145a <gdk_window_process_updates_with_mode+282>. Line 296 of "../gobject/gclosure.c" starts at address 0x7f677895783a <g_signal_emit_valist+4426> and ends at 0x7f6778957847 <g_signal_emit_valist+4439>. Line 3554 of "../gobject/gsignal.c" starts at address 0x7f6778957983 <g_signal_emit+147> and ends at 0x7f67789579a0 . Line 658 of "/usr/src/debug/gtk3-3.24.29-1.fc34.x86_64/gdk/gdkframeclock.c" starts at address 0x7f6778d76c9f <gdk_frame_clock_paint_idle+1135> and ends at 0x7f6778d76ca8 <gdk_frame_clock_paint_idle+1144>. Line 769 of "/usr/src/debug/gtk3-3.24.29-1.fc34.x86_64/gdk/gdk.c" starts at address 0x7f6778d63317 <gdk_threads_dispatch+39> and ends at 0x7f6778d63320 <gdk_threads_dispatch+48>. Line 4889 of "../glib/gmain.c" starts at address 0x7f6779827d21 <g_timeout_dispatch+33> and ends at 0x7f6779827d24 <g_timeout_dispatch+36>. Line 3338 of "../glib/gmain.c" starts at address 0x7f67798274cf <g_main_context_dispatch+415> and ends at 0x7f67798274d3 <g_main_context_dispatch+419>. Line 4131 of "../glib/gmain.c" starts at address 0x7f677987b4e8 <g_main_context_iterate.constprop.0+728> and ends at 0x7f677987b4f0 <g_main_context_iterate.constprop.0+736>. Line 4328 of "../glib/gmain.c" starts at address 0x7f6779826a93 <g_main_loop_run+115> and ends at 0x7f6779826a95 <g_main_loop_run+117>. Line 365 of "core/main.c" starts at address 0x560bd90ec297 <main+2151> and ends at 0x560bd90ec29f <main+2159>. Line 332 of "../csu/libc-start.c" starts at address 0x7f677962ab75 <libc_start_main+213> and ends at 0x7f677962ab77 <libc_start_main+215>. No line number information available for address 0x560bd90ec69e <_start+46>

paravoid commented 3 years ago

I was experiencing the same extreme lag to the point of unusability after a few weeks of uptime on my Debian bullseye system. @jankratochvil thank you so much for identifying that virtual desktop switches triggers this leak easily, this helped me tremendously in tracking down the culprit. I performed a git bisect, and ultimately tracked down the offending commit, read it, and from then on identified where the leak happens. PR #688 contains a fix, that I've also tested with both master, and cherry-picked on top of Debian bullseye's s 1.24.1, and everything seems to work. Hope that helps you as well!

jankratochvil commented 3 years ago

It is now tracked as issue #688.