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 615789 - [ximagesink] gst_ximagesink_xwindow_update_geometry: assertion `xwindow != NULL' failed
[ximagesink] gst_ximagesink_xwindow_update_geometry: assertion `xwindow != NU...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: 0.10.29
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-04-14 21:57 UTC by Tim-Philipp Müller
Modified: 2010-04-16 13:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
refactor _update_goemetry() (2.29 KB, patch)
2010-04-15 08:46 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
committed Details | Review
gracefully handle ximagesink>xwindow == NULL (1.79 KB, patch)
2010-04-15 10:03 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
committed Details | Review

Description Tim-Philipp Müller 2010-04-14 21:57:34 UTC
Just got this in totem with git:

tpm@zingle:~/gst/git/totem/src$ ./totem /path/to/foo.avi 

** (lt-totem:11866): CRITICAL **: gst_ximagesink_xwindow_update_geometry: assertion `xwindow != NULL' failed

Doesn't seem easy to reproduce though, must be a race of some sort.
Comment 1 Tim-Philipp Müller 2010-04-14 22:17:49 UTC
Stefan, any chance this may have been introduced by this commit of yours?

commit 7b13aeee329834a29642360f958f27a6ef23bcf7
Author: Stefan Kost <ensonic@users.sf.net>
Date:   Tue Feb 16 12:06:08 2010 +0200

    x(v)imagesink: take new size from event thread and do not poll for every frame
    
    We can update the geometry in ConfigureNotify (unless we disable event-
    handling). If event handling is disabled, one should use _expose() to trigger a
    redraw and update the geometry.
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2010-04-15 08:36:20 UTC
A backtrace would be nice. gst_ximagesink_xwindow_update_geometry is called from two places:

gst_ximagesink_expose()

gst_ximagesink_handle_xevents()
here it is called within
  while (XCheckWindowEvent (ximagesink->xcontext->disp,
          ximagesink->xwindow->win, ExposureMask | StructureNotifyMask, &e)) {

so the assert would trigger earlier. But then the check is a bit stupid nowadays. From the two places where we call with we pass ximagesink->xwindow as xwindow and inside gst_ximagesink_xwindow_update_geometry() deref ximagesink->xwindow again.

So the assert should either just check ximagesink->xwindow and we remove the extra parameter or we use the passed parameter.

The former change is already in xvimagesink. I attach a patch in a sec.
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2010-04-15 08:46:49 UTC
Created attachment 158789 [details] [review]
refactor _update_goemetry()
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2010-04-15 08:57:23 UTC
This could come from gst_ximagesink_expose(). We call this also from the event thread (both ximagesink and xvimagesink). The expose impl look like this:

  gst_ximagesink_xwindow_update_geometry (ximagesink);
  gst_ximagesink_ximage_put (ximagesink, NULL);

where _put is handling ximagesink>xwindow == NULL.

Simmilar we could drop the assert from _update_geometry() and add this check.

  if (G_UNLIKELY (ximagesink->xwindow == NULL)) {
    g_mutex_unlock (ximagesink->flow_lock);
    return;
  }
Comment 5 Tim-Philipp Müller 2010-04-15 08:59:30 UTC
Stack trace:

(gdb) bt
  • #0 *__GI_raise
    at ../nptl/sysdeps/unix/sysv/linux/raise.c line 64
  • #1 *__GI_abort
    at abort.c line 88
  • #2 IA__g_logv
    at /tmp/buildd/glib2.0-2.24.0/glib/gmessages.c line 549
  • #3 IA__g_log
    at /tmp/buildd/glib2.0-2.24.0/glib/gmessages.c line 569
  • #4 gst_ximagesink_xwindow_update_geometry
    at ximagesink.c line 926
  • #5 gst_ximagesink_expose
    at ximagesink.c line 2059
  • #6 bacon_video_widget_configure_event
    at bacon-video-widget-gst-0.10.c line 672
  • #7 _gtk_marshal_BOOLEAN__BOXED
    at /build/buildd-gtk+2.0_2.20.0-3-amd64-fSfAXS/gtk+2.0-2.20.0/gtk/gtkmarshalers.c line 84
  • #8 IA__g_closure_invoke
    at /tmp/buildd/glib2.0-2.24.0/gobject/gclosure.c line 767
  • #9 signal_emit_unlocked_R
    at /tmp/buildd/glib2.0-2.24.0/gobject/gsignal.c line 3248
  • #10 IA__g_signal_emit_valist
    at /tmp/buildd/glib2.0-2.24.0/gobject/gsignal.c line 2991
  • #11 IA__g_signal_emit
    at /tmp/buildd/glib2.0-2.24.0/gobject/gsignal.c line 3038
  • #12 gtk_widget_event_internal
    at /build/buildd-gtk+2.0_2.20.0-3-amd64-fSfAXS/gtk+2.0-2.20.0/gtk/gtkwidget.c line 4943
  • #13 IA__gtk_main_do_event
    at /build/buildd-gtk+2.0_2.20.0-3-amd64-fSfAXS/gtk+2.0-2.20.0/gtk/gtkmain.c line 1601
  • #14 gdk_event_dispatch
    at /build/buildd-gtk+2.0_2.20.0-3-amd64-fSfAXS/gtk+2.0-2.20.0/gdk/x11/gdkevents-x11.c line 2372
  • #15 g_main_dispatch
    at /tmp/buildd/glib2.0-2.24.0/glib/gmain.c line 1960
  • #16 IA__g_main_context_dispatch
    at /tmp/buildd/glib2.0-2.24.0/glib/gmain.c line 2513
  • #17 g_main_context_iterate
    at /tmp/buildd/glib2.0-2.24.0/glib/gmain.c line 2591
  • #18 IA__g_main_loop_run
    at /tmp/buildd/glib2.0-2.24.0/glib/gmain.c line 2799
  • #19 IA__gtk_main
    at /build/buildd-gtk+2.0_2.20.0-3-amd64-fSfAXS/gtk+2.0-2.20.0/gtk/gtkmain.c line 1219
  • #20 main
    at totem.c line 299

It seems fairly easy to produce if you start totem and press the 'F' key for fullscreen as soon as it comes up.
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2010-04-15 10:03:16 UTC
Created attachment 158798 [details] [review]
gracefully handle ximagesink>xwindow == NULL
Comment 7 Tim-Philipp Müller 2010-04-16 10:59:22 UTC
Comment on attachment 158798 [details] [review]
gracefully handle ximagesink>xwindow == NULL

Thanks, these patches fix the problem for me and look pretty harmless to me.