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 723741 - segfault when clients disconnect
segfault when clients disconnect
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-rtsp-server
git master
Other Linux
: Normal normal
: 1.2.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-02-06 08:21 UTC by Ognyan Tonchev (redstar_)
Modified: 2014-02-25 22:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
thread-pool: Unref source after mainloop has quit to avoid races in GLib (1.71 KB, patch)
2014-02-06 08:21 UTC, Ognyan Tonchev (redstar_)
none Details | Review

Description Ognyan Tonchev (redstar_) 2014-02-06 08:21:17 UTC
Created attachment 268258 [details] [review]
thread-pool: Unref source after mainloop has quit to avoid races in GLib

gst_rtsp_thread_stop() triggers a race in GLib (https://bugzilla.gnome.org/show_bug.cgi?id=720186) which causes trouble when clients disconnect.
What happens is while the main loop is freed it also unreffs its context, at the same time thread_stop() tries to unref the idle source which on the other hand tries to lock the context mutex. But there is no guarantee that the context pointer is valid since the source does not hold a ref to it.

The patch attached to this ticket implements a workaround for the GLib problem in gst-rtsp-server. The source is now part of the ThreadImpl and it is unreffed after the main loop quits.
Comment 1 Wim Taymans 2014-02-06 09:38:23 UTC
commit b1845b0864aa0f60d81a8fef77a7b829a1e3e8f4
Author: Ognyan Tonchev <ognyan@axis.com>
Date:   Thu Feb 6 09:03:50 2014 +0100

    thread-pool: Unref source after mainloop has quit to avoid races in GLib
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=723741