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 727851 - Pitivi Clutter Sink segfaults when not run in GNOME Shell
Pitivi Clutter Sink segfaults when not run in GNOME Shell
Status: RESOLVED FIXED
Product: pitivi
Classification: Other
Component: General
0.93
Other Linux
: High blocker
: 0.94
Assigned To: Pitivi maintainers
Pitivi maintainers
Depends on: 729643
Blocks:
 
 
Reported: 2014-04-08 17:05 UTC by Lubosz Sarnecki
Modified: 2014-10-06 17:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Full clutter gstreamer sink example (1.15 KB, text/x-python)
2014-04-08 19:48 UTC, Lubosz Sarnecki
  Details
Minimal example of the crash (444 bytes, text/x-python)
2014-04-08 19:50 UTC, Lubosz Sarnecki
  Details
Backtrace of the crash in Cairo / X11 / Threading (5.96 KB, text/x-log)
2014-04-08 19:51 UTC, Lubosz Sarnecki
  Details
IRC log about XInitThreads and GstClutter import ordering (7.15 KB, text/plain)
2014-05-06 22:16 UTC, Simon Feltman
  Details
fix the crash (823 bytes, patch)
2014-05-30 14:44 UTC, Lubosz Sarnecki
none Details | Review

Description Lubosz Sarnecki 2014-04-08 17:05:57 UTC
To reproduce:

* Run Pitivi in GNOME Classic or any other window manager

Related Arch Linux Bug:

https://bugs.archlinux.org/task/39714
Comment 1 Lubosz Sarnecki 2014-04-08 17:32:14 UTC
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.
Comment 2 Lubosz Sarnecki 2014-04-08 19:48:40 UTC
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("")
Comment 3 Lubosz Sarnecki 2014-04-08 19:50:33 UTC
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.
Comment 4 Lubosz Sarnecki 2014-04-08 19:51:36 UTC
Created attachment 273833 [details]
Backtrace of the crash in Cairo / X11 / Threading
Comment 5 Jean-François Fortin Tam 2014-04-14 23:57:24 UTC
Also seen on KDE on Ubuntu:
https://bugs.launchpad.net/ubuntu/+source/pitivi/+bug/1307746
Comment 6 Lubosz Sarnecki 2014-04-20 13:45:00 UTC
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.
Comment 7 Simon Feltman 2014-05-06 22:16:37 UTC
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..."
Comment 8 Lubosz Sarnecki 2014-05-07 08:15:23 UTC
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.
Comment 9 Lubosz Sarnecki 2014-05-11 10:28:21 UTC
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.
Comment 10 Lubosz Sarnecki 2014-05-30 14:44:48 UTC
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.
Comment 11 Thibault Saunier 2014-09-28 23:03:25 UTC
We are now using glimagesink. Closing the bug.
Comment 12 Jean-François Fortin Tam 2014-10-06 17:16:08 UTC
For anyone reading this downstream: the use of glimagesink also means a dependency on GStreamer 1.4