GNOME Bugzilla – Bug 727851
Pitivi Clutter Sink segfaults when not run in GNOME Shell
Last modified: 2014-10-06 17:16:08 UTC
To reproduce: * Run Pitivi in GNOME Classic or any other window manager Related Arch Linux Bug: https://bugs.archlinux.org/task/39714
Bisection of pitivi confirmed my thesis that it's the new sink fea934d44b07dfc578d64c0faeae0a4bf7825666 is the first bad commit commit fea934d44b07dfc578d64c0faeae0a4bf7825666 Author: Mathieu Duponchelle <mduponchelle1@gmail.com> Date: Wed Oct 2 04:07:27 2013 +0200 viewer: First commit to prove the cluttersink concept.
Created attachment 273831 [details] Full clutter gstreamer sink example Example of a Clutter GStreamer sink in a Gtk window. It runs only in GNOME Shell, when Gdk is imported. Otherwise it fails like in GNOME Classic. It runs on both window managers when the Gtk.Label is empty, like so: label = Gtk.Label("")
Created attachment 273832 [details] Minimal example of the crash The crash occurs when Gdk is not imported under GNOME Shell. In GNOME Classic it occurs when ClutterGst is initialized or the Gtk.Label is not empty.
Created attachment 273833 [details] Backtrace of the crash in Cairo / X11 / Threading
Also seen on KDE on Ubuntu: https://bugs.launchpad.net/ubuntu/+source/pitivi/+bug/1307746
As GI_Jack pointed out at the Arch Linux bug tracker, the crash does not occur when Pitivi (and also the examples provided by me) is run as root.
Created attachment 276029 [details] IRC log about XInitThreads and GstClutter import ordering This seems related to an issue discussed by Mathieu in irc a while ago, attaching snipped log but the links to the pasted examples no longer work. I think Gdk needs to be imported first to trigger XInitThreads. Also note that importing Gdk or Gtk calls Gdk.init_check() or Gtk.init_check() automatically. I'm not sure why importing Gdk doesn't fix the problem in GNOME Classic though, but notice this statement from the log: "...if want to use ClutterGst and GtkClutter in python you have to do : Gdk.init() then GtkClutter.init() then ClutterGst.init() , and noother sequence will work..."
Initializing everything in said order does not fix the problem. It still crashes in non-GNOME Shell window managers. Tested in GNOME Classic and XFCE.
Building with cerbero from thibault's gi+pitivi branch fixes the problem. So it could be the gst build of Ubuntu and Arch that is wrong.
Created attachment 277555 [details] [review] fix the crash This patch fixes the crash, but produces warnings, as stated in https://bugzilla.gnome.org/show_bug.cgi?id=729643#c11 The timeline is also distached.
We are now using glimagesink. Closing the bug.
For anyone reading this downstream: the use of glimagesink also means a dependency on GStreamer 1.4