Race condition on input decoder when running the test
Happened after 2400 run of the tests with thread sanitizer:
==================
WARNING: ThreadSanitizer: data race (pid=165333)
Read of size 8 at 0x7b7000010028 by thread T24:
#0 vlc_input_decoder_Delete ../../src/input/decoder.c:2239 (libvlccore.so.9+0x692ce)
#1 EsOutDestroyDecoder ../../src/input/es_out.c:2412 (libvlccore.so.9+0x6f10f)
#2 EsOutUnselectEs ../../src/input/es_out.c:2581 (libvlccore.so.9+0x71c1d)
#3 EsOutVaPrivControlLocked ../../src/input/es_out.c:3745 (libvlccore.so.9+0x76e82)
#4 EsOutPrivControl ../../src/input/es_out.c:4040 (libvlccore.so.9+0x79ae7)
#5 es_out_vaPrivControl ../../src/input/es_out.h:105 (libvlccore.so.9+0x7f97a)
#6 es_out_PrivControl ../../src/input/es_out.h:112 (libvlccore.so.9+0x7f97a)
#7 CmdExecutePrivControl ../../src/input/es_out_timeshift.c:1809 (libvlccore.so.9+0x7fb4b)
#8 PrivControlLocked ../../src/input/es_out_timeshift.c:799 (libvlccore.so.9+0x80f0f)
#9 PrivControl ../../src/input/es_out_timeshift.c:858 (libvlccore.so.9+0x80f0f)
#10 es_out_vaPrivControl ../../src/input/es_out.h:105 (libvlccore.so.9+0x844ba)
#11 es_out_PrivControl ../../src/input/es_out.h:112 (libvlccore.so.9+0x844ba)
#12 es_out_SetMode ../../src/input/es_out.h:119 (libvlccore.so.9+0x8e6b9)
#13 End ../../src/input/input.c:1400 (libvlccore.so.9+0x8e6b9)
#14 Run ../../src/input/input.c:431 (libvlccore.so.9+0x8ebe4)
Previous write of size 8 at 0x7b7000010028 by thread T26:
#0 decoder_Init ../../src/input/decoder_helpers.c:50 (libvlccore.so.9+0x6ab2e)
#1 LoadDecoder ../../src/input/decoder.c:271 (libvlccore.so.9+0x656be)
#2 DecoderThread_Reload ../../src/input/decoder.c:332 (libvlccore.so.9+0x659a3)
#3 DecoderThread_ProcessInput ../../src/input/decoder.c:1485 (libvlccore.so.9+0x66bb9)
#4 DecoderThread_DecodeBlock ../../src/input/decoder.c:1452 (libvlccore.so.9+0x66a45)
#5 DecoderThread_ProcessInput ../../src/input/decoder.c:1559 (libvlccore.so.9+0x66d1e)
#6 DecoderThread ../../src/input/decoder.c:1791 (libvlccore.so.9+0x6873c)
Location is heap block of size 2000 at 0x7b7000010000 allocated by thread T24:
#0 calloc /usr/src/debug/gcc/libsanitizer/tsan/tsan_interceptors_posix.cpp:667 (libtsan.so.2+0x42202)
#1 vlc_custom_create ../../src/misc/objects.c:96 (libvlccore.so.9+0x109d83)
#2 CreateDecoder ../../src/input/decoder.c:1870 (libvlccore.so.9+0x65ade)
#3 decoder_New ../../src/input/decoder.c:2128 (libvlccore.so.9+0x65ade)
#4 vlc_input_decoder_New ../../src/input/decoder.c:2189 (libvlccore.so.9+0x67bf0)
#5 EsOutCreateDecoder ../../src/input/es_out.c:2364 (libvlccore.so.9+0x6e732)
#6 EsOutSelectEs ../../src/input/es_out.c:2494 (libvlccore.so.9+0x70d13)
#7 EsOutSelect ../../src/input/es_out.c:2780 (libvlccore.so.9+0x71e56)
#8 EsOutVaPrivControlLocked ../../src/input/es_out.c:3749 (libvlccore.so.9+0x78936)
#9 EsOutPrivControl ../../src/input/es_out.c:4040 (libvlccore.so.9+0x79ae7)
#10 es_out_vaPrivControl ../../src/input/es_out.h:105 (libvlccore.so.9+0x7f97a)
#11 es_out_PrivControl ../../src/input/es_out.h:112 (libvlccore.so.9+0x7f97a)
#12 CmdExecutePrivControl ../../src/input/es_out_timeshift.c:1809 (libvlccore.so.9+0x7fb4b)
#13 PrivControlLocked ../../src/input/es_out_timeshift.c:799 (libvlccore.so.9+0x80f0f)
#14 PrivControl ../../src/input/es_out_timeshift.c:858 (libvlccore.so.9+0x80f0f)
#15 es_out_vaPrivControl ../../src/input/es_out.h:105 (libvlccore.so.9+0x844ba)
#16 es_out_PrivControl ../../src/input/es_out.h:112 (libvlccore.so.9+0x844ba)
#17 es_out_SetMode ../../src/input/es_out.h:119 (libvlccore.so.9+0x89c76)
#18 InitPrograms ../../src/input/input.c:1227 (libvlccore.so.9+0x89c76)
#19 Init ../../src/input/input.c:1316 (libvlccore.so.9+0x89c76)
#20 Run ../../src/input/input.c:426 (libvlccore.so.9+0x8eb44)
Thread T24 'vlc-input' (tid=165359, running) created by main thread at:
#0 pthread_create /usr/src/debug/gcc/libsanitizer/tsan/tsan_interceptors_posix.cpp:1001 (libtsan.so.2+0x670c9)
#1 vlc_clone_attr ../../src/posix/thread.c:179 (libvlccore.so.9+0x11ae49)
#2 vlc_clone ../../src/posix/thread.c:190 (libvlccore.so.9+0x11ae49)
#3 input_Start ../../src/input/input.c:130 (libvlccore.so.9+0x87013)
#4 vlc_player_input_Start ../../src/player/input.c:96 (libvlccore.so.9+0x9b042)
#5 vlc_player_Start ../../src/player/player.c:1177 (libvlccore.so.9+0x96440)
#6 play_scenario ../../test/src/input/decoder/input_decoder.c:259 (test_src_input_decoder+0x3235)
#7 OpenIntf ../../test/src/input/decoder/input_decoder.c:288 (test_src_input_decoder+0x3235)
#8 generic_start ../../src/modules/modules.c:275 (libvlccore.so.9+0x3eb59)
#9 vlc_module_load ../../src/modules/modules.c:243 (libvlccore.so.9+0x3f822)
#10 module_need ../../src/modules/modules.c:286 (libvlccore.so.9+0x3fac9)
#11 intf_Create ../../src/interface/interface.c:172 (libvlccore.so.9+0x487ea)
#12 libvlc_InternalAddIntf ../../src/interface/interface.c:267 (libvlccore.so.9+0x48c21)
#13 libvlc_add_intf ../../lib/playlist.c:41 (libvlc.so.12+0xd5c8)
#14 main ../../test/src/input/decoder/input_decoder.c:353 (test_src_input_decoder+0x2584)
Thread T26 'vlc-dec-video' (tid=165361, running) created by thread T24 at:
#0 pthread_create /usr/src/debug/gcc/libsanitizer/tsan/tsan_interceptors_posix.cpp:1001 (libtsan.so.2+0x670c9)
#1 vlc_clone_attr ../../src/posix/thread.c:179 (libvlccore.so.9+0x11ae49)
#2 vlc_clone ../../src/posix/thread.c:190 (libvlccore.so.9+0x11ae49)
#3 decoder_New ../../src/input/decoder.c:2167 (libvlccore.so.9+0x66324)
#4 vlc_input_decoder_New ../../src/input/decoder.c:2189 (libvlccore.so.9+0x67bf0)
#5 EsOutCreateDecoder ../../src/input/es_out.c:2364 (libvlccore.so.9+0x6e732)
#6 EsOutSelectEs ../../src/input/es_out.c:2494 (libvlccore.so.9+0x70d13)
#7 EsOutSelect ../../src/input/es_out.c:2780 (libvlccore.so.9+0x71e56)
#8 EsOutVaPrivControlLocked ../../src/input/es_out.c:3749 (libvlccore.so.9+0x78936)
#9 EsOutPrivControl ../../src/input/es_out.c:4040 (libvlccore.so.9+0x79ae7)
#10 es_out_vaPrivControl ../../src/input/es_out.h:105 (libvlccore.so.9+0x7f97a)
#11 es_out_PrivControl ../../src/input/es_out.h:112 (libvlccore.so.9+0x7f97a)
#12 CmdExecutePrivControl ../../src/input/es_out_timeshift.c:1809 (libvlccore.so.9+0x7fb4b)
#13 PrivControlLocked ../../src/input/es_out_timeshift.c:799 (libvlccore.so.9+0x80f0f)
#14 PrivControl ../../src/input/es_out_timeshift.c:858 (libvlccore.so.9+0x80f0f)
#15 es_out_vaPrivControl ../../src/input/es_out.h:105 (libvlccore.so.9+0x844ba)
#16 es_out_PrivControl ../../src/input/es_out.h:112 (libvlccore.so.9+0x844ba)
#17 es_out_SetMode ../../src/input/es_out.h:119 (libvlccore.so.9+0x89c76)
#18 InitPrograms ../../src/input/input.c:1227 (libvlccore.so.9+0x89c76)
#19 Init ../../src/input/input.c:1316 (libvlccore.so.9+0x89c76)
#20 Run ../../src/input/input.c:426 (libvlccore.so.9+0x8eb44)
SUMMARY: ThreadSanitizer: data race ../../src/input/decoder.c:2239 in vlc_input_decoder_Delete
==================
==================
WARNING: ThreadSanitizer: data race (pid=165333)
Read of size 4 at 0x7b7000010158 by thread T24:
#0 vlc_input_decoder_Delete ../../src/input/decoder.c:2239 (libvlccore.so.9+0x692da)
#1 EsOutDestroyDecoder ../../src/input/es_out.c:2412 (libvlccore.so.9+0x6f10f)
#2 EsOutUnselectEs ../../src/input/es_out.c:2581 (libvlccore.so.9+0x71c1d)
#3 EsOutVaPrivControlLocked ../../src/input/es_out.c:3745 (libvlccore.so.9+0x76e82)
#4 EsOutPrivControl ../../src/input/es_out.c:4040 (libvlccore.so.9+0x79ae7)
#5 es_out_vaPrivControl ../../src/input/es_out.h:105 (libvlccore.so.9+0x7f97a)
#6 es_out_PrivControl ../../src/input/es_out.h:112 (libvlccore.so.9+0x7f97a)
#7 CmdExecutePrivControl ../../src/input/es_out_timeshift.c:1809 (libvlccore.so.9+0x7fb4b)
#8 PrivControlLocked ../../src/input/es_out_timeshift.c:799 (libvlccore.so.9+0x80f0f)
#9 PrivControl ../../src/input/es_out_timeshift.c:858 (libvlccore.so.9+0x80f0f)
#10 es_out_vaPrivControl ../../src/input/es_out.h:105 (libvlccore.so.9+0x844ba)
#11 es_out_PrivControl ../../src/input/es_out.h:112 (libvlccore.so.9+0x844ba)
#12 es_out_SetMode ../../src/input/es_out.h:119 (libvlccore.so.9+0x8e6b9)
#13 End ../../src/input/input.c:1400 (libvlccore.so.9+0x8e6b9)
#14 Run ../../src/input/input.c:431 (libvlccore.so.9+0x8ebe4)
Previous write of size 8 at 0x7b7000010158 by thread T26:
#0 es_format_Copy ../../src/misc/es_format.c:441 (libvlccore.so.9+0xf7daa)
#1 decoder_Init ../../src/input/decoder_helpers.c:49 (libvlccore.so.9+0x6ab25)
#2 LoadDecoder ../../src/input/decoder.c:271 (libvlccore.so.9+0x656be)
#3 DecoderThread_Reload ../../src/input/decoder.c:332 (libvlccore.so.9+0x659a3)
#4 DecoderThread_ProcessInput ../../src/input/decoder.c:1485 (libvlccore.so.9+0x66bb9)
#5 DecoderThread_DecodeBlock ../../src/input/decoder.c:1452 (libvlccore.so.9+0x66a45)
#6 DecoderThread_ProcessInput ../../src/input/decoder.c:1559 (libvlccore.so.9+0x66d1e)
#7 DecoderThread ../../src/input/decoder.c:1791 (libvlccore.so.9+0x6873c)
Location is heap block of size 2000 at 0x7b7000010000 allocated by thread T24:
#0 calloc /usr/src/debug/gcc/libsanitizer/tsan/tsan_interceptors_posix.cpp:667 (libtsan.so.2+0x42202)
#1 vlc_custom_create ../../src/misc/objects.c:96 (libvlccore.so.9+0x109d83)
#2 CreateDecoder ../../src/input/decoder.c:1870 (libvlccore.so.9+0x65ade)
#3 decoder_New ../../src/input/decoder.c:2128 (libvlccore.so.9+0x65ade)
#4 vlc_input_decoder_New ../../src/input/decoder.c:2189 (libvlccore.so.9+0x67bf0)
#5 EsOutCreateDecoder ../../src/input/es_out.c:2364 (libvlccore.so.9+0x6e732)
#6 EsOutSelectEs ../../src/input/es_out.c:2494 (libvlccore.so.9+0x70d13)
#7 EsOutSelect ../../src/input/es_out.c:2780 (libvlccore.so.9+0x71e56)
#8 EsOutVaPrivControlLocked ../../src/input/es_out.c:3749 (libvlccore.so.9+0x78936)
#9 EsOutPrivControl ../../src/input/es_out.c:4040 (libvlccore.so.9+0x79ae7)
#10 es_out_vaPrivControl ../../src/input/es_out.h:105 (libvlccore.so.9+0x7f97a)
#11 es_out_PrivControl ../../src/input/es_out.h:112 (libvlccore.so.9+0x7f97a)
#12 CmdExecutePrivControl ../../src/input/es_out_timeshift.c:1809 (libvlccore.so.9+0x7fb4b)
#13 PrivControlLocked ../../src/input/es_out_timeshift.c:799 (libvlccore.so.9+0x80f0f)
#14 PrivControl ../../src/input/es_out_timeshift.c:858 (libvlccore.so.9+0x80f0f)
#15 es_out_vaPrivControl ../../src/input/es_out.h:105 (libvlccore.so.9+0x844ba)
#16 es_out_PrivControl ../../src/input/es_out.h:112 (libvlccore.so.9+0x844ba)
#17 es_out_SetMode ../../src/input/es_out.h:119 (libvlccore.so.9+0x89c76)
#18 InitPrograms ../../src/input/input.c:1227 (libvlccore.so.9+0x89c76)
#19 Init ../../src/input/input.c:1316 (libvlccore.so.9+0x89c76)
#20 Run ../../src/input/input.c:426 (libvlccore.so.9+0x8eb44)
Thread T24 'vlc-input' (tid=165359, running) created by main thread at:
#0 pthread_create /usr/src/debug/gcc/libsanitizer/tsan/tsan_interceptors_posix.cpp:1001 (libtsan.so.2+0x670c9)
#1 vlc_clone_attr ../../src/posix/thread.c:179 (libvlccore.so.9+0x11ae49)
#2 vlc_clone ../../src/posix/thread.c:190 (libvlccore.so.9+0x11ae49)
#3 input_Start ../../src/input/input.c:130 (libvlccore.so.9+0x87013)
#4 vlc_player_input_Start ../../src/player/input.c:96 (libvlccore.so.9+0x9b042)
#5 vlc_player_Start ../../src/player/player.c:1177 (libvlccore.so.9+0x96440)
#6 play_scenario ../../test/src/input/decoder/input_decoder.c:259 (test_src_input_decoder+0x3235)
#7 OpenIntf ../../test/src/input/decoder/input_decoder.c:288 (test_src_input_decoder+0x3235)
#8 generic_start ../../src/modules/modules.c:275 (libvlccore.so.9+0x3eb59)
#9 vlc_module_load ../../src/modules/modules.c:243 (libvlccore.so.9+0x3f822)
#10 module_need ../../src/modules/modules.c:286 (libvlccore.so.9+0x3fac9)
#11 intf_Create ../../src/interface/interface.c:172 (libvlccore.so.9+0x487ea)
#12 libvlc_InternalAddIntf ../../src/interface/interface.c:267 (libvlccore.so.9+0x48c21)
#13 libvlc_add_intf ../../lib/playlist.c:41 (libvlc.so.12+0xd5c8)
#14 main ../../test/src/input/decoder/input_decoder.c:353 (test_src_input_decoder+0x2584)
Thread T26 'vlc-dec-video' (tid=165361, running) created by thread T24 at:
#0 pthread_create /usr/src/debug/gcc/libsanitizer/tsan/tsan_interceptors_posix.cpp:1001 (libtsan.so.2+0x670c9)
#1 vlc_clone_attr ../../src/posix/thread.c:179 (libvlccore.so.9+0x11ae49)
#2 vlc_clone ../../src/posix/thread.c:190 (libvlccore.so.9+0x11ae49)
#3 decoder_New ../../src/input/decoder.c:2167 (libvlccore.so.9+0x66324)
#4 vlc_input_decoder_New ../../src/input/decoder.c:2189 (libvlccore.so.9+0x67bf0)
#5 EsOutCreateDecoder ../../src/input/es_out.c:2364 (libvlccore.so.9+0x6e732)
#6 EsOutSelectEs ../../src/input/es_out.c:2494 (libvlccore.so.9+0x70d13)
#7 EsOutSelect ../../src/input/es_out.c:2780 (libvlccore.so.9+0x71e56)
#8 EsOutVaPrivControlLocked ../../src/input/es_out.c:3749 (libvlccore.so.9+0x78936)
#9 EsOutPrivControl ../../src/input/es_out.c:4040 (libvlccore.so.9+0x79ae7)
#10 es_out_vaPrivControl ../../src/input/es_out.h:105 (libvlccore.so.9+0x7f97a)
#11 es_out_PrivControl ../../src/input/es_out.h:112 (libvlccore.so.9+0x7f97a)
#12 CmdExecutePrivControl ../../src/input/es_out_timeshift.c:1809 (libvlccore.so.9+0x7fb4b)
#13 PrivControlLocked ../../src/input/es_out_timeshift.c:799 (libvlccore.so.9+0x80f0f)
#14 PrivControl ../../src/input/es_out_timeshift.c:858 (libvlccore.so.9+0x80f0f)
#15 es_out_vaPrivControl ../../src/input/es_out.h:105 (libvlccore.so.9+0x844ba)
#16 es_out_PrivControl ../../src/input/es_out.h:112 (libvlccore.so.9+0x844ba)
#17 es_out_SetMode ../../src/input/es_out.h:119 (libvlccore.so.9+0x89c76)
#18 InitPrograms ../../src/input/input.c:1227 (libvlccore.so.9+0x89c76)
#19 Init ../../src/input/input.c:1316 (libvlccore.so.9+0x89c76)
#20 Run ../../src/input/input.c:426 (libvlccore.so.9+0x8eb44)
SUMMARY: ThreadSanitizer: data race ../../src/input/decoder.c:2239 in vlc_input_decoder_Delete
==================