mate-desktop / marco

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

Code dump when accessing from X2go with latest version (1.26.1) #746

Closed greenfoo closed 10 months ago

greenfoo commented 1 year ago

Today we upgraded our servers from Rocky 8.5 to Rocky 8.7, which includes "marco 1.26.1"

When accessing these servers from X2Go, windows are missing the "Close", "Minimize", "Maximize", ... buttons. Running "marco" from the terminal shows a "free(): Invalid pointer" message and produces a core dump.

Downgrading "marco" to the previous version ("1.22") fixes the issue.

I'm sorry I cannot provide more details or dig deeper into the problem (these are production servers and I cannot experiment with them now that we have found a "workaround")... If I'm posting this is in case someone else with the same issue finds this information useful.

Thanks and sorry for the lack of details.

raveit65 commented 1 year ago

marco- 1.22 isn't from epel repo. I recommend disable corps repo (non fedora standard). Maybe this is a result of conflicting repos? Beside from that marco on rocky8 works fine using VM and connecting with spice channel. So i guess it's more a problem with x2go. Sorry, i don't use use x2go, and my spare time is seriously limited nowadays. I can't test software which i don't use. And sorry again, without a stacktrace no one can help you.

lukefromdc commented 1 year ago

Wonder if rhis is yet another xpresent issue given the timing?

greenfoo commented 1 year ago

Sorry, i don't use use x2go, and my spare time is seriously limited nowadays. I can't test software which i don't use.

Completely understandable. Without a stacktrace there is not much to debug. I only created the ticket as a reference for others experiencing the same issue :)

raveit65 commented 1 year ago

Sounds similar to libwnck issue https://gitlab.gnome.org/GNOME/libwnck/-/issues/154

raveit65 commented 1 year ago

marco-1.24.2 with reduced glib required version runs fine with rocky.

From 4c44f6d991065a0a37116bd90fd727867fa08d96 Mon Sep 17 00:00:00 2001
From: raveit65 <mate@raveit.de>
Date: Fri, 24 Jun 2022 19:48:29 +0200
Subject: [PATCH] glib: build with 2.56.4 for epel8

---
 configure.ac          | 2 +-
 src/core/eventqueue.c | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 6b946ab6..498da2e6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -106,7 +106,7 @@ AC_ARG_ENABLE(shape,
 ## try definining HAVE_BACKTRACE
 AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])

-PKG_CHECK_MODULES(ALL, glib-2.0 >= 2.58.0)
+PKG_CHECK_MODULES(ALL, glib-2.0 >= 2.56.4)
 PKG_CHECK_MODULES(MARCO_MESSAGE, gtk+-3.0 >= $GTK_MIN_VERSION)
 PKG_CHECK_MODULES(MARCO_WINDOW_DEMO, gtk+-3.0 >= $GTK_MIN_VERSION)

diff --git a/src/core/eventqueue.c b/src/core/eventqueue.c
index c85fdc51..61b04295 100644
--- a/src/core/eventqueue.c
+++ b/src/core/eventqueue.c
@@ -71,7 +71,14 @@ meta_event_queue_new (Display *display, MetaEventQueueFunc func, gpointer data)
   g_source_add_poll (source, &eq->poll_fd);
   g_source_set_can_recurse (source, TRUE);

+#if GLIB_CHECK_VERSION (2, 58, 0)
   g_source_set_callback (source, G_SOURCE_FUNC (func), data, NULL);
+#else
+  g_source_set_callback (source,
+                         (GSourceFunc) (void (*)(void)) func,
+                         data,
+                         NULL);
+#endif

   g_source_attach (source, NULL);
   g_source_unref (source);
-- 
2.36.1

Completely understandable. Without a stacktrace there is not much to debug. I only created the ticket as a reference for others experiencing the same issue :)

Now you have all tools find a worse commit with git biscet between 1.26.1 and 1.24.1, good luck.......

raveit65 commented 1 year ago

Culprit commit is https://github.com/mate-desktop/marco/commit/d3add65f6960dd3c95aaa2fe63cc8c563747695d from this merge request https://github.com/mate-desktop/marco/pull/741 But this commit works fine with modern actual fedora releases. So the question is why this breaks rhel8 and his derivatives. I am pretty sure this will also break old releases from oldest distro ever, debian. @greenfoo Can you please test this scratch build https://koji.fedoraproject.org/koji/taskinfo?taskID=94529784

greenfoo commented 1 year ago

As I cannot install anything in the production server that might affect other users, I tried to extract the linked rpm as my non-privileged user and then directly run it like this:

$ pkill marco
$ LD_LIBRARY_PATH=./lib64/ ./bin/marco

(marco:795336): GLib-GIO-ERROR **: 23:35:19.740: Settings schema 'org.mate.Marco.general' does not contain a key named 'allow-tile-cycling'
Trace/breakpoint trap (core dumped)

If I get permission to clone the original machine to experiment in a test environment I will properly install it and report back.

Thanks.

raveit65 commented 1 year ago

But this commit works fine with modern actual fedora releases. So the question is why this breaks rhel8 and his derivatives.

Hmm, problem exists in actual fedora 36 VM with marco-1.26.1 too. Connecting to VM via x2go kills marco. So the issue might be reproducible with actual ubuntu, debian or other distros too.

raveit65 commented 1 year ago

I got a stacktrace from f36 VM

Thread 1 (Thread 0x7f51e469bf00 (LWP 3736)):
#0  0x00007f51e889d0ae in __GI___libc_free (mem=0x11d) at malloc.c:3363
        ar_ptr = <optimized out>
        p = <optimized out>
        err = <optimized out>
#1  0x00007f51e8651b6e in XResClientIdsDestroy (num_ids=<optimized out>, client_ids=<optimized out>) at /usr/src/debug/libXres-1.2.1-2.fc36.x86_64/src/XRes.c:326
        c = <optimized out>
#2  0x00007f51e8651c5f in XResQueryClientIds (dpy=0x55847e18aed0, num_specs=num_specs@entry=1, client_specs=client_specs@entry=0x7ffde11b0f90, num_ids=num_ids@entry=0x7ffde11b0f80, client_ids=client_ids@entry=0x7ffde11b0f88) at /usr/src/debug/libXres-1.2.1-2.fc36.x86_64/src/XRes.c:309
        info = <optimized out>
        req = <optimized out>
        rep = {type = 0 '\000', pad1 = 1 '\001', sequenceNumber = 491, length = 12582914, numIds = 9699332, pad2 = 0, pad3 = 0, pad4 = 0, pad5 = 0, pad6 = 0}
        c = <optimized out>
#3  0x00007f51e8c105e0 in get_local_pid (window=0x55847e5e4020) at core/window-props.c:312
        pid = -1
        num_ids = 0
        client_ids = 0x11d
        i = <optimized out>
        spec = {client = 12582914, mask = 2}
        pid = <optimized out>
#4  reload_net_wm_pid (window=0x55847e5e4020, value=0x55847e3bea28, initial=<optimized out>) at core/window-props.c:339
        pid = <optimized out>
#5  0x00007f51e8c1366d in meta_window_reload_properties_from_xwindow (window=window@entry=0x55847e5e4020, xwindow=12582914, properties=properties@entry=0x7ffde11b10d0, n_properties=n_properties@entry=20, initial=initial@entry=1) at core/window-props.c:154
        hooks = <optimized out>
        i = 1
        values = 0x55847e3bea00
        __func__ = "meta_window_reload_properties_from_xwindow"
#6  0x00007f51e8c136f5 in meta_window_reload_properties (window=window@entry=0x55847e5e4020, properties=properties@entry=0x7ffde11b10d0, n_properties=n_properties@entry=20, initial=initial@entry=1) at core/window-props.c:96
#7  0x00007f51e8c18758 in meta_window_new_with_attrs (display=0x55847e295590, xwindow=12582914, must_be_viewable=<optimized out>, attrs=<optimized out>) at core/window.c:626
        window = 0x55847e5e4020
        tmp = <optimized out>
        space = <optimized out>
        existing_wm_state = 0
        event_mask = 14680112
        flags = <optimized out>
        initial_props = {36, 285, 284, 67, 39, 283, 37, 281, 279, 297, 40, 70, 35, 308, 82, 343, 68, 309, 402, 351}
        i = 20
        has_shape = <optimized out>
        __func__ = "meta_window_new_with_attrs"
#8  0x00007f51e8c0b7ed in meta_screen_manage_all_windows (screen=0x55847e1ebb00) at core/screen.c:782
        info = 0x55847e3aea00
        window = <optimized out>
        test_window_owner = <optimized out>
        windows = 0x55847e257320 = {0x55847e3c6e70, 0x55847e3fd710, 0x55847e3c4740, 0x55847e3c5220, 0x55847e3aeb80, 0x55847e3b7780, 0x55847e3d3650, 0x55847e3aea00, 0x55847e3aacb0, 0x55847e3d6af0, 0x55847e3eeaa0, 0x55847e358910, 0x55847e40fff0, 0x55847e4b0200, 0x55847e512ef0, 0x55847e603f70, 0x55847e400dd0, 0x55847e413140, 0x55847e421c90, 0x55847e3e5e90, 0x55847e3ef1f0, 0x55847e3c80e0, 0x55847e3788a0, 0x55847e3b4230, 0x55847e39bfb0, 0x55847e41c530, 0x55847e424f00, 0x55847e3ef390, 0x55847e3bdf10, 0x55847e353000}
        list = 0x55847e461300 = {0x55847e3aea00, 0x55847e3aacb0, 0x55847e3d6af0, 0x55847e3eeaa0, 0x55847e358910, 0x55847e40fff0, 0x55847e4b0200, 0x55847e512ef0, 0x55847e603f70, 0x55847e400dd0, 0x55847e413140, 0x55847e421c90, 0x55847e3e5e90, 0x55847e3ef1f0, 0x55847e3c80e0, 0x55847e3788a0, 0x55847e3b4230, 0x55847e39bfb0, 0x55847e41c530, 0x55847e424f00, 0x55847e3ef390, 0x55847e3bdf10, 0x55847e353000}
#9  0x00007f51e8c024a8 in meta_display_open () at core/display.c:752
        screen = <optimized out>
        xdisplay = 0x55847e18aed0
        screens = <optimized out>
        tmp = 0x55847e289a30 = {0x55847e1ebb00}
        i = 1
        timestamp = <optimized out>
        atom_names = {0x7f51e8c463be "WM_PROTOCOLS", 0x7f51e8c463cb "WM_TAKE_FOCUS", 0x7f51e8c463d9 "WM_DELETE_WINDOW", 0x7f51e8c46660 "WM_STATE", 0x7f51e8c463ea "_MOTIF_WM_HINTS", 0x7f51e8c463fa "WM_CHANGE_STATE", 0x7f51e8c4640a "SM_CLIENT_ID", 0x7f51e8c46417 "WM_CLIENT_LEADER", 0x7f51e8c46428 "WM_WINDOW_ROLE", 0x7f51e8c46437 "UTF8_STRING", 0x7f51e8c46443 "WM_ICON_SIZE", 0x7f51e8c46450 "_KWM_WIN_ICON", 0x7f51e8c4645e "_MARCO_RESTART_MESSAGE", 0x7f51e8c46475 "_MARCO_RELOAD_THEME_MESSAGE", 0x7f51e8c473c8 "_MARCO_SET_KEYBINDINGS_MESSAGE", 0x7f51e8c46491 "_MARCO_TOGGLE_VERBOSE", 0x7f51e8c464a7 "_GTK_THEME_VARIANT", 0x7f51e8c464ba "_GTK_FRAME_EXTENTS", 0x7f51e8c464cd "_GTK_SHOW_WINDOW_MENU", 0x7f51e8c464e3 "_GTK_WORKAREAS", 0x7f51e8c464f2 "_MATE_PANEL_ACTION", 0x7f51e8c46505 "_MATE_PANEL_ACTION_MAIN_MENU", 0x7f51e8c46522 "_MATE_PANEL_ACTION_RUN_DIALOG", 0x7f51e8c46540 "_GNOME_WM_STRUT_AREA", 0x7f51e8c46555 "_MARCO_SENTINEL", 0x7f51e8c46565 "_MARCO_VERSION", 0x7f51e8c46574 "WM_CLIENT_MACHINE", 0x7f51e8c46586 "MANAGER", 0x7f51e8c4658e "TARGETS", 0x7f51e8c46596 "MULTIPLE", 0x7f51e8c4659f "TIMESTAMP", 0x7f51e8c4656c "VERSION", 0x7f51e8c465a9 "ATOM_PAIR", 0x7f51e8c465b3 "_NET_WM_SYNC_REQUEST", 0x7f51e8c465c8 "_NET_WM_SYNC_REQUEST_COUNTER", 0x7f51e8c465e5 "_NET_WM_VISIBLE_NAME", 0x7f51e8c465fa "_NET_WM_VISIBLE_ICON_NAME", 0x7f51e8c46614 "_NET_SUPPORTING_WM_CHECK", 0x7f51e8c4662d "_NET_SUPPORTED", 0x7f51e8c4663c "_NET_WM_NAME", 0x7f51e8c46649 "_NET_CLOSE_WINDOW", 0x7f51e8c4665b "_NET_WM_STATE", 0x7f51e8c46669 "_NET_WM_STATE_SHADED", 0x7f51e8c4667e "_NET_WM_STATE_MAXIMIZED_HORZ", 0x7f51e8c4669b "_NET_WM_STATE_MAXIMIZED_VERT", 0x7f51e8c466b8 "_NET_WM_DESKTOP", 0x7f51e8c466c8 "_NET_NUMBER_OF_DESKTOPS", 0x7f51e8c466e0 "_NET_CURRENT_DESKTOP", 0x7f51e8c4532b "_NET_WM_WINDOW_TYPE", 0x7f51e8c4533f "_NET_WM_WINDOW_TYPE_DESKTOP", 0x7f51e8c4535b "_NET_WM_WINDOW_TYPE_DOCK", 0x7f51e8c453fa "_NET_WM_WINDOW_TYPE_TOOLBAR", 0x7f51e8c45374 "_NET_WM_WINDOW_TYPE_MENU", 0x7f51e8c4538d "_NET_WM_WINDOW_TYPE_DIALOG", 0x7f51e8c453a8 "_NET_WM_WINDOW_TYPE_NORMAL", 0x7f51e8c466f5 "_NET_WM_STATE_MODAL", 0x7f51e8c46709 "_NET_CLIENT_LIST", 0x7f51e8c4671a "_NET_CLIENT_LIST_STACKING", 0x7f51e8c46734 "_NET_WM_STATE_SKIP_TASKBAR", 0x7f51e8c4674f "_NET_WM_STATE_SKIP_PAGER", 0x7f51e8c46768 "_NET_WM_ICON_NAME", 0x7f51e8c4677a "_NET_WM_ICON", 0x7f51e8c46787 "_NET_WM_ICON_GEOMETRY", 0x7f51e8c4679d "_NET_WM_MOVERESIZE", 0x7f51e8c467b0 "_NET_ACTIVE_WINDOW", 0x7f51e8c467c3 "_NET_WM_STRUT", 0x7f51e8c467d1 "_NET_WM_STATE_HIDDEN", 0x7f51e8c453c3 "_NET_WM_WINDOW_TYPE_UTILITY", 0x7f51e8c453df "_NET_WM_WINDOW_TYPE_SPLASH", 0x7f51e8c467e6 "_NET_WM_STATE_FULLSCREEN", 0x7f51e8c467ff "_NET_WM_PING", 0x7f51e8c4680c "_NET_WM_PID", 0x7f51e8c46818 "_NET_WORKAREA", 0x7f51e8c46826 "_NET_SHOWING_DESKTOP", 0x7f51e8c4683b "_NET_DESKTOP_LAYOUT", 0x7f51e8c4684f "_NET_DESKTOP_NAMES", 0x7f51e8c46862 "_NET_WM_ALLOWED_ACTIONS", 0x7f51e8c4687a "_NET_WM_ACTION_MOVE", 0x7f51e8c4688e "_NET_WM_ACTION_RESIZE", 0x7f51e8c468a4 "_NET_WM_ACTION_SHADE", 0x7f51e8c468b9 "_NET_WM_ACTION_STICK", 0x7f51e8c468ce "_NET_WM_ACTION_MAXIMIZE_HORZ", 0x7f51e8c468eb "_NET_WM_ACTION_MAXIMIZE_VERT", 0x7f51e8c46908 "_NET_WM_ACTION_CHANGE_DESKTOP", 0x7f51e8c46926 "_NET_WM_ACTION_CLOSE", 0x7f51e8c4693b "_NET_WM_STATE_ABOVE", 0x7f51e8c4694f "_NET_WM_STATE_BELOW", 0x7f51e8c46963 "_NET_STARTUP_ID", 0x7f51e8c46973 "_NET_WM_STRUT_PARTIAL", 0x7f51e8c46989 "_NET_WM_ACTION_FULLSCREEN", 0x7f51e8c469a3 "_NET_WM_ACTION_MINIMIZE", 0x7f51e8c469bb "_NET_FRAME_EXTENTS", 0x7f51e8c469ce "_NET_REQUEST_FRAME_EXTENTS", 0x7f51e8c469e9 "_NET_WM_USER_TIME", 0x7f51e8c473e8 "_NET_WM_STATE_DEMANDS_ATTENTION", 0x7f51e8c469fb "_NET_MOVERESIZE_WINDOW", 0x7f51e8c46a12 "_NET_DESKTOP_GEOMETRY", 0x7f51e8c46a28 "_NET_DESKTOP_VIEWPORT", 0x7f51e8c46a3e "_NET_WM_USER_TIME_WINDOW", 0x7f51e8c46a57 "_NET_WM_ACTION_ABOVE", 0x7f51e8c46a6c "_NET_WM_ACTION_BELOW", 0x7f51e8c46a81 "_NET_WM_STATE_STICKY", 0x7f51e8c46a96 "_NET_WM_FULLSCREEN_MONITORS", 0x7f51e8c46ab2 "_NET_WM_STATE_FOCUSED"}
        atoms = {70, 274, 71, 119, 343, 344, 345, 272, 275, 81, 38, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 36, 327, 75, 361, 80, 362, 363, 296, 297, 364, 365, 318, 366, 284, 367, 82, 368, 292, 291, 281, 369, 277, 298, 370, 371, 372, 303, 300, 304, 290, 373, 374, 293, 294, 283, 282, 375, 376, 276, 377, 289, 307, 378, 83, 286, 285, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 287, 288, 279, 392, 393, 394, 278, 395, 308, 396, 397, 398, 399, 309, 400, 401, 295, 402, 312}
        __func__ = "meta_display_open"
#10 0x000055847cb89247 in main (argc=<optimized out>, argv=<optimized out>) at core/main.c:553
        act = {__sigaction_handler = {sa_handler = 0x55847cb896d0 <sigterm_handler>, sa_sigaction = 0x55847cb896d0 <sigterm_handler>}, sa_mask = {__val = {0, 94027539506848, 94027539505776, 139989771848832, 94027539505952, 139989770421778, 144, 0, 0, 94027539506848, 184, 94027539507248, 94027539506832, 26, 94027539465408, 0}}, sa_flags = 0, sa_restorer = 0x7f51e7b00c10 <type_rw_lock>}
        empty_mask = {__val = {0, 94027539506848, 94027539505776, 139989771848832, 94027539505952, 139989770421778, 144, 0, 0, 94027539506848, 184, 94027539507248, 94027539506832, 26, 94027539465408, 0}}
        meta_args = {save_file = 0x0, display_name = 0x0, client_id = 0x55847e222c30 "\035\b", replace_wm = 0, disable_sm = 0, print_version = <optimized out>, sync = <optimized out>, composite = <optimized out>, no_composite = <optimized out>, no_force_fullscreen = <optimized out>}
        log_domains = {0x0, 0x55847cb8a0af "marco", 0x55847cb8a0b5 "Gtk", 0x55847cb8a0b9 "Gdk", 0x55847cb8a0bd "GLib", 0x55847cb8a0c2 "Pango", 0x55847cb8a0c8 "GLib-GObject", 0x55847cb8a0d5 "GThread"}
        i = <optimized out>
        channel = <optimized out>

full stacktrace: https://www.dropbox.com/s/tv8s51wsfllrzbr/backtrace_marco_x2go-session?dl=0

joakim-tjernlund commented 1 year ago

Culprit commit is d3add65 from this merge request #741 But this commit works fine with modern actual fedora releases. So the question is why this breaks rhel8 and his derivatives. I am pretty sure this will also break old releases from oldest distro ever, debian. @greenfoo Can you please test this scratch build https://koji.fedoraproject.org/koji/taskinfo?taskID=94529784

Seems like this patch should check XResQueryClientIds() return value and then fallback directly on the old way. Also, marco should do its own query from the extension and not rely on libwnck to do it

joakim-tjernlund commented 1 year ago

This is fixed in git marco, will be in release 1.26.2

raveit65 commented 10 months ago

Closing, as fix is in master and 1.26.2