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 611719 - GST_DEBUG_OBJECT macros not fed with GObject* in gstpoll.c
GST_DEBUG_OBJECT macros not fed with GObject* in gstpoll.c
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other All
: Normal blocker
: 0.10.27
Assigned To: Tim-Philipp Müller
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-03-03 17:21 UTC by Xavi Artigas
Modified: 2010-03-04 18:42 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Xavi Artigas 2010-03-03 17:21:49 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.
Comment 1 Edward Hervey 2010-03-03 18:03:04 UTC
Can you provide a backtrace so we know exactly where the problem lies ?
Comment 2 Edward Hervey 2010-03-03 18:31:45 UTC
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).
Comment 3 Xavi Artigas 2010-03-04 09:13:38 UTC
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.
Comment 4 Tim-Philipp Müller 2010-03-04 18:42:34 UTC
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!