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 734358 - Deadlock streaming an HD video
Deadlock streaming an HD video
Status: RESOLVED FIXED
Product: rygel
Classification: Applications
Component: GStreamer media engine
unspecified
Other Linux
: Normal normal
: ---
Assigned To: rygel-maint
rygel-maint
: 736135 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-08-06 12:37 UTC by Bastien Nocera
Modified: 2018-02-28 07:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
engine-gst: Guard read access to critical section (1013 bytes, patch)
2014-09-09 10:59 UTC, Debarshi Ray
committed Details | Review
engine-gst: Guard read access to critical section (1.08 KB, patch)
2014-09-11 13:13 UTC, Debarshi Ray
none Details | Review

Description Bastien Nocera 2014-08-06 12:37:07 UTC
While streaming an HD video from, after about 30 seconds to a minute, I get this deadlock.

  • #0 syscall
    at ../sysdeps/unix/sysv/linux/x86_64/syscall.S line 38
  • #1 g_mutex_lock_slowpath
    at gthread-posix.c line 1308
  • #2 g_mutex_lock
    at gthread-posix.c line 1332
  • #3 rygel_gst_sink_thaw
    at rygel-gst-sink.c line 196
  • #4 _g_closure_invoke_va
    at gclosure.c line 831
  • #5 g_signal_emit_valist
    at gsignal.c line 3218
  • #6 g_signal_emit
    at gsignal.c line 3365
  • #7 soup_message_wrote_chunk
    at soup-message.c line 1082
  • #8 io_run_until
    at soup-message-io.c line 457
  • #9 io_run_until
    at soup-message-io.c line 866
  • #10 io_run
    at soup-message-io.c line 936
  • #11 io_run_ready
    at soup-message-io.c line 915
  • #12 g_main_context_dispatch
    at gmain.c line 3064
  • #13 g_main_context_dispatch
    at gmain.c line 3663
  • #14 g_main_context_iterate
    at gmain.c line 3734
  • #15 g_main_loop_run
    at gmain.c line 3928
  • #16 main
    at rygel-main.c line 384
  • #17 main
    at rygel-main.c line 1330
  • #18 main
    at rygel-main.c line 1365
  • #0 syscall
    at ../sysdeps/unix/sysv/linux/x86_64/syscall.S line 38
  • #1 g_cond_wait
    at gthread-posix.c line 1390
  • #2 rygel_gst_sink_real_render
    at rygel-gst-sink.c line 284
  • #3 gst_base_sink_chain_unlocked
    at gstbasesink.c line 3425
  • #4 gst_base_sink_chain_main
    at gstbasesink.c line 3533
  • #5 gst_pad_push_data
    at gstpad.c line 3836
  • #6 gst_pad_push_data
    at gstpad.c line 4069
  • #7 gst_base_src_loop
    at gstbasesrc.c line 2835
  • #8 gst_task_func
    at gsttask.c line 317
  • #9 g_thread_pool_thread_proxy
    at gthreadpool.c line 307
  • #10 g_thread_proxy
    at gthread.c line 764
  • #11 start_thread
    at pthread_create.c line 310
  • #12 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 109


I'm fairly sure that the code in:
https://git.gnome.org/browse/rygel/tree/src/media-engines/gstreamer/rygel-gst-sink.vala#n80
isn't thread-safe and can deadlock.
Comment 1 Bastien Nocera 2014-08-06 12:37:22 UTC
rygel-0.23.2-1.fc21.x86_64
glib2-2.41.2-2.fc21.x86_64
Comment 2 Jens Georg 2014-08-24 09:14:26 UTC
Is there a way to reproduce this? I've never seen this.
Comment 3 Jussi Kukkonen 2014-08-25 08:20:31 UTC
I've never seen this either but I can't really argue with Bastien: checking this.frozen outside the mutex lock seems like an obvious thread safety violation, right?
Comment 4 Jens Georg 2014-08-25 08:39:30 UTC
yep
Comment 5 Bastien Nocera 2014-08-25 10:25:18 UTC
(In reply to comment #2)
> Is there a way to reproduce this? I've never seen this.

On my laptop, I'm sharing an SMB folder coming from my NAS. I'm reading the video from a set-top box. Transcoding is disabled.
Comment 6 Bastien Nocera 2014-09-08 16:52:51 UTC
*** Bug 736135 has been marked as a duplicate of this bug. ***
Comment 7 Bastien Nocera 2014-09-08 16:54:24 UTC
Debarshi hit the same bug in a different path. Could this be related to glib 2.41 mutex changes?

"
I am hitting this when trying to test the code for:
https://wiki.gnome.org/ThreePointThirteen/Features/BrowseDMSPhotos

I have rygel running on a second laptop serving a folder full of images. It
shows up as /com/intel/dLeynaServer/server/1 on my first laptop that is running
dleyna-server. I call SearchObjects on its org.gnome.UPnP.MediaContainer2
interface with these arguments:
  'Type = "image.photo"', 0, 0, ['URLs']

This gives me a bunch of URLs (eg.,
http://192.168.0.16:43669/MediaExport/i/YzlkMjc0NDFhZjA2MGVjNjBmZDc4OTI0NTFiYzc4ZmU%3D.JPG)
, but when I try to open one of them in a browser either it loads part of the
image or nothing at all.

At this point if I call Rescan and then GetServers on the
/com/intel/dLeynaServer object, then it does not show any servers.

I have:
dleyna-server-0.4.0
gupnp-0.20.12
rygel-0.22.3
libsoup-2.46.0
"
Comment 8 Debarshi Ray 2014-09-09 10:59:15 UTC
Created attachment 285727 [details] [review]
engine-gst: Guard read access to critical section

Untested, because I am having trouble building rygel on Fedora - gupnp-av-1.0 vs GUPnPAV-1.0, etc..
Comment 9 Jens Georg 2014-09-10 21:07:13 UTC
Attachment 285727 [details] pushed as b3066f3 - engine-gst: Guard read access to critical section
Comment 10 Debarshi Ray 2014-09-11 11:02:15 UTC
Unfortunately, when I was testing this patch yesterday (I had modified the C sources in the tarball to the same effect), I kept having the same deadlock. I think there is more to this bug than the unguarded read access.
Comment 11 Jens Georg 2014-09-11 11:40:09 UTC
Is that a gdb trace issue or are those really two different mutexes in g_cond_wait and g_mutex_lock?
Comment 12 Debarshi Ray 2014-09-11 13:13:27 UTC
Created attachment 285905 [details] [review]
engine-gst: Guard read access to critical section

Same thing, but this time in the thaw function. I have not had a chance to test this because I noticed this while skimming through the sources once more. I really should read it more carefully the first time.
Comment 13 Jens Georg 2014-09-13 17:59:19 UTC
The patch makes sense, but as I completely fail to reproduce this, I can't really test whether it fixes the issue
Comment 14 Jens Georg 2014-10-31 21:49:49 UTC
Is this fixed now?
Comment 15 Jens Georg 2015-02-19 13:40:40 UTC
ping
Comment 16 Jens Georg 2015-04-05 10:20:31 UTC
ping
Comment 17 Bastien Nocera 2015-04-08 14:35:24 UTC
It's not possible to reproduce the problem because rygel seems to have regressed.

Using rygel-0.26.0-1.fc22.x86_64
And adding:
/run/user/1000/gvfs/smb-share:server=diskstation.local,share=videos/New/
to my rygel.conf throws those errors:
(rygel:13669): MediaExport-WARNING **: Failed to get file info for smb://diskstation.local/videos/New/: Operation not supported by backend

Because rygel doesn't support non-local files, but seems to want to handle URIs nonetheless.

Totem works around that by doing:
path = g_file_get_path (file);
uri = g_filename_to_uri (path, NULL, NULL);
which gives you a URI, but going through fuse, instead of completely failing to read the files.
Comment 18 Jens Georg 2015-04-12 14:08:59 UTC
that's odd, the code responsible for that hasn't changed between 0.24 and 0.26
Comment 19 Jens Georg 2015-04-12 14:11:07 UTC
The warnings are coming from g_file_query_info_async
Comment 20 Jens Georg 2016-09-02 10:40:27 UTC
comment 17 might be fixed now - can you check whether this is still happening?
Comment 21 Jens Georg 2018-02-28 07:07:12 UTC
Assumed fixed