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 761226 - rtspmedia: Missing lock various functions (or the curious case of the duplicate unlocks)
rtspmedia: Missing lock various functions (or the curious case of the duplica...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-rtsp-server
git master
Other All
: Normal normal
: 1.6.4
Assigned To: GStreamer Maintainers
GStreamer Maintainers
1.6.4
Depends on:
Blocks:
 
 
Reported: 2016-01-28 08:13 UTC by stevenhoving
Modified: 2016-04-14 17:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to fix the unlocking/locking issue (1.18 KB, patch)
2016-01-28 08:27 UTC, stevenhoving
committed Details | Review

Description stevenhoving 2016-01-28 08:13:39 UTC
In the following functions there is a locking issue, that is best described as a curious case of 'duplicate unlocks'.

file: gst/rtsp-server/rtsp-media.c
functions:
- gst_rtsp_media_get_retransmission_time
- gst_rtsp_media_get_latency
- gst_rtsp_media_is_time_provider

example:
guint
gst_rtsp_media_get_latency (GstRTSPMedia * media)
{
  GstRTSPMediaPrivate *priv;
  guint res;

  g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), FALSE);

  priv = media->priv;

  g_mutex_unlock (&priv->lock); // <<<<<------ should be g_mutex_lock
  res = priv->latency;
  g_mutex_unlock (&priv->lock);

  return res;
}
Comment 1 stevenhoving 2016-01-28 08:27:23 UTC
Created attachment 319898 [details] [review]
patch to fix the unlocking/locking issue
Comment 2 Sebastian Dröge (slomo) 2016-01-28 08:36:24 UTC
commit fefc011dfbc0f727f212baa2759434e1591e1821
Author: Steven Hoving <sh@bigbrother.nl>
Date:   Thu Jan 28 09:22:18 2016 +0100

    rtsp-media: Fix mutex beeing unlocked while they should be locked
    
    https://bugzilla.gnome.org/show_bug.cgi?id=761226
Comment 3 Tim-Philipp Müller 2016-01-28 09:19:56 UTC
Picked into 1.6 branch as well.