GNOME Bugzilla – Bug 723741
segfault when clients disconnect
Last modified: 2014-02-25 22:29:12 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.
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