GNOME Bugzilla – Bug 604938
XError opening the "Save Screencast" dialog on gtk-2.18 onwards (client-side windows)
Last modified: 2010-04-22 23:39:56 UTC
We're seeing a lot of crash reports for Istanbul downstream in Fedora's tracker here: https://bugzilla.redhat.com/show_bug.cgi?id=543278 The symptom is that Istanbul crashes with an "XError" when opening the "Save Screencast" dialog. I can reliably trigger this XError assertion failure on an F12 laptop by 1: launch istanbul, e.g. from command line, using: $ gdb --args python /usr/bin/istanbul --sync (gdb) break gdk_x_error (gdb) run 2: istanbul icon appears in panel; click on it to start recording 3: click on it to stop recording 4: file save dialog starts appearing, but the XError abort happens before it can fully appear. Upon running "thread apply all backtrace" I see that another thread is communicating with the X server. See: https://bugzilla.redhat.com/show_bug.cgi?id=543278#c20 Backtrace of that thread: https://bugzilla.redhat.com/attachment.cgi?id=379251 and https://bugzilla.redhat.com/show_bug.cgi?id=543278#c22 We believe this has started happening due to the switch to Client-Side windows in gtk-2.18. It looks like the gstreamer callback "sync-message::element" happens in a worker thread (part of a thread pool), rather than the main thread. This calls back into python code, which in istanbul/main/save_window.py:set_sink runs: assert self.window.xid which causes a call to _wrap_gdk_drawable__get_xid. This causes a call to gdk_window_x11_set_background, which calls: XSetWindowBackground, and thus you have multiple threads talking to the X server over the same socket, and thus an XError. http://library.gnome.org/devel/gtk/stable/gtk-migrating-ClientSideWindows.html Am about to attach a patch to fix this
Created attachment 150014 [details] [review] Patch from Colin Walters to try to get the xid on realization of the videowidget
Above patch partially fixes this for me; however, set_sink appears to be being called before the widget is realized, and I get: Traceback (most recent call last):
+ Trace 219676
self.videowidget.set_sink(message.src)
assert self._xid is not None AssertionError
From http://library.gnome.org/devel/gtk/stable/gtk-migrating-ClientSideWindows.html "A small gotcha is that the GDK_WINDOW_XID() call is no longer a trivial accessor for the XID of the window, and thus must not be called from another thread without taking locking precautions."
(In reply to comment #2) > Above patch partially fixes this for me; however, set_sink appears to be being > called before the widget is realized, and I get: > Traceback (most recent call last): On gtk-2.18 (client-side windows): ...without this patch, istanbul exits with a c-level assertion failure from inside GDK opening the "Save Screencast" dialog; Istanbul is thus unusable. ...with this patch, istanbul prints a python-level backtrace, but the program carries on; the only bug is that the video preview is in a separate top-level window to the rest of the "Save Screencast" dialog.
Created attachment 151909 [details] [review] Additional patch to fix preview video widget in save_window.py This short patch was contributed by Fedora user Johan Dobbelstein. This appears to solve the remaining problem with the preview video in the save dialog window on Fedora 12 with the client-side window code from GTK-2.18. Reference: https://bugzilla.redhat.com/show_bug.cgi?id=543278#c46
Fixed now in git with a different patch. Please test. Thanks
Good Alaskan Afternoon, I pulled istanbul git master today to test on Fedora 13 Beta and the problem reported in this bug appear to exist in istanbul git master. Istanbul 0.2.2 with the original fedora patchset appears to work on my system. Istanbul git master with no additional patches applied fails to render the Save window dialog and produces an X error. I'm going to try to find the difference between the existing patchset and istanbul git master and narrow down the problem. Zaheer I'll try to catch you tomorrow on irc and talk through it with you. -jef