Sending EOS from a probe callback deadlocks the pipeline when playing a non-live source

Eslam Ahmed eslam.ahmed at avidbeam.com
Wed Nov 10 18:25:41 UTC 2021


Hello again,

I managed to produce this outside of my application. here's the code:
https://pastebin.com/cnvWBV0a

I also discovered some ways to workaround the issue and prevent the
deadlock from happening:

   - Using a live source with rtspsrc instead of filesrc
   - Remove the tee and the queue and link `filesrc ! decodebin ! sink`
   directly

The code produces .dot graph files for the pipeline (before/after sending
the eos) so you might wanna set the environment variable GST_DEBUG_DUMP_DOT_DIR
to a valid path where the .dot files are to be dumped.

Can anyone confirm this? Is it a bug so I can report it?

Best Regards,
Eslam Ahmed


On Wed, Nov 10, 2021 at 10:24 AM Eslam Ahmed <eslam.ahmed at avidbeam.com>
wrote:

> Hello,
>
> Consider the following pipeline:
>
> filesrc ! typefind ! decodebin ! fakesink
>
> My main goal is to inspect the buffers for a while then finalize the
> pipeline so I installed a probe of type GST_PAD_PROBE_TYPE_BUFFER on the
> fakesink's sink pad, which after inspecting the buffers for a while emits
> an EOS signal down using the pipeline itself then removes the probe.
> Problem is the pipeline gets deadlocked on sending this event. Here's gdb
> backtrace:
> ```
> #0 __lll_lock_wait (futex=futex at entry=0x555556192e10, private=0) at
> lowlevellock.c:52
> #1 0x00007ffff732a131 in __GI___pthread_mutex_lock (mutex=0x555556192e10)
> at ../nptl/pthread_mutex_lock.c:115
> #2 0x00007ffff6c4e1dd in () at /lib/x86_64-linux-gnu/libgstbase-1.0.so.0
> #3 0x00007ffff7bd74a2 in gst_element_send_event () at
> /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
> #4 0x00007ffff7bb452d in () at /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
> #5 0x00007ffff7bd74a2 in gst_element_send_event () at
> /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
> #6 0x00007ffff7bb452d in () at /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
> #7 0x00007ffff7bd74a2 in gst_element_send_event () at
> /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
> #8 0x00007ffff75219aa in pipeline_manager::send_eos()
> (this=0x7fffffffd530)
> #9 0x00005555556937c5 in (anonymous
> namespace)::cb_gather_media_spec(GstPad*, GstPadProbeInfo*, gpointer) (pad=
> 0x5555560c7120 [GstPad|sink], info=0x7ffff393d650,
> user_data=0x7fffffffd4d0)
> ```
>
> The implementation of pipeline_manager::send_eos() is fairly
> straightforward just calling `gst_element_send_event(pipeline_.get(),
> gst_event_new_eos());`
> Surprisingly, I don't get the deadlock when using a live source (rtspsrc
> instead of the filesrc)
> Is it wrong to send the in-band downstream EOS event from a pad probe
> callback? Am I missing something here?
>
> Gstreamer Version: 1.16.2 (installed via apt package manager on Ubuntu
> 20.04.3 LTS)
>
> Best Regards,
> Eslam Ahmed
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20211110/ed58969a/attachment.htm>


More information about the gstreamer-devel mailing list