basesink: blocked waiting for pre-roll when processing eos on an errored pipeline
To reproduce:
$ git clone https://gitlab.freedesktop.org/gdesmott/test-gst.git --branch eos-lock
$ cd test-gst/
$ cargo run
This test app does the following:
- start a pipeline which will error
- send
FLUSH_START
,FLUSH_STOP
and theEOS
to the sink's sink pad.
Doing so trigger a lock where the sink keeps waiting on pre-roll to process EOS
.
Thread 4 (Thread 0x7fc1021796c0 (LWP 303638) "test-gst"):
#0 0x00007fc103cef92d in syscall () at /lib64/libc.so.6
#1 0x00007fc103f6fea3 in g_cond_wait () at /lib64/libglib-2.0.so.0
#2 0x00007fc10371f90c in gst_base_sink_wait_preroll (sink=0x56090f7053f0) at ../subprojects/gstreamer/libs/gst/base/gstbasesink.c:2437
#3 0x00007fc10371fe49 in gst_base_sink_do_preroll (sink=0x56090f7053f0, obj=0x7fc0f0001900) at ../subprojects/gstreamer/libs/gst/base/gstbasesink.c:2531
#4 0x00007fc10372074b in gst_base_sink_do_sync (basesink=0x56090f7053f0, obj=0x7fc0f0001900, late=0x7fc1021781a8, step_end=0x7fc1021781a4) at ../subprojects/gstreamer/libs/gst/base/gstbasesink.c:2739
#5 0x00007fc10372416d in gst_base_sink_default_wait_event (basesink=0x56090f7053f0, event=0x7fc0f0001900) at ../subprojects/gstreamer/libs/gst/base/gstbasesink.c:3300
#6 0x00007fc1037241bb in gst_base_sink_wait_event (basesink=0x56090f7053f0, event=0x7fc0f0001900) at ../subprojects/gstreamer/libs/gst/base/gstbasesink.c:3315
#7 0x00007fc103724443 in gst_base_sink_default_event (basesink=0x56090f7053f0, event=0x7fc0f0001900) at ../subprojects/gstreamer/libs/gst/base/gstbasesink.c:3357
#8 0x00007fc103185c5e in gst_rtmp2_sink_event (sink=0x56090f7053f0, event=0x7fc0f0001900) at ../subprojects/gst-plugins-bad/gst/rtmp2/gstrtmp2sink.c:628
#9 0x00007fc103726921 in gst_base_sink_event (pad=0x56090f6e67b0, parent=0x56090f7053f0, event=0x7fc0f0001900) at ../subprojects/gstreamer/libs/gst/base/gstbasesink.c:3680
#10 0x00007fc104309523 in gst_pad_send_event_unchecked (pad=0x56090f6e67b0, event=0x7fc0f0001900, type=GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM) at ../subprojects/gstreamer/gst/gstpad.c:5940
#11 0x00007fc104309cc8 in gst_pad_send_event (pad=0x56090f6e67b0, event=0x7fc0f0001900) at ../subprojects/gstreamer/gst/gstpad.c:6110
#12 0x000056090e25c261 in gstreamer::pad::{impl#6}::send_event<gstreamer::auto::pad::Pad, gstreamer::event::Event> (self=0x7fc1021785d0, event=...) at /var/home/cassidy/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gstreamer-0.19.8/src/pad.rs:520
#13 0x000056090e25b42d in test_gst::main::{closure#0} () at src/main.rs:38
#14 0x000056090e25c3ce in std::sys_common::backtrace::__rust_begin_short_backtrace<test_gst::main::{closure_env#0}, ()> (f=...) at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/sys_common/backtrace.rs:135
#15 0x000056090e25dd4a in std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure#0}<test_gst::main::{closure_env#0}, ()> () at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/thread/mod.rs:529
#16 0x000056090e25cd8e in core::panic::unwind_safe::{impl#23}::call_once<(), std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<test_gst::main::{closure_env#0}, ()>> (self=...) at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/panic/unwind_safe.rs:271
#17 0x000056090e25e2a9 in std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<test_gst::main::{closure_env#0}, ()>>, ()> (data=0x7fc102178bd0) at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panicking.rs:500
#18 0x000056090e25e41b in __rust_try ()
#19 0x000056090e25e23a in std::panicking::try<(), core::panic::unwind_safe::AssertUnwindSafe<std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<test_gst::main::{closure_env#0}, ()>>> (f=...) at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panicking.rs:464
#20 0x000056090e25db9e in std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<test_gst::main::{closure_env#0}, ()>>, ()> (f=...) at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panic.rs:142
#21 std::thread::{impl#0}::spawn_unchecked_::{closure#1}<test_gst::main::{closure_env#0}, ()> () at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/thread/mod.rs:528
#22 0x000056090e25e48e in core::ops::function::FnOnce::call_once<std::thread::{impl#0}::spawn_unchecked_::{closure_env#1}<test_gst::main::{closure_env#0}, ()>, ()> () at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/ops/function.rs:250
#23 0x000056090e29ec85 in alloc::boxed::{impl#47}::call_once<(), dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:1985
#24 alloc::boxed::{impl#47}::call_once<(), alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:1985
#25 std::sys::unix::thread::{impl#2}::new::thread_start () at library/std/src/sys/unix/thread.rs:108
#26 0x00007fc103c7612d in start_thread () at /lib64/libc.so.6
#27 0x00007fc103cf7bc0 in clone3 () at /lib64/libc.so.6
@slomo : this is the lock I was telling you about the other day.