GNOME Bugzilla – Bug 611719
GST_DEBUG_OBJECT macros not fed with GObject* in gstpoll.c
Last modified: 2010-03-04 18:42:34 UTC
In gstreamer/gst/gstpoll.c there are several calls to GST_DEBUG_OBJECT and GST_WARNING_OBJECT which are not given a GObject* but a GstPoll* (which does not derive from GObject*). In Linux this does not appear to cause any harm, but in Windows it segfaults.
Can you provide a backtrace so we know exactly where the problem lies ?
The reason I asked for this is that normally gst_debug_print_object would take care of that (that would be the last line of the function).
Unfortunately, I do not have debug information for GLib in Visual Studio, so I cannot provide a complete backtrace. The last call I see is in gstinfo.c:603, function gst_debug_print_object (). The line says: if (GST_IS_PAD (object) && GST_OBJECT_NAME (object)) { And the crash is in the call to _g_type_check_instance_is_a(). Since object is not actually a GObject* but a GstPoll*, it's g_class member does not point to a _GTypeInstance. When _g_type_check_instance_is_a() dereferences g_class... boom. I hope this helps.
This can be reproduced on linux quite easily by changing line 494 from AUTO to: nset->mode = GST_POLL_MODE_PPOLL; This should fix it: commit 4cbf794b0eb3ad6fa8e02a5b3abc910c14a418d1 Author: Tim-Philipp Müller <tim.muller@collabora.co.uk> Date: Thu Mar 4 18:39:02 2010 +0000 gstpoll: don't pass non-objects as first argument to GST_DEBUG_OBJECT() This may cause crashes when logging is enabled, especially on windows. It's not safe to pass random pointers to g_type_check_instance_is_a(). Fixes #611719. Thanks for the bug report!