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 736322 - Unlimited queue for PAUSE and OPTION response
Unlimited queue for PAUSE and OPTION response
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-rtsp-server
unspecified
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-09-09 12:02 UTC by Göran Jönsson
Modified: 2018-05-04 09:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gst-rtsp-server patch (2.62 KB, patch)
2014-09-09 12:02 UTC, Göran Jönsson
needs-work Details | Review
gst-rtsp-server patch (3.41 KB, patch)
2014-09-15 09:32 UTC, Göran Jönsson
none Details | Review

Description Göran Jönsson 2014-09-09 12:02:46 UTC
Created attachment 285732 [details] [review]
gst-rtsp-server patch

When setting "drop-backlog" is false and the watch queue is full.Then there will be a deadlock when handling pause and options request.

I assume that when "drop-backlog" is true and watch queue is full the responses 
will be lost. This is not tested.

The solution is to temporary allow unlimited queue size for watch when handling pause and options requests.
Comment 1 Sebastian Dröge (slomo) 2014-09-12 14:34:07 UTC
Review of attachment 285732 [details] [review]:

Just to be sure, the problem here is that if the send queue is full then the commands will be dropped? Which leads to the problem that the client will be confused as there's no response?

::: gst/rtsp-server/rtsp-client.c
@@ +1110,3 @@
 
+  /* Restore limit on watch queue */
+  gst_rtsp_watch_set_send_backlog (priv->watch, 0, 100);

Can you create a #define for this number somewhere at the top of the file?
Comment 2 Göran Jönsson 2014-09-15 09:32:11 UTC
Created attachment 286189 [details] [review]
gst-rtsp-server patch

New patch added.

Just to be sure, the problem here is that if the send queue is full then the
commands will be dropped? Which leads to the problem that the client will be
confused as there's no response?

Answer: No.
If running with the settings "drop-backlog" set to TRUE I believe the above is correct

But we are running with "drop-backlog" set to FALSE. Then we got a deadlock·
when backlog queue is full and we got an incoming rtsp request.
( Not Teardown then queue is flushed )

Thread 20 (Thread 3500)

  • #0 __lll_lock_wait
    at ../nptl/sysdeps/unix/sysv/linux/lowlevellock.c line 46
  • #1 __pthread_mutex_lock
    at pthread_mutex_lock.c line 89
  • #2 gst_rtsp_stream_transport_send_rtcp
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-rtsp-server/gst-rtsp-server/gst/rtsp-server/rtsp-stream-transport.c line 527
  • #3 handle_new_sample
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-rtsp-server/gst-rtsp-server/gst/rtsp-server/rtsp-stream.c line 1491
  • #4 gst_app_sink_render
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-plugins-base/gst-plugins-base/gst-libs/gst/app/gstappsink.c line 751
  • #5 gst_base_sink_chain_unlocked
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/libs/gst/base/gstbasesink.c line 3378
  • #6 gst_base_sink_chain_main
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/libs/gst/base/gstbasesink.c line 3486
  • #7 gst_pad_chain_data_unchecked
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/gst/gstpad.c line 3766
  • #8 gst_pad_push_data
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/gst/gstpad.c line 3996
  • #9 gst_queue_push_one
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/plugins/elements/gstqueue.c line 1120
  • #10 gst_queue_loop
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/plugins/elements/gstqueue.c line 1249
  • #11 gst_task_func
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/gst/gsttask.c line 316
  • #12 g_thread_pool_thread_proxy
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gthreadpool.c line 309
  • #13 g_thread_proxy
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gthread.c line 798
  • #14 start_thread
    at pthread_create.c line 310
  • #15 __thread_start
    from target/mipsisa32r2el-axis-linux-gnu/lib/libc.so.6

Thread 19 (Thread 3499)

  • #0 __lll_lock_wait
    at ../nptl/sysdeps/unix/sysv/linux/lowlevellock.c line 46
  • #1 __pthread_mutex_lock
    at pthread_mutex_lock.c line 108
  • #2 g_mutex_lock
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gthread-posix.c line 210
  • #3 do_send_data
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-rtsp-server/gst-rtsp-server/gst/rtsp-server/rtsp-client.c line 709
  • #4 gst_rtsp_stream_transport_send_rtp
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-rtsp-server/gst-rtsp-server/gst/rtsp-server/rtsp-stream-transport.c line 501
  • #5 handle_new_sample
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-rtsp-server/gst-rtsp-server/gst/rtsp-server/rtsp-stream.c line 1489
  • #6 gst_app_sink_render
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-plugins-base/gst-plugins-base/gst-libs/gst/app/gstappsink.c line 751
  • #7 gst_base_sink_chain_unlocked
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/libs/gst/base/gstbasesink.c line 3378
  • #8 gst_base_sink_chain_main
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/libs/gst/base/gstbasesink.c line 3486
  • #9 gst_pad_chain_data_unchecked
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/gst/gstpad.c line 3766
  • #10 gst_pad_push_data
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/gst/gstpad.c line 3996
  • #11 gst_queue_push_one
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/plugins/elements/gstqueue.c line 1120
  • #12 gst_queue_loop
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/plugins/elements/gstqueue.c line 1249
  • #13 gst_task_func
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/gst/gsttask.c line 316
  • #14 g_thread_pool_thread_proxy
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gthreadpool.c line 309
  • #15 g_thread_proxy
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gthread.c line 798
  • #16 start_thread
    at pthread_create.c line 310
  • #17 __thread_start
    from target/mipsisa32r2el-axis-linux-gnu/lib/libc.so.6

Thread 18 (Thread 3498)

  • #0 __lll_lock_wait
    at ../nptl/sysdeps/unix/sysv/linux/lowlevellock.c line 46
  • #1 __pthread_mutex_lock
    at pthread_mutex_lock.c line 89
  • #2 gst_rtsp_stream_transport_send_rtcp
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-rtsp-server/gst-rtsp-server/gst/rtsp-server/rtsp-stream-transport.c line 527
  • #3 handle_new_sample
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-rtsp-server/gst-rtsp-server/gst/rtsp-server/rtsp-stream.c line 1491
  • #4 gst_app_sink_render
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-plugins-base/gst-plugins-base/gst-libs/gst/app/gstappsink.c line 751
  • #5 gst_base_sink_chain_unlocked
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/libs/gst/base/gstbasesink.c line 3378
  • #6 gst_base_sink_chain_main
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/libs/gst/base/gstbasesink.c line 3486
  • #7 gst_pad_chain_data_unchecked
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/gst/gstpad.c line 3766
  • #8 gst_pad_push_data
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/gst/gstpad.c line 3996
  • #9 gst_queue_push_one
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/plugins/elements/gstqueue.c line 1120
  • #10 gst_queue_loop
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/plugins/elements/gstqueue.c line 1249
  • #11 gst_task_func
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/gst/gsttask.c line 316
  • #12 g_thread_pool_thread_proxy
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gthreadpool.c line 309
  • #13 g_thread_proxy
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gthread.c line 798
  • #14 start_thread
    at pthread_create.c line 310
  • #15 __thread_start
    from target/mipsisa32r2el-axis-linux-gnu/lib/libc.so.6

Thread 9 (Thread 3348)

  • #0 accept
    from target/mipsisa32r2el-axis-linux-gnu/lib/libpthread.so.0
  • #1 mdp_accept_func
    at /home/goranjn/FLASHDIR/560aftersemester/apps/monolith/monolith/src/mdp.c line 675
  • #2 g_thread_proxy
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gthread.c line 798
  • #3 start_thread
    at pthread_create.c line 310
  • #4 __thread_start
    from target/mipsisa32r2el-axis-linux-gnu/lib/libc.so.6

Thread 4 (Thread 3343)

  • #0 read
    from target/mipsisa32r2el-axis-linux-gnu/lib/libpthread.so.0
  • #1 streamer_cmd_thread
    at /home/goranjn/FLASHDIR/560aftersemester/apps/monolith/monolith/src/streamer.c line 233
  • #2 g_thread_proxy
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gthread.c line 798
  • #3 start_thread
    at pthread_create.c line 310
  • #4 __thread_start
    from target/mipsisa32r2el-axis-linux-gnu/lib/libc.so.6

Thread 2 (Thread 3488)

  • #0 __lll_lock_wait
    at ../nptl/sysdeps/unix/sysv/linux/lowlevellock.c line 46
  • #1 __pthread_mutex_lock
    at pthread_mutex_lock.c line 89
  • #2 gst_rtsp_stream_transport_get_transport
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-rtsp-server/gst-rtsp-server/gst/rtsp-server/rtsp-stream-transport.c line 291
  • #3 unlink_session_transports
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-rtsp-server/gst-rtsp-server/gst/rtsp-server/rtsp-client.c line 799
  • #4 handle_pause_request
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-rtsp-server/gst-rtsp-server/gst/rtsp-server/rtsp-client.c line 1084
  • #5 handle_request
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-rtsp-server/gst-rtsp-server/gst/rtsp-server/rtsp-client.c line 2213
  • #6 gst_rtsp_client_handle_message
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-rtsp-server/gst-rtsp-server/gst/rtsp-server/rtsp-client.c line 2778
  • #7 gst_rtsp_source_dispatch_read
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-plugins-base/gst-plugins-base/gst-libs/gst/rtsp/gstrtspconnection.c line 3145
  • #8 g_main_dispatch
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gmain.c line 3063
  • #9 g_main_context_dispatch
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gmain.c line 3639
  • #10 g_main_context_iterate
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gmain.c line 3710
  • #11 g_main_loop_run
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gmain.c line 3904
  • #12 do_loop
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-rtsp-server/gst-rtsp-server/gst/rtsp-server/rtsp-thread-pool.c line 329
  • #13 g_thread_pool_thread_proxy
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gthreadpool.c line 309
  • #14 g_thread_proxy
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gthread.c line 798
  • #15 start_thread
    at pthread_create.c line 310
  • #16 __thread_start
    from target/mipsisa32r2el-axis-linux-gnu/lib/libc.so.6

Comment 3 Wim Taymans 2014-09-15 09:40:51 UTC
it looks like the deadlock is caused by one of your previous patches that added locking in stream-transport, can you try without?
Comment 4 Göran Jönsson 2014-09-15 10:01:42 UTC
Oh !!

I mistakenly pasted the wrong backtrace.

Thread 20 (Thread 3201)

  • #0 __lll_lock_wait
    at ../nptl/sysdeps/unix/sysv/linux/lowlevellock.c line 46
  • #1 __pthread_mutex_lock
    at pthread_mutex_lock.c line 108
  • #2 g_mutex_lock
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gthread-posix.c line 210
  • #3 do_send_data
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-rtsp-server/gst-rtsp-server/gst/rtsp-server/rtsp-client.c line 709
  • #4 handle_new_sample
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-rtsp-server/gst-rtsp-server/gst/rtsp-server/rtsp-stream.c line 1491
  • #5 gst_app_sink_render
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-plugins-base/gst-plugins-base/gst-libs/gst/app/gstappsink.c line 751
  • #6 gst_base_sink_chain_unlocked
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/libs/gst/base/gstbasesink.c line 3378
  • #7 gst_base_sink_chain_main
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/libs/gst/base/gstbasesink.c line 3486
  • #8 gst_pad_chain_data_unchecked
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/gst/gstpad.c line 3766
  • #9 gst_pad_push_data
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/gst/gstpad.c line 3996
  • #10 gst_queue_push_one
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/plugins/elements/gstqueue.c line 1120
  • #11 gst_queue_loop
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/plugins/elements/gstqueue.c line 1249
  • #12 gst_task_func
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/gst/gsttask.c line 316
  • #13 g_thread_pool_thread_proxy
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gthreadpool.c line 309
  • #14 g_thread_proxy
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gthread.c line 798
  • #15 start_thread
    at pthread_create.c line 310
  • #16 __thread_start
    from target/mipsisa32r2el-axis-linux-gnu/lib/libc.so.6

Thread 19 (Thread 3200)

  • #0 __lll_lock_wait
    at ../nptl/sysdeps/unix/sysv/linux/lowlevellock.c line 46
  • #1 __pthread_mutex_lock
    at pthread_mutex_lock.c line 108
  • #2 g_mutex_lock
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gthread-posix.c line 210
  • #3 do_send_data
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-rtsp-server/gst-rtsp-server/gst/rtsp-server/rtsp-client.c line 709
  • #4 handle_new_sample
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-rtsp-server/gst-rtsp-server/gst/rtsp-server/rtsp-stream.c line 1489
  • #5 gst_app_sink_render
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-plugins-base/gst-plugins-base/gst-libs/gst/app/gstappsink.c line 751
  • #6 gst_base_sink_chain_unlocked
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/libs/gst/base/gstbasesink.c line 3378
  • #7 gst_base_sink_chain_main
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/libs/gst/base/gstbasesink.c line 3486
  • #8 gst_pad_chain_data_unchecked
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/gst/gstpad.c line 3766
  • #9 gst_pad_push_data
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/gst/gstpad.c line 3996
  • #10 gst_queue_push_one
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/plugins/elements/gstqueue.c line 1120
  • #11 gst_queue_loop
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/plugins/elements/gstqueue.c line 1249
  • #12 gst_task_func
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/gst/gsttask.c line 316
  • #13 g_thread_pool_thread_proxy
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gthreadpool.c line 309
  • #14 g_thread_proxy
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gthread.c line 798
  • #15 start_thread
    at pthread_create.c line 310
  • #16 __thread_start
    from target/mipsisa32r2el-axis-linux-gnu/lib/libc.so.6

Thread 9 (Thread 3050)

  • #0 accept
    from target/mipsisa32r2el-axis-linux-gnu/lib/libpthread.so.0
  • #1 mdp_accept_func
    at /home/goranjn/FLASHDIR/560aftersemester/apps/monolith/monolith/src/mdp.c line 675
  • #2 g_thread_proxy
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gthread.c line 798
  • #3 start_thread
    at pthread_create.c line 310
  • #4 __thread_start
    from target/mipsisa32r2el-axis-linux-gnu/lib/libc.so.6

Thread 4 (Thread 3045)

  • #0 read
    from target/mipsisa32r2el-axis-linux-gnu/lib/libpthread.so.0
  • #1 streamer_cmd_thread
    at /home/goranjn/FLASHDIR/560aftersemester/apps/monolith/monolith/src/streamer.c line 233
  • #2 g_thread_proxy
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gthread.c line 798
  • #3 start_thread
    at pthread_create.c line 310
  • #4 __thread_start
    from target/mipsisa32r2el-axis-linux-gnu/lib/libc.so.6

Thread 3 (Thread 3191)

  • #0 __lll_lock_wait
    at ../nptl/sysdeps/unix/sysv/linux/lowlevellock.c line 46
  • #1 __pthread_mutex_lock
    at pthread_mutex_lock.c line 89
  • #2 bus_message
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-rtsp-server/gst-rtsp-server/gst/rtsp-server/rtsp-media.c line 1914
  • #3 gst_bus_source_dispatch
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/gst/gstbus.c line 769
  • #4 g_main_dispatch
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gmain.c line 3063
  • #5 g_main_context_dispatch
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gmain.c line 3639
  • #6 g_main_context_iterate
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gmain.c line 3710
  • #7 g_main_loop_run
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gmain.c line 3904
  • #8 do_loop
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-rtsp-server/gst-rtsp-server/gst/rtsp-server/rtsp-thread-pool.c line 329
  • #9 g_thread_pool_thread_proxy
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gthreadpool.c line 309
  • #10 g_thread_proxy
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gthread.c line 798
  • #11 start_thread
    at pthread_create.c line 310
  • #12 __thread_start
    from target/mipsisa32r2el-axis-linux-gnu/lib/libc.so.6

Thread 2 (Thread 3189)

  • #0 __lll_lock_wait
    at ../nptl/sysdeps/unix/sysv/linux/lowlevellock.c line 46
  • #1 __pthread_mutex_lock
    at pthread_mutex_lock.c line 108
  • #2 g_mutex_lock
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gthread-posix.c line 210
  • #3 gst_base_sink_change_state
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/libs/gst/base/gstbasesink.c line 4941
  • #4 gst_element_change_state
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/gst/gstelement.c line 2602
  • #5 gst_element_set_state_func
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/gst/gstelement.c line 2558
  • #6 gst_bin_element_set_state
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/gst/gstbin.c line 2325
  • #7 gst_bin_change_state_func
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/gst/gstbin.c line 2648
  • #8 gst_pipeline_change_state
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/gst/gstpipeline.c line 471
  • #9 gst_element_change_state
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/gst/gstelement.c line 2602
  • #10 gst_element_set_state_func
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gstreamer/gstreamer/gst/gstelement.c line 2558
  • #11 media_set_pipeline_state_locked
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-rtsp-server/gst-rtsp-server/gst/rtsp-server/rtsp-media.c line 2911
  • #12 gst_rtsp_media_set_state
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-rtsp-server/gst-rtsp-server/gst/rtsp-server/rtsp-media.c line 3027
  • #13 gst_rtsp_session_media_set_state
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-rtsp-server/gst-rtsp-server/gst/rtsp-server/rtsp-session-media.c line 453
  • #14 handle_pause_request
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-rtsp-server/gst-rtsp-server/gst/rtsp-server/rtsp-client.c line 1087
  • #15 handle_request
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-rtsp-server/gst-rtsp-server/gst/rtsp-server/rtsp-client.c line 2213
  • #16 gst_rtsp_client_handle_message
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-rtsp-server/gst-rtsp-server/gst/rtsp-server/rtsp-client.c line 2778
  • #17 gst_rtsp_source_dispatch_read
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-plugins-base/gst-plugins-base/gst-libs/gst/rtsp/gstrtspconnection.c line 3145
  • #18 g_main_dispatch
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gmain.c line 3063
  • #19 g_main_context_dispatch
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gmain.c line 3639
  • #20 g_main_context_iterate
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gmain.c line 3710
  • #21 g_main_loop_run
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gmain.c line 3904
  • #22 do_loop
    at /home/goranjn/FLASHDIR/560aftersemester/libs/gst-rtsp-server/gst-rtsp-server/gst/rtsp-server/rtsp-thread-pool.c line 329
  • #23 g_thread_pool_thread_proxy
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gthreadpool.c line 309
  • #24 g_thread_proxy
    at /home/goranjn/FLASHDIR/560aftersemester/libs/glib/glib/glib/gthread.c line 798
  • #25 start_thread
    at pthread_create.c line 310
  • #26 __thread_start
    from target/mipsisa32r2el-axis-linux-gnu/lib/libc.so.6

Comment 5 Wim Taymans 2014-09-15 12:42:04 UTC
It's the send_lock that is causing trouble. It is taken when sending a message (from the appsink render callback). The callback is then blocking because the queue is full. When a pause request comes in, it tries to pause the appsink, which will deadlock because it is still blocked in the render callback.

What should happen is that when pausing/stopping etc, we make sure no render method is blocking (by flushing it or unlocking it or so) before doing the state change. Increasing the queue limit is one way of doing that.
Comment 6 Göran Jönsson 2014-09-16 05:47:04 UTC
If flushing then we lose data that's OK for teardown and this is done already. But for other requests it is not so good to loose data. To temporary increase the limit for ctrl data is in my mind like prioritize ctrl data before other data and that's sounds like good idea to me. However there are theoretical risk that the queue will grow uncontrolled. The patch could maybe be redesigned so there is 
two limits. One for data and one for ctrl-data .    

I also think that this is a trouble in mode "drop-backlog" is true but then
the ctrl data will be lost. To temporary increase queue size solves both cases.
    
Note: Whit ctrl data I mean RTSP requests and it's responses.
Comment 7 Wim Taymans 2014-09-16 09:16:34 UTC
Even with 2 limits this will not work, the reason that the appsink callback is blocking is because the limit for the data is reached, it's then trying to to a state change to PAUSED, waiting for the appsink to unblock, it's not even trying to send the PAUSED reply, it will do that after the pipeline paused.

So the only thing that can happen is to unblock the wait_backlog function without losing the packet, which you can only do by adding it to the queue and increasing the queue length. 

What would be nice is that we could add only the currently blocking packet to the queue and then make appsink pause on the next packet but I don't see how that will work, we'll need to just remove the limit and hope not too many packets flood the queue (they should be rate limited with timestamps). In any case, we can restore the old limits again after we paused so the queue should not grow unbounded.
Comment 8 Göran Jönsson 2014-09-16 09:34:11 UTC
So if I understand you correctly you think attached patch is good enough ?
Comment 9 Wim Taymans 2014-09-16 09:45:01 UTC
commit 23b9d8fbb04ceff21110086528591849c728ae48
Author: Göran Jönsson <goranjn@axis.com>
Date:   Tue Sep 16 11:41:52 2014 +0200

    client: raise the backlog limits before pausing
    
    We need to raise the backlog limits before pausing the pipeline or else
    the appsink might be blocking in the render method in wait_backlog() and
    we would deadlock waiting for paused.
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=736322

commit ebd9be59fe63b242d6c7f3c28088c73392927b3b
Author: Göran Jönsson <goranjn@axis.com>
Date:   Tue Sep 16 11:29:38 2014 +0200

    client: make define for the WATCH_BACKLOG
    
    See https://bugzilla.gnome.org/show_bug.cgi?id=736322
Comment 10 Wim Taymans 2014-09-16 09:46:49 UTC
yes, however: I did not include the patch for the options request yet. How does this deadlock? There is no state change there and the reply should just be appended to the current data in the backlog and be consumed by the client when it can.
Comment 11 Wim Taymans 2014-09-16 09:58:05 UTC
The effect is now that if the client is a slow reader and it issues a pause request, it will first get all the queued RTP packets before it gets the pause reply. I guess that is expected.

We could keep separate queues for RTSP and RTP packets and allow the RTSP to jump in front of the RTP messages. This would make it so that you get the paused reply quickly and then some more RTP packets until the RTP queue is drained. Not sure if that is much better.
Comment 12 Göran Jönsson 2014-09-16 10:08:50 UTC
Options:
I have never seen the problem for Options. I was believing the problem was related to the fact the queue was full and the part with state changing i didn't think of. I was more thinking on that it was possible to have a full queue and receive a Options request. So I added that also.

But for the case when "drop-backlog" set to TRUE is not the options case relevant ? ( We are running drop-backlog" set to FALSE)

Quick response double queues:
I believe that can mess up things for clients.
Comment 13 Linus Svensson 2018-05-04 09:50:06 UTC
This has been fixed already. The bug can be closed.