GStreamer 1.22 deadlocks when stopping stream with subtitles visible
With GStreamer 1.22 (and main) when playing video that has subtitles, if you try to stop playback after any subtitle was shown on screen, pipeline deadlocks causing app to freeze. This does not happen with 1.20.
Can be reproduced by playing video with subtitles using gst-play-1.0
with a video sink that has a close button. Simply close window when subtitles text is shown on screen.
I am including gdb backtrace.
GDB Backtrace
#0 0x00007ffff78a58e0 in __lll_lock_wait () at /lib64/libc.so.6
#1 0x00007ffff78abf5d in pthread_mutex_lock@@GLIBC_2.2.5 () at /lib64/libc.so.6
#2 0x00007ffff7de53ac in post_activate (new_mode=GST_PAD_MODE_NONE, pad=0x7fff70016990 [GstPad|sink_1]) at ../subprojects/gstreamer/gst/gstpad.c:1050
__func__ = "post_activate"
res = 0
old = <optimized out>
new = <optimized out>
dir = <optimized out>
peer = <optimized out>
__func__ = "activate_mode_internal"
#3 activate_mode_internal (pad=pad@entry=0x7fff70016990 [GstPad|sink_1], parent=parent@entry=0x7fff70014300 [GstObject|inputselector2], mode=mode@entry=GST_PAD_MODE_PUSH, active=active@entry=0)
at ../subprojects/gstreamer/gst/gstpad.c:1228
res = 0
old = <optimized out>
new = <optimized out>
dir = <optimized out>
peer = <optimized out>
__func__ = "activate_mode_internal"
#4 0x00007ffff7de5b58 in gst_pad_set_active (pad=pad@entry=0x7fff70016990 [GstPad|sink_1], active=0) at ../subprojects/gstreamer/gst/gstpad.c:1119
parent = 0x7fff70014300 [GstObject|inputselector2]
old = GST_PAD_MODE_PUSH
ret = 0
__func__ = "gst_pad_set_active"
#5 0x00007ffff7dbea61 in activate_pads (vpad=<optimized out>, ret=0x7fffffffd510, active=0x7fffffffd56c) at ../subprojects/gstreamer/gst/gstelement.c:3181
pad = 0x7fff70016990 [GstPad|sink_1]
cont = 1
#6 0x00007ffff7dd5013 in gst_iterator_fold (it=it@entry=0x4969f0, func=func@entry=0x7ffff7dbea40 <activate_pads>, ret=ret@entry=0x7fffffffd510, user_data=user_data@entry=0x7fffffffd56c)
at ../subprojects/gstreamer/gst/gstiterator.c:618
Python Exception <class 'gdb.error'>: No type named TypeNode.
item = {g_type = , data = {{v_int = 1879140752, v_uint = 1879140752, v_long = 140735072528784, v_ulong = 140735072528784, v_int64 = 140735072528784, v_uint64 = 140735072528784, v_float = 1.60204734e+29, v_double = 6.9532364501448341e-310, v_pointer = 0x7fff70016990}, {v_int = 0, v_uint = 0, v_long = 0, v_ulong = 0, v_int64 = 0, v_uint64 = 0, v_float = 0, v_double = 0, v_pointer = 0x0}}}
result = GST_ITERATOR_OK
__func__ = "gst_iterator_fold"
#7 0x00007ffff7dbf0f6 in iterator_activate_fold_with_resync (iter=iter@entry=0x4969f0, user_data=user_data@entry=0x7fffffffd56c, func=0x7ffff7dbea40 <activate_pads>) at ../subprojects/gstreamer/gst/gstelement.c:3205
ires = <optimized out>
Python Exception <class 'ValueError'>: Variable 'static_fundamental_type_nodes' not found.
ret = {g_type = , data = {{v_int = 1, v_uint = 1, v_long = 1, v_ulong = 1, v_int64 = 1, v_uint64 = 1, v_float = 1.40129846e-45, v_double = 4.9406564584124654e-324, v_pointer = 0x1}, {v_int = 0, v_uint = 0, v_long = 0, v_ulong = 0, v_int64 = 0, v_uint64 = 0, v_float = 0, v_double = 0, v_pointer = 0x0}}}
#8 0x00007ffff7dc1486 in gst_element_pads_activate (element=element@entry=0x7fff70014300 [GstElement|inputselector2], active=<optimized out>, active@entry=0) at ../subprojects/gstreamer/gst/gstelement.c:3249
iter = 0x4969f0
res = 1
__func__ = "gst_element_pads_activate"
#9 0x00007ffff7dc16c1 in gst_element_change_state_func (element=0x7fff70014300 [GstElement|inputselector2], transition=GST_STATE_CHANGE_PAUSED_TO_READY) at ../subprojects/gstreamer/gst/gstelement.c:3315
l = <optimized out>
state = GST_STATE_PAUSED
next = GST_STATE_READY
result = GST_STATE_CHANGE_SUCCESS
__func__ = "gst_element_change_state_func"
#10 0x00007fffec2ce60e in gst_input_selector_change_state (element=0x7fff70014300 [GstElement|inputselector2], transition=GST_STATE_CHANGE_PAUSED_TO_READY)
at ../subprojects/gstreamer/plugins/elements/gstinputselector.c:2048
self = 0x7fff70014300 [GstInputSelector|inputselector2]
result = <optimized out>
__func__ = "gst_input_selector_change_state"
#11 0x00007ffff7dc38be in gst_element_change_state (element=element@entry=0x7fff70014300 [GstElement|inputselector2], transition=transition@entry=GST_STATE_CHANGE_PAUSED_TO_READY)
at ../subprojects/gstreamer/gst/gstelement.c:3093
oclass = 0x7fff70011fa0
ret = GST_STATE_CHANGE_SUCCESS
__func__ = "gst_element_change_state"
#12 0x00007ffff7dc3ffd in gst_element_set_state_func (element=0x7fff70014300 [GstElement|inputselector2], state=GST_STATE_READY) at ../subprojects/gstreamer/gst/gstelement.c:3047
current = GST_STATE_PAUSED
next = <optimized out>
old_pending = <optimized out>
ret = <optimized out>
transition = GST_STATE_CHANGE_PAUSED_TO_READY
old_ret = <optimized out>
__func__ = "gst_element_set_state_func"
#13 0x00007ffff7da11bc in gst_bin_element_set_state
(next=GST_STATE_READY, current=GST_STATE_PAUSED, start_time=0 [0:00:00.000000000], base_time=0 [0:00:00.000000000], element=0x7fff70014300 [GstElement|inputselector2], bin=0x85b460 [GstBin|playbin])
at ../subprojects/gstreamer/gst/gstbin.c:2581
child_current = <optimized out>
found = <optimized out>
ret = <optimized out>
locked = <optimized out>
child_pending = GST_STATE_VOID_PENDING
__func__ = "gst_bin_element_set_state"
child = 0x7fff70014300 [GstElement|inputselector2]
bin = 0x85b460 [GstBin|playbin]
ret = <optimized out>
current = GST_STATE_PAUSED
next = GST_STATE_READY
have_async = 0
have_no_preroll = <optimized out>
base_time = 0 [0:00:00.000000000]
start_time = 0 [0:00:00.000000000]
it = 0x76ff30
done = 0
Python Exception <class 'gdb.error'>: No type named TypeNode.
data = {g_type = , data = {{v_int = 1879130880, v_uint = 1879130880, v_long = 140735072518912, v_ulong = 140735072518912, v_int64 = 140735072518912, v_uint64 = 140735072518912, v_float = 1.60018257e+29, v_double = 6.9532364496570925e-310, v_pointer = 0x7fff70014300}, {v_int = 0, v_uint = 0, v_long = 0, v_ulong = 0, v_int64 = 0, v_uint64 = 0, v_float = 0, v_double = 0, v_pointer = 0x0}}}
__func__ = "gst_bin_change_state_func"
#14 gst_bin_change_state_func (element=0x85b460 [GstElement|playbin], transition=GST_STATE_CHANGE_PAUSED_TO_READY) at ../subprojects/gstreamer/gst/gstbin.c:2930
child = 0x7fff70014300 [GstElement|inputselector2]
bin = 0x85b460 [GstBin|playbin]
ret = <optimized out>
current = GST_STATE_PAUSED
next = GST_STATE_READY
have_async = 0
have_no_preroll = <optimized out>
base_time = 0 [0:00:00.000000000]
start_time = 0 [0:00:00.000000000]
it = 0x76ff30
done = 0
Python Exception <class 'gdb.error'>: No type named TypeNode.
data = {g_type = , data = {{v_int = 1879130880, v_uint = 1879130880, v_long = 140735072518912, v_ulong = 140735072518912, v_int64 = 140735072518912, v_uint64 = 140735072518912, v_float = 1.60018257e+29, v_double = 6.9532364496570925e-310, v_pointer = 0x7fff70014300}, {v_int = 0, v_uint = 0, v_long = 0, v_ulong = 0, v_int64 = 0, v_uint64 = 0, v_float = 0, v_double = 0, v_pointer = 0x0}}}
__func__ = "gst_bin_change_state_func"
#15 0x00007ffff7ded85e in gst_pipeline_change_state (element=0x85b460 [GstElement|playbin], transition=GST_STATE_CHANGE_PAUSED_TO_READY) at ../subprojects/gstreamer/gst/gstpipeline.c:529
result = GST_STATE_CHANGE_SUCCESS
pipeline = 0x85b460 [GstPipeline|playbin]
clock = <optimized out>
__func__ = "gst_pipeline_change_state"
#16 0x00007ffff69c5170 in gst_play_bin_change_state (element=0x85b460 [GstElement|playbin], transition=GST_STATE_CHANGE_PAUSED_TO_READY) at ../subprojects/gst-plugins-base/gst/playback/gstplaybin2.c:5838
ret = <optimized out>
playbin = 0x85b460 [GstPlayBin|playbin]
do_save = 0
__func__ = "gst_play_bin_change_state"
#17 0x00007ffff7dc38be in gst_element_change_state (element=element@entry=0x85b460 [GstElement|playbin], transition=GST_STATE_CHANGE_PAUSED_TO_READY) at ../subprojects/gstreamer/gst/gstelement.c:3093
oclass = 0x6b4400
ret = GST_STATE_CHANGE_SUCCESS
__func__ = "gst_element_change_state"
#18 0x00007ffff7dc433a in gst_element_continue_state (element=element@entry=0x85b460 [GstElement|playbin], ret=ret@entry=GST_STATE_CHANGE_SUCCESS) at ../subprojects/gstreamer/gst/gstelement.c:2801
old_ret = <optimized out>
old_state = <optimized out>
old_next = <optimized out>
current = <optimized out>
next = <optimized out>
pending = <optimized out>
transition = <optimized out>
__func__ = "gst_element_continue_state"
#19 0x00007ffff7dc390b in gst_element_change_state (element=element@entry=0x85b460 [GstElement|playbin], transition=transition@entry=GST_STATE_CHANGE_PLAYING_TO_PAUSED) at ../subprojects/gstreamer/gst/gstelement.c:3132
oclass = <optimized out>
ret = <optimized out>
__func__ = "gst_element_change_state"
#20 0x00007ffff7dc3ffd in gst_element_set_state_func (element=0x85b460 [GstElement|playbin], state=GST_STATE_NULL) at ../subprojects/gstreamer/gst/gstelement.c:3047
current = GST_STATE_PLAYING
next = <optimized out>
old_pending = <optimized out>
ret = <optimized out>
transition = GST_STATE_CHANGE_PLAYING_TO_PAUSED
old_ret = <optimized out>
__func__ = "gst_element_set_state_func"
#21 0x00000000004079bf in play_bus_msg (bus=<optimized out>, msg=0x7ffef8004600, user_data=0x6be600) at ../subprojects/gst-plugins-base/tools/gst-play.c:491
err = 0x0
dbg = 0x14db9a0 "@\341K\001"
play = 0x6be600
__func__ = "play_bus_msg"
#22 0x00007ffff7dab10c in gst_bus_source_dispatch (source=0xaa0400, callback=0x407490 <play_bus_msg>, user_data=0x6be600) at ../subprojects/gstreamer/gst/gstbus.c:821
handler = 0x407490 <play_bus_msg>
bsource = 0xaa0400
message = 0x7ffef8004600
keep = <optimized out>
bus = 0x44fa00 [GstBus|bus1]
__func__ = "gst_bus_source_dispatch"
#23 0x00007ffff7bb333f in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#24 0x00007ffff7c08288 in g_main_context_iterate.constprop () at /lib64/libglib-2.0.so.0
#25 0x00007ffff7bb2903 in g_main_loop_run () at /lib64/libglib-2.0.so.0
#26 0x00000000004067d6 in do_play (play=<optimized out>) at ../subprojects/gst-plugins-base/tools/gst-play.c:853
i = <optimized out>
__func__ = "do_play"
play = 0x6be600
playlist = <optimized out>
verbose = 0
print_version = 0
interactive = 1
gapless = 0
instant_uri = 0
shuffle = 0
volume = -1
start_position = 0
filenames = 0x4488a0
audio_sink = 0x0
video_sink = 0x448a10 "clappersink"
uris = <optimized out>
flags = 0x0
num = <optimized out>
i = <optimized out>
err = 0x0
ctx = <optimized out>
playlist_file = 0x0
use_playbin3 = 0
no_position = 0
options = {{long_name = 0x4091b8 "verbose", short_name = 118 'v', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x7fffffffdba0, description = 0x409870 "Output status information and property notifications", arg_description = 0x0}, {long_name = 0x40909b "flags", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x7fffffffdbe8, description = 0x4098a8 "Control playback behaviour setting playbin 'flags' property", arg_description = 0x0}, {long_name = 0x4091c0 "version", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x7fffffffdba4, description = 0x4098e8 "Print version information and exit", arg_description = 0x0}, {long_name = 0x4091c8 "videosink", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x7fffffffdbe0, description = 0x409910 "Video sink to use (default is autovideosink)", arg_description = 0x0}, {long_name = 0x4091d2 "audiosink", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x7fffffffdbd8, description = 0x409940 "Audio sink to use (default is autoaudiosink)", arg_description = 0x0}, {long_name = 0x4091dc "gapless", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x7fffffffdbac, description = 0x4091e4 "Enable gapless playback", arg_description = 0x0}, {long_name = 0x4091fc "instant-uri", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x7fffffffdbb0, description = 0x409970 "Enable instantaneous uri changes (only with playbin3)", arg_description = 0x0}, {long_name = 0x409208 "shuffle", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x7fffffffdbb4, description = 0x409210 "Shuffle playlist", arg_description = 0x0}, {long_name = 0x409221 "no-interactive", short_name = 0 '\000', flags = 4, arg = G_OPTION_ARG_NONE, arg_data = 0x7fffffffdba8, description = 0x4099a8 "Disable interactive control via the keyboard", arg_description = 0x0}, {long_name = 0x409230 "volume", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_DOUBLE, arg_data = 0x7fffffffdbc0, description = 0x409237 "Volume", arg_description = 0x0}, {long_name = 0x40923e "start-position", short_name = 115 's', flags = 0, arg = G_OPTION_ARG_DOUBLE, arg_data = 0x7fffffffdbc8, description = 0x40924d "Start position in seconds.", arg_description = 0x0}, {long_name = 0x409218 "playlist", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_FILENAME, arg_data = 0x7fffffffdbf8, description = 0x4099d8 "Playlist file containing input media files", arg_description = 0x0}, {long_name = 0x409268 "instant-rate-changes", short_name = 105 'i', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x40c4f0 <instant_rate_changes>, description = 0x409a08 "Use the experimental instant-rate-change flag when changing rate", arg_description = 0x0}, {long_name = 0x40927d "quiet", short_name = 113 'q', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x40c4f4 <quiet>, description = 0x409a50 "Do not print any output (apart from errors)", arg_description = 0x0}, {long_name = 0x409283 "use-playbin3", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x7fffffffdbb8, description = 0x409a80 "Use playbin3 pipeline (default varies depending on 'USE_PLAYBIN' env variable)", arg_description = 0x0}, {long_name = 0x409290 "wait-on-eos", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x40c4f8 <wait_on_eos>, description = 0x409ad0 "Keep showing the last frame on EOS until quit or playlist change command (gapless is ignored)", arg_description = 0x0}, {long_name = 0x40929c "no-position", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x7fffffffdbbc, description = 0x409b30 "Do not print current position of pipeline", arg_description = 0x0}, {long_name = 0x409426 "", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_FILENAME_ARRAY, arg_data = 0x7fffffffdbd0, description = 0x0, arg_description = 0x0}, {long_name = 0x0, short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x0, description = 0x0, arg_description = 0x0}}
__func__ = "real_main"
#27 real_main (argc=<optimized out>, argv=<optimized out>) at ../subprojects/gst-plugins-base/tools/gst-play.c:1823
play = 0x6be600
playlist = <optimized out>
verbose = 0
print_version = 0
interactive = 1
gapless = 0
instant_uri = 0
shuffle = 0
volume = -1
start_position = 0
filenames = 0x4488a0
audio_sink = 0x0
video_sink = 0x448a10 "clappersink"
uris = <optimized out>
flags = 0x0
num = <optimized out>
i = <optimized out>
err = 0x0
ctx = <optimized out>
playlist_file = 0x0
use_playbin3 = 0
no_position = 0
options = {{long_name = 0x4091b8 "verbose", short_name = 118 'v', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x7fffffffdba0, description = 0x409870 "Output status information and property notifications", arg_description = 0x0}, {long_name = 0x40909b "flags", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x7fffffffdbe8, description = 0x4098a8 "Control playback behaviour setting playbin 'flags' property", arg_description = 0x0}, {long_name = 0x4091c0 "version", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x7fffffffdba4, description = 0x4098e8 "Print version information and exit", arg_description = 0x0}, {long_name = 0x4091c8 "videosink", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x7fffffffdbe0, description = 0x409910 "Video sink to use (default is autovideosink)", arg_description = 0x0}, {long_name = 0x4091d2 "audiosink", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x7fffffffdbd8, description = 0x409940 "Audio sink to use (default is autoaudiosink)", arg_description = 0x0}, {long_name = 0x4091dc "gapless", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x7fffffffdbac, description = 0x4091e4 "Enable gapless playback", arg_description = 0x0}, {long_name = 0x4091fc "instant-uri", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x7fffffffdbb0, description = 0x409970 "Enable instantaneous uri changes (only with playbin3)", arg_description = 0x0}, {long_name = 0x409208 "shuffle", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x7fffffffdbb4, description = 0x409210 "Shuffle playlist", arg_description = 0x0}, {long_name = 0x409221 "no-interactive", short_name = 0 '\000', flags = 4, arg = G_OPTION_ARG_NONE, arg_data = 0x7fffffffdba8, description = 0x4099a8 "Disable interactive control via the keyboard", arg_description = 0x0}, {long_name = 0x409230 "volume", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_DOUBLE, arg_data = 0x7fffffffdbc0, description = 0x409237 "Volume", arg_description = 0x0}, {long_name = 0x40923e "start-position", short_name = 115 's', flags = 0, arg = G_OPTION_ARG_DOUBLE, arg_data = 0x7fffffffdbc8, description = 0x40924d "Start position in seconds.", arg_description = 0x0}, {long_name = 0x409218 "playlist", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_FILENAME, arg_data = 0x7fffffffdbf8, description = 0x4099d8 "Playlist file containing input media files", arg_description = 0x0}, {long_name = 0x409268 "instant-rate-changes", short_name = 105 'i', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x40c4f0 <instant_rate_changes>, description = 0x409a08 "Use the experimental instant-rate-change flag when changing rate", arg_description = 0x0}, {long_name = 0x40927d "quiet", short_name = 113 'q', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x40c4f4 <quiet>, description = 0x409a50 "Do not print any output (apart from errors)", arg_description = 0x0}, {long_name = 0x409283 "use-playbin3", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x7fffffffdbb8, description = 0x409a80 "Use playbin3 pipeline (default varies depending on 'USE_PLAYBIN' env variable)", arg_description = 0x0}, {long_name = 0x409290 "wait-on-eos", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x40c4f8 <wait_on_eos>, description = 0x409ad0 "Keep showing the last frame on EOS until quit or playlist change command (gapless is ignored)", arg_description = 0x0}, {long_name = 0x40929c "no-position", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x7fffffffdbbc, description = 0x409b30 "Do not print current position of pipeline", arg_description = 0x0}, {long_name = 0x409426 "", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_FILENAME_ARRAY, arg_data = 0x7fffffffdbd0, description = 0x0, arg_description = 0x0}, {long_name = 0x0, short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x0, description = 0x0, arg_description = 0x0}}
__func__ = "real_main"
#28 0x00007ffff7848560 in __libc_start_call_main () at /lib64/libc.so.6
#29 0x00007ffff784860c in __libc_start_main_impl () at /lib64/libc.so.6
#30 0x00000000004049a5 in _start ()
Edited by Rafał Dzięgiel