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 756556 - adaptivedemux: hang if application quits just after start
adaptivedemux: hang if application quits just after start
Status: RESOLVED DUPLICATE of bug 755169
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other All
: Normal major
: 1.7.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 756619 (view as bug list)
Depends on: 755169
Blocks:
 
 
Reported: 2015-10-14 09:05 UTC by Rajat Verma
Modified: 2015-10-29 11:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gdb stack trace, when application hangs (12.91 KB, text/plain)
2015-10-14 09:05 UTC, Rajat Verma
Details

Description Rajat Verma 2015-10-14 09:05:21 UTC
Created attachment 313248 [details]
gdb stack trace, when application hangs

I am playing HLS bipbop stream (https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/bipbop_4x3_variant.m3u8)

Sometimes, if application tries to quit just at start of playback, it hangs.

Attached is gdb stack trace
Comment 1 Rajat Verma 2015-10-14 11:11:16 UTC
This looks like a race between below two threads:

application goes to clean up resources, calling
gstadaptivedemux.c: gst_adaptive_demux_change_state ()
  GST_STATE_CHANGE_PAUSED_TO_READY
  gst_adaptive_demux_reset ()
    gst_adaptive_demux_stop_tasks ()

and thread downloading the segments:
gst_adaptive_demux_stream_advance_fragment ()
  gst_adaptive_demux_stream_advance_fragment_unlocked()

which leads to resetting of variables: stream->demux->cancelled & stream->download_finished and thus the hang.
Comment 2 Sebastian Dröge (slomo) 2015-10-15 09:38:42 UTC
*** Bug 756619 has been marked as a duplicate of this bug. ***
Comment 3 Sebastian Dröge (slomo) 2015-10-15 09:39:34 UTC
Another similar backtrace in bug #756619
Comment 4 Florin Apostol 2015-10-15 09:54:51 UTC
bug https://bugzilla.gnome.org/show_bug.cgi?id=755169 will add support for thread safety in adaptive demux. Vincent has proposed a patch and I commented on it. I also proposed a patch that fixes all race conditions in adaptive demux. We need some maintainers to review those patches.
Comment 5 Florin Apostol 2015-10-15 11:42:36 UTC
the problem here is that gst_adaptive_demux_stop_tasks sets demux->cancelled = TRUE without grabbing a lock, so the value is probably not reflected in other threads.
Comment 6 Vincent Penquerc'h 2015-10-15 16:07:21 UTC
I cannot reproduce this with Florin's patch referenced above. cancelled is always protected by the download lock in that patch.
Comment 7 Vincent Penquerc'h 2015-10-29 11:23:37 UTC

*** This bug has been marked as a duplicate of bug 755169 ***