mirror of https://code.videolan.org/videolan/vlc
90e98b012e
`restrict` tells the compiler that the tombstone pointer is the only way to access the variable pointed by it. This is not case with multi-threading. From the C11 specs: § 6.7.3 item 8 An object that is accessed through a restrict-qualified pointer has a special association with that pointer. This association, defined in 6.7.3.1 below, requires that all accesses to that object use, directly or indirectly, the value of that particular pointer. § 6.7.3.1 item 4 Every other lvalue used to access the value of X shall also have its address based on P. Also set the pointer to const. Fixes the following race condition when closing live555: Thread 80 (Thread 28393.4880): 0 0x0000007953dbebbc in syscall () from /home/tom/work/git/libvlcjni/libvlc/.gdb/obj/local/arm64-v8a/system/lib64/libc.so 1 0x0000007855d2c0ec in sys_futex (addr=0x89, op=137, val=0, to=0x0, addr2=0x0, val3=-1) at ../../src/linux/thread.c:82 2 vlc_futex_wait (addr=0x89, flags=0, val=0, to=0x0) at ../../src/linux/thread.c:93 3 vlc_atomic_wait (addr=0x89, val=0) at ../../src/linux/thread.c:109 4 0x0000007855d20e9c in vlc_cond_wait (cond=cond@entry=0x7829f26ce8, mutex=mutex@entry=0x7829f26cd8) at ../../src/misc/threads.c:298 5 0x0000007855d42244 in vlc_queue_Wait (q=0x7829f26cc0) at ../../include/vlc_queue.h:122 6 vlc_queue_DequeueKillable (q=0x7829f26cc0, tombstone=0x7829f26d00) at ../../include/vlc_queue.h:248 7 vlc_stream_fifo_Block (s=<optimized out>, eof=0x78709a8838) at ../../src/input/stream_fifo.c:75 8 0x0000007855cfa160 in vlc_stream_ReadRaw (s=s@entry=0x7819411360, buf=buf@entry=0x78c4393c80, len=len@entry=188) at ../../src/input/stream.c:466 9 0x0000007855cf9fe0 in vlc_stream_ReadPartial (s=s@entry=0x7819411360, buf=buf@entry=0x78c4393c80, len=len@entry=188) at ../../src/input/stream.c:489 10 0x0000007855cfad44 in vlc_stream_Read (s=<optimized out>, buf=0x78c4393c80, len=188) at ../../src/input/stream.c:504 11 vlc_stream_Block (s=0x7819411360, size=<optimized out>) at ../../src/input/stream.c:909 12 0x0000007855f1fe5c in ReadTSPacket (p_demux=p_demux@entry=0x78c42c0ce0) at ../../modules/demux/mpeg/ts.c:1808 13 0x0000007855f1de30 in Demux (p_demux=<optimized out>) at ../../modules/demux/mpeg/ts.c:649 4 0x0000007855d41e4c in vlc_demux_chained_Thread (data=0x7829f26c70) at ../../src/input/demux_chained.c:96 15 0x0000007855d2d5b8 in joinable_thread (data=0x7823341ea0) at ../../src/android/thread.c:96 16 0x0000007953e217c4 in __pthread_start(void*) () from /home/tom/work/git/libvlcjni/libvlc/.gdb/obj/local/arm64-v8a/system/lib64/libc.so 17 0x0000007953dc41ac in __start_thread () from /home/tom/work/git/libvlcjni/libvlc/.gdb/obj/local/arm64-v8a/system/lib64/libc.so Thread 79 (Thread 28393.4875): 0 0x0000007953dbebbc in syscall () from /home/tom/work/git/libvlcjni/libvlc/.gdb/obj/local/arm64-v8a/system/lib64/libc.so 1 0x0000007953e21d98 in pthread_join () from /home/tom/work/git/libvlcjni/libvlc/.gdb/obj/local/arm64-v8a/system/lib64/libc.so 2 0x0000007855d2d204 in vlc_join (handle=0x7823341ea0, result=0x0) at ../../src/android/thread.c:147 3 0x0000007855d4202c in vlc_demux_chained_Delete (dc=0x7829f26c70) at ../../src/input/demux_chained.c:167 4 0x0000007855d3d92c in Close (p_this=<optimized out>) at ../../modules/access/live555.cpp:505 5 0x0000007855cb49dc in module_unneed (obj=obj@entry=0x78194110c0, module=0x78c83b0520) at ../../src/modules/modules.c:305 6 0x0000007855ceae78 in vlc_access_Destroy (access=0x78194110c0) at ../../src/input/access.c:54 7 0x0000007855cf958c in vlc_stream_Delete (s=0x78194110c0) at ../../src/input/stream.c:150 8 0x0000007855ce4954 in demux_Delete (demux=0x78709a8d60) at ../../include/vlc_demux.h:291 9 InputSourceDestroy (in=0x781a3aa780) at ../../src/input/input.c:2852 10 0x0000007855ce39f0 in End (p_input=p_input@entry=0x7863073c00) at ../../src/input/input.c:1413 11 0x0000007855ce0620 in Run (data=0x7863073c00) at ../../src/input/input.c:431 12 0x0000007855d2d5b8 in joinable_thread (data=0x78231b02c0) at ../../src/android/thread.c:96 13 0x0000007953e217c4 in __pthread_start(void*) () from /home/tom/work/git/libvlcjni/libvlc/.gdb/obj/local/arm64-v8a/system/lib64/libc.so 14 0x0000007953dc41ac in __start_thread () from /home/tom/work/git/libvlcjni/libvlc/.gdb/obj/local/arm64-v8a/system/lib64/libc.so |
||
---|---|---|
.. | ||
vlc | ||
.gitignore | ||
meson.build | ||
vlc_access.h | ||
vlc_actions.h | ||
vlc_addons.h | ||
vlc_ancillary.h | ||
vlc_aout.h | ||
vlc_aout_volume.h | ||
vlc_arrays.h | ||
vlc_atomic.h | ||
vlc_avcodec.h | ||
vlc_bits.h | ||
vlc_block.h | ||
vlc_block_helper.h | ||
vlc_boxes.h | ||
vlc_charset.h | ||
vlc_clock.h | ||
vlc_codec.h | ||
vlc_codecs.h | ||
vlc_common.h | ||
vlc_config.h | ||
vlc_config_cat.h | ||
vlc_configuration.h | ||
vlc_cpu.h | ||
vlc_cxx_helpers.hpp | ||
vlc_decoder.h | ||
vlc_demux.h | ||
vlc_dialog.h | ||
vlc_diffutil.h | ||
vlc_epg.h | ||
vlc_es.h | ||
vlc_es_out.h | ||
vlc_events.h | ||
vlc_executor.h | ||
vlc_extensions.h | ||
vlc_filter.h | ||
vlc_fingerprinter.h | ||
vlc_fixups.h | ||
vlc_fourcc.h | ||
vlc_frame.h | ||
vlc_fs.h | ||
vlc_gcrypt.h | ||
vlc_hash.h | ||
vlc_http.h | ||
vlc_httpd.h | ||
vlc_image.h | ||
vlc_inhibit.h | ||
vlc_input.h | ||
vlc_input_item.h | ||
vlc_interface.h | ||
vlc_interrupt.h | ||
vlc_intf_strings.h | ||
vlc_iso_lang.h | ||
vlc_keystore.h | ||
vlc_list.h | ||
vlc_media_library.h | ||
vlc_media_source.h | ||
vlc_memstream.h | ||
vlc_messages.h | ||
vlc_meta.h | ||
vlc_meta_fetcher.h | ||
vlc_mime.h | ||
vlc_modules.h | ||
vlc_mouse.h | ||
vlc_network.h | ||
vlc_objects.h | ||
vlc_opengl.h | ||
vlc_opengl_interop.h | ||
vlc_pgpkey.h | ||
vlc_picture.h | ||
vlc_picture_fifo.h | ||
vlc_picture_pool.h | ||
vlc_player.h | ||
vlc_playlist.h | ||
vlc_playlist_export.h | ||
vlc_plugin.h | ||
vlc_probe.h | ||
vlc_queue.h | ||
vlc_rand.h | ||
vlc_renderer_discovery.h | ||
vlc_services_discovery.h | ||
vlc_sort.h | ||
vlc_sout.h | ||
vlc_spawn.h | ||
vlc_spu.h | ||
vlc_stream.h | ||
vlc_stream_extractor.h | ||
vlc_strings.h | ||
vlc_subpicture.h | ||
vlc_text_style.h | ||
vlc_threads.h | ||
vlc_thumbnailer.h | ||
vlc_tick.h | ||
vlc_timestamp_helper.h | ||
vlc_tls.h | ||
vlc_tracer.h | ||
vlc_update.h | ||
vlc_url.h | ||
vlc_variables.h | ||
vlc_vector.h | ||
vlc_video_splitter.h | ||
vlc_viewpoint.h | ||
vlc_vlm.h | ||
vlc_vout.h | ||
vlc_vout_display.h | ||
vlc_vout_osd.h | ||
vlc_window.h | ||
vlc_xlib.h | ||
vlc_xml.h |