GNOME Bugzilla – Bug 760188
GDK's X11 backend leaks SyncCounters
Last modified: 2016-01-11 13:43:45 UTC
Created attachment 318300 [details] [review]
A patch adding the missing destroy call
GDK appears to create two X11 SyncCounters per GdkWindow (update_counter and extended_update_counter) however only frees one of them (update_counter). This results in rampant resource leakage in long-running applications (in my case gnome-terminal) eventually making the user's X11 session quite unusable.
Attached is an untested patch. I'll try to test tomorrow.
Review of attachment 318300 [details] [review]:
Looks correct. If your testing works out, please push this
Now I am getting XSyncBadCounter error. It looks like set_sync_counter can be called with counter == None and XSyncSetCounter does not like it.
Probably can be fixed by adding this in set_sync_counter:
if (counter == None)
(In reply to Alberts Muktupāvels from comment #2)
> Now I am getting XSyncBadCounter error. It looks like set_sync_counter can
> be called with counter == None and XSyncSetCounter does not like it.
> Probably can be fixed by adding this in set_sync_counter:
> if (counter == None)
that would just be working around the symptom. I'd rather understand why this patch introduced a problem for you.
How do you reproduce your XSyncBadCounter ? I've tried under metacity, and didn't see any
Created attachment 318487 [details]
does this help ?
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 9f189ad..cca924d 100644
@@ -1323,6 +1323,8 @@ gdk_x11_window_destroy (GdkWindow *window,
gdk_toplevel_x11_free_contents (GDK_WINDOW_DISPLAY (window), toplevel);
+ unhook_surface_changed (window);
(In reply to Matthias Clasen from comment #6)
> does this help ?
No. :( on_surface_changed is still called.
Can you get a stacktrace with that patch, please ?
Created attachment 318512 [details]
I've been running this since the 2016-01-08 or so and have had no issues.