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 501562 - [switch] bogus locking order
[switch] bogus locking order
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 0.10.6
Assigned To: Zaheer Abbas Merali
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-12-04 16:35 UTC by Andy Wingo
Modified: 2008-01-12 20:43 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Andy Wingo 2007-12-04 16:35:45 UTC
The code in gstswitch.c appears to have a locking order of OBJECT_LOCK, SWITCH_LOCK. This is bogus. Although the code attempts to get this right, there are still some errors like in the release_request_pad function:

  GST_OBJECT_LOCK (gstswitch);
  gstswitch->nb_sinkpads--;
  GST_SWITCH_LOCK (gstswitch);
  if (gstswitch->active_sinkpad == pad) {
    gst_object_unref (gstswitch->active_sinkpad);
    gstswitch->active_sinkpad = NULL;
    if (gstswitch->nb_sinkpads == 0) {
      GstIterator *iter =
          gst_element_iterate_sink_pads (GST_ELEMENT (gstswitch));
      gpointer active_sinkpad_store = (gpointer) gstswitch->active_sinkpad;

The proper solution is to make the locking order SWITCH_LOCK, OBJECT_LOCK.
Comment 1 Andy Wingo 2008-01-12 20:43:29 UTC
Happily since I replaced this code, I can close this bug!