GNOME Bugzilla – Bug 733982
[Regression] Do not crash when checking whether an instance type is of a given fundamental
Last modified: 2014-08-08 09:23:41 UTC
Created attachment 282070 [details] [review] Patch The issue was introduced on the commit for bug #730984. What happens is that using g_type_check_instance_is_fundamentally_a (used by G_IS_OBJECT and others) crash when passing an instance of GstEvent (and probably any other GBoxed type). The thing is that not all GType instances have a TypeNode associated. I found the issue when using GST_DEBUG to debug an app and the crash would happen every time GST_DEBUG were used with GST_PTR_FORMAT on a GstEvent instance which in the end would call G_IS_OBJECT on the instance, causing the crash. The crash can be easily reproduced with the following code: ev = gst_event_new_eos (); fprintf (stderr, "event is object=%d\n", G_IS_OBJECT (ev)); Fix attached.
Sounds like a sane fix, avoids crashes when used with random pointer values.
Pushed as: commit 4b5bdf6cebc4c1b7c6db7e23c678cc2f5003e757 Author: Andre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk> Date: Tue Jul 29 21:04:48 2014 -0300 Do not crash when checking whether an instance type is of a given fundamental. Not all instances have a TypeNode associated (e.g. GstEvent), so lets check if node is available before trying to use it. This crash can be easily reproduced by creating an event with gst_event_new_eos and using G_IS_OBJECT on the event instance. https://bugzilla.gnome.org/show_bug.cgi?id=733982
Since the initial commit was in 2.40.0, do we want to also have this fix in the 2.40 branch ?