After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 604938 - XError opening the "Save Screencast" dialog on gtk-2.18 onwards (client-side windows)
XError opening the "Save Screencast" dialog on gtk-2.18 onwards (client-side ...
Status: RESOLVED FIXED
Product: istanbul
Classification: Other
Component: general
HEAD CVS
Other Linux
: Normal normal
: ---
Assigned To: Zaheer Abbas Merali
Zaheer Abbas Merali
Depends on:
Blocks:
 
 
Reported: 2009-12-18 18:06 UTC by Dave Malcolm
Modified: 2010-04-22 23:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch from Colin Walters to try to get the xid on realization of the videowidget (1.00 KB, patch)
2009-12-18 18:17 UTC, Dave Malcolm
none Details | Review
Additional patch to fix preview video widget in save_window.py (572 bytes, patch)
2010-01-21 02:04 UTC, Jef "Waiter, there's a bug in my soup..err i mean code"Spaleta
none Details | Review

Description Dave Malcolm 2009-12-18 18:06:27 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
Comment 1 Dave Malcolm 2009-12-18 18:17:13 UTC
Created attachment 150014 [details] [review]
Patch from Colin Walters to try to get the xid on realization of the videowidget
Comment 2 Dave Malcolm 2009-12-18 18:29:33 UTC
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):
  • File "/usr/lib/python2.6/site-packages/istanbul/main/gst_player.py", line 52 in on_sync_message
    self.videowidget.set_sink(message.src)
  • File "/usr/lib/python2.6/site-packages/istanbul/main/save_window.py", line 53 in set_sink
    assert self._xid is not None AssertionError
<dmalcolm> however, at least one can record screencasts now, with the patch

Comment 3 Dave Malcolm 2009-12-18 18:38:02 UTC
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."
Comment 4 Dave Malcolm 2009-12-18 18:49:02 UTC
(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.
Comment 5 Jef "Waiter, there's a bug in my soup..err i mean code"Spaleta 2010-01-21 02:04:01 UTC
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
Comment 6 Zaheer Abbas Merali 2010-03-20 16:20:39 UTC
Fixed now in git with a different patch. Please test.

Thanks
Comment 7 Jef "Waiter, there's a bug in my soup..err i mean code"Spaleta 2010-04-22 23:39:56 UTC
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