splitmuxsrc: deadlock in block_until_can_push in 1.20.3 and 1.22.1
Our pipeline in the form splitmuxsrc location=in.mp4, ! h264parse name=parse ! qtmux faststart=true ! filesink location=out.mp4
regularly deadlocks in splitmuxsrc and we could recover the following stack traces (only relevant threads):
Thread 1:
syscall 0x00007ffff751ea3d
g_cond_wait 0x00007ffff7c4b1d3
block_until_can_push gstsplitmuxpartreader.c:123
splitmux_part_pad_event gstsplitmuxpartreader.c:466
gst_pad_send_event_unchecked gstpad.c:5900
gst_pad_push_event_unchecked gstpad.c:5544
push_sticky gstpad.c:4047
events_foreach gstpad.c:608
check_sticky gstpad.c:4106
gst_pad_push_event gstpad.c:5675
gst_qtdemux_push_tags qtdemux.c:792
gst_qtdemux_stream_update_segment qtdemux.c:4993
gst_qtdemux_activate_segment qtdemux.c:5022
gst_qtdemux_prepare_current_sample qtdemux.c:5178
gst_qtdemux_loop_state_movie qtdemux.c:6407
gst_qtdemux_loop qtdemux.c:6660
gst_task_func gsttask.c:384
<unknown> 0x00007ffff7c2e6b4
<unknown> 0x00007ffff7c2ba51
start_thread 0x00007ffff7494b43
clone3 0x00007ffff7526a00
Thread 2:
syscall 0x00007ffff751ea3d
g_cond_wait 0x00007ffff7c4b1d3
gst_aggregator_wait_and_check gstaggregator.c:857
gst_aggregator_aggregate_func gstaggregator.c:1384
gst_task_func gsttask.c:384
<unknown> 0x00007ffff7c2e6b4
<unknown> 0x00007ffff7c2ba51
start_thread 0x00007ffff7494b43
clone3 0x00007ffff7526a00
Threads 3,...:
syscall 0x00007ffff751ea3d
g_cond_wait 0x00007ffff7c4b1d3
gst_task_func gsttask.c:369
<unknown> 0x00007ffff7c2e6b4
<unknown> 0x00007ffff7c2ba51
start_thread 0x00007ffff7494b43
clone3 0x00007ffff7526a00
GStreamer version is 1.20.3. This issue is best reproduced by running the pipeline in parallel. However, the issue is not reproducible on all systems, e.g. it never occurred on a 11th gen i7 but always occurs on a 11th gen i5.