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 679081 - establishing parent-child relation not consistent with design docs
establishing parent-child relation not consistent with design docs
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-06-28 19:02 UTC by Tomasz
Modified: 2014-04-10 07:00 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Tomasz 2012-06-28 19:02:39 UTC
There is description of establishing parent-child relation in the design documentation:
http://cgit.freedesktop.org/gstreamer/gstreamer/tree/docs/design/part-relations.txt

It is stated here, that set_parent() is called on child WITHOUT lock on the parent.

However such establishment in gstreamer code (e.g. gstelement.c:gst_element_add_pad(), gstbin.c:gst_bin_add_func()) calls set_parent() with lock on the parent. In 0.10.36 gst_object_set_parent() called signal "PARENT_SET" which could call deadlock if this signal tried to lock the parent. In 0.11.92 signal calling is commented out and denoted "FIXME".

Why not just make code consistent with design doc and call set_parent() on child without lock on the parent?
Comment 1 Tim-Philipp Müller 2012-09-27 22:12:02 UTC
Wim?
Comment 2 Wim Taymans 2012-12-10 12:31:10 UTC
The design docs lists the absolute minimal requirements to implement the parent-child relationship. Implementations can choose to use whatever locking they want around the set_parent() call as long as the defined locking order is preserved.

What is the problem here?
Comment 3 Tomasz 2012-12-10 18:00:41 UTC
The problem is, if we try to lock parent in "PARENT_SET" signal handler, a deadlock occurs.
Comment 4 Tim-Philipp Müller 2012-12-10 18:49:21 UTC
For what it's worth, in 1.0 there's no more "parent-set" signal, and no "notify::parent" either, presumably for that exact same reason:

  /* FIXME, this does not work, the deep notify takes the lock from the parent
   * object and deadlocks when the parent holds its lock when calling this
   * function (like _element_add_pad()) */
  /* g_object_notify_by_pspec ((GObject *)object, properties[PROP_PARENT]); */
Comment 5 Edward Hervey 2014-04-10 06:28:10 UTC
Shall we close this bug then if it's no longer valid in 1.x ?