Memory leak in ' av_packet_add_side_data' in /lib/x86_64-linux-gnu/libavcodec.so reading the file clock_odd_size_RLE_g1597902.avi
Describe your issue
Expected Behavior
Observed Behavior
Setup
- Operating System:
- Debian 10
- Device: Computer / Tablet / Mobile / Virtual Machine <!-- Delete as appropriate !3075 >
- Desktop
- GStreamer Version:
- Gstreamer 1.0
- Command line:
Steps to reproduce the bug
Reproduction code
-
See video file clock_odd_size_RLE_g1597902.avi in attachment.
-
See repro.c for the reproduction code.
-
Compile code
g++ repro.cpp -o repro -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/user/include/gcc_headers -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 -lgstvideo-1.0 -lgstbase-1.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lxml2 -lgstapp-1.0
% ./repro (Make sure the video file and executable repro are in the same directory)
Playbin initializated successfully
Appsink has been created
playbin successfully changed to paused
Obtain the videoCaps from the appsink
playbin successfully changed to playing
Memory Testing . Any leak checking tool detect the following leak:
#1) 0x7f21b84c8d82 in av_packet_add_side_data (/lib/x86_64-linux-gnu/libavcodec.so.58+0x19cd82) LSAN_STACK_RAW [ 1] 0x7f21b84c8d82 /lib/x86_64-linux-gnu/libavcodec.so.58+0x19cd82
#2) 0x7f21b84c8e4c in av_packet_new_side_data (/lib/x86_64-linux-gnu/libavcodec.so.58+0x19ce4c) LSAN_STACK_RAW [ 2] 0x7f21b84c8e4c /lib/x86_64-linux-gnu/libavcodec.so.58+0x19ce4c
#3) 0x7f21bc1c3e52 (/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstlibav.so+0x1fe52) LSAN_STACK_RAW [ 3] 0x7f21bc1c3e52 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstlibav.so+0x1fe52
#4) 0x7f21bf1e7e0a in gst_video_decoder_decode_frame gst-libs/gst/video/gstvideodecoder.c:3416 LSAN_STACK_RAW [ 4] 0x7f21bf1e7e0a /lib/x86_64-linux-gnu/libgstvideo-1.0.so.0+0x3ee0a
#5) 0x7f21bf1ea913 in gst_video_decoder_chain_forward gst-libs/gst/video/gstvideodecoder.c:2142 LSAN_STACK_RAW [ 5] 0x7f21bf1ea913 /lib/x86_64-linux-gnu/libgstvideo-1.0.so.0+0x41913
#6) 0x7f21bf1eaff1 in gst_video_decoder_chain gst-libs/gst/video/gstvideodecoder.c:2456 LSAN_STACK_RAW [ 6] 0x7f21bf1eaff1 /lib/x86_64-linux-gnu/libgstvideo-1.0.so.0+0x41ff1
#7) 0x7f21bf42fc39 (/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0+0x76c39) LSAN_STACK_RAW [ 7] 0x7f21bf42fc39 /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0+0x76c39
#8) 0x7f21bf437ed1 in gst_pad_push (/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0+0x7eed1) LSAN_STACK_RAW [ 8] 0x7f21bf437ed1 /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0+0x7eed1
#9) 0x7f21bc4c9a8c (/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstcoreelements.so+0x2ca8c) LSAN_STACK_RAW [ 9] 0x7f21bc4c9a8c /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstcoreelements.so+0x2ca8c
#10) 0x7f21bf464f40 (/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0+0xabf40) LSAN_STACK_RAW [ 10] 0x7f21bf464f40 /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0+0xabf40
#11) 0x7f21bf2bae72 (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x76e72) LSAN_STACK_RAW [ 11] 0x7f21bf2bae72 /lib/x86_64-linux-gnu/libglib-2.0.so.0+0x76e72
#12) 0x7f21bf2ba4d4 (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x764d4) LSAN_STACK_RAW [ 12] 0x7f21bf2ba4d4 /lib/x86_64-linux-gnu/libglib-2.0.so.0+0x764d4
#13) 0x7f21bec22fa2 in start_thread /build/glibc-2.28/nptl/pthread_create.c:486 LSAN_STACK_RAW [ 13] 0x7f21bec22fa2 /lib/x86_64-linux-gnu/libpthread.so.0+0x7fa2
#14) 0x7f21beb534ce in clone (/lib/x86_64-linux-gnu/libc.so.6+0xf94ce) LSAN_STACK_RAW [ 14] 0x7f21beb534ce /lib/x86_64-linux-gnu/libc.so.6+0xf94ce
Full memory leak stack[g2852619.ZIP](/uploads/5f9105d35998ee992354cc8812a73f92/g2852619.ZIP)
==143708==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 16384 byte(s) in 1 object(s) allocated from:
#0) 0x7f21bf5bddb0 in __interceptor_malloc /mathworks/devel/sandbox/pnarsing/3p-internal-AH3/3p/sources/gcc-10.3/libsanitizer/lsan/lsan_interceptors.cpp:54 LSAN_STACK_RAW [ 0] 0x7f21bf5bddb0 /mathworks/hub/3rdparty/internal/8686358/glnxa64/gcc-10.3.0/lib64/liblsan.so+0xfdb0
#1) 0x7f21bf297990 in g_malloc (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x53990) LSAN_STACK_RAW [ 1] 0x7f21bf297990 /lib/x86_64-linux-gnu/libglib-2.0.so.0+0x53990
#2) 0x7f21bf2a1f7b (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x5df7b) LSAN_STACK_RAW [ 2] 0x7f21bf2a1f7b /lib/x86_64-linux-gnu/libglib-2.0.so.0+0x5df7b
#3) 0x7f21bfeaf379 in call_init /build/glibc-2.28/elf/dl-init.c:72 LSAN_STACK_RAW [ 3] 0x7f21bfeaf379 /lib64/ld-linux-x86-64.so.2+0xf379
#4) 0x7f21bfeaf475 in call_init /build/glibc-2.28/elf/dl-init.c:118 LSAN_STACK_RAW [ 4] 0x7f21bfeaf475 /lib64/ld-linux-x86-64.so.2+0xf475
#5) 0x7f21bfeaf475 in _dl_init /build/glibc-2.28/elf/dl-init.c:119 LSAN_STACK_RAW [ 5] 0x7f21bfeaf475 /lib64/ld-linux-x86-64.so.2+0xf475
#6) 0x7f21bfea10c9 (/lib64/ld-linux-x86-64.so.2+0x10c9) LSAN_STACK_RAW [ 6] 0x7f21bfea10c9 /lib64/ld-linux-x86-64.so.2+0x10c9
Direct leak of 111 byte(s) in 1 object(s) allocated from:
#0) 0x7f21bf5bddb0 in __interceptor_malloc /mathworks/devel/sandbox/pnarsing/3p-internal-AH3/3p/sources/gcc-10.3/libsanitizer/lsan/lsan_interceptors.cpp:54 LSAN_STACK_RAW [ 0] 0x7f21bf5bddb0 /mathworks/hub/3rdparty/internal/8686358/glnxa64/gcc-10.3.0/lib64/liblsan.so+0xfdb0
#1) 0x7f21bf297990 in g_malloc (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x53990) LSAN_STACK_RAW [ 1] 0x7f21bf297990 /lib/x86_64-linux-gnu/libglib-2.0.so.0+0x53990
#2) 0x7f21bf2b1850 in g_strconcat (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x6d850) LSAN_STACK_RAW [ 2] 0x7f21bf2b1850 /lib/x86_64-linux-gnu/libglib-2.0.so.0+0x6d850
#3) 0x7f21bf273632 in g_filename_to_uri (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x2f632) LSAN_STACK_RAW [ 3] 0x7f21bf273632 /lib/x86_64-linux-gnu/libglib-2.0.so.0+0x2f632
#4) 0x558ef93552dd in main (/mathworks/devel/sbs/12/ugoswami.Bavis.j2201159/matlab/toolbox/shared/shared_video_reader/shared_video_reader_impl/GstReader/repro+0x12dd) LSAN_STACK_RAW [ 4] 0x558ef93552dd /mathworks/devel/sbs/12/ugoswami.Bavis.j2201159/matlab/toolbox/shared/shared_video_reader/shared_video_reader_impl/GstReader/repro+0x12dd
#5) 0x7f21bea7e09a in __libc_start_main ../csu/libc-start.c:308 LSAN_STACK_RAW [ 5] 0x7f21bea7e09a /lib/x86_64-linux-gnu/libc.so.6+0x2409a
#6) 0x558ef93551d9 in _start (/mathworks/devel/sbs/12/ugoswami.Bavis.j2201159/matlab/toolbox/shared/shared_video_reader/shared_video_reader_impl/GstReader/repro+0x11d9) LSAN_STACK_RAW [ 6] 0x558ef93551d9 /mathworks/devel/sbs/12/ugoswami.Bavis.j2201159/matlab/toolbox/shared/shared_video_reader/shared_video_reader_impl/GstReader/repro+0x11d9
Direct leak of 80 byte(s) in 5 object(s) allocated from:
#0) 0x7f21bf5be0c5 in __interceptor_realloc /mathworks/devel/sandbox/pnarsing/3p-internal-AH3/3p/sources/gcc-10.3/libsanitizer/lsan/lsan_interceptors.cpp:82 LSAN_STACK_RAW [ 0] 0x7f21bf5be0c5 /mathworks/hub/3rdparty/internal/8686358/glnxa64/gcc-10.3.0/lib64/liblsan.so+0x100c5
#1) 0x7f21b84c8d82 in av_packet_add_side_data (/lib/x86_64-linux-gnu/libavcodec.so.58+0x19cd82) LSAN_STACK_RAW [ 1] 0x7f21b84c8d82 /lib/x86_64-linux-gnu/libavcodec.so.58+0x19cd82
#2) 0x7f21b84c8e4c in av_packet_new_side_data (/lib/x86_64-linux-gnu/libavcodec.so.58+0x19ce4c) LSAN_STACK_RAW [ 2] 0x7f21b84c8e4c /lib/x86_64-linux-gnu/libavcodec.so.58+0x19ce4c
#3) 0x7f21bc1c3e52 (/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstlibav.so+0x1fe52) LSAN_STACK_RAW [ 3] 0x7f21bc1c3e52 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstlibav.so+0x1fe52
#4) 0x7f21bf1e7e0a in gst_video_decoder_decode_frame gst-libs/gst/video/gstvideodecoder.c:3416 LSAN_STACK_RAW [ 4] 0x7f21bf1e7e0a /lib/x86_64-linux-gnu/libgstvideo-1.0.so.0+0x3ee0a
#5) 0x7f21bf1ea913 in gst_video_decoder_chain_forward gst-libs/gst/video/gstvideodecoder.c:2142 LSAN_STACK_RAW [ 5] 0x7f21bf1ea913 /lib/x86_64-linux-gnu/libgstvideo-1.0.so.0+0x41913
#6) 0x7f21bf1eaff1 in gst_video_decoder_chain gst-libs/gst/video/gstvideodecoder.c:2456 LSAN_STACK_RAW [ 6] 0x7f21bf1eaff1 /lib/x86_64-linux-gnu/libgstvideo-1.0.so.0+0x41ff1
#7) 0x7f21bf42fc39 (/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0+0x76c39) LSAN_STACK_RAW [ 7] 0x7f21bf42fc39 /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0+0x76c39
#8) 0x7f21bf437ed1 in gst_pad_push (/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0+0x7eed1) LSAN_STACK_RAW [ 8] 0x7f21bf437ed1 /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0+0x7eed1
#9) 0x7f21bc4c9a8c (/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstcoreelements.so+0x2ca8c) LSAN_STACK_RAW [ 9] 0x7f21bc4c9a8c /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstcoreelements.so+0x2ca8c
#10) 0x7f21bf464f40 (/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0+0xabf40) LSAN_STACK_RAW [ 10] 0x7f21bf464f40 /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0+0xabf40
#11) 0x7f21bf2bae72 (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x76e72) LSAN_STACK_RAW [ 11] 0x7f21bf2bae72 /lib/x86_64-linux-gnu/libglib-2.0.so.0+0x76e72
#12) 0x7f21bf2ba4d4 (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x764d4) LSAN_STACK_RAW [ 12] 0x7f21bf2ba4d4 /lib/x86_64-linux-gnu/libglib-2.0.so.0+0x764d4
#13) 0x7f21bec22fa2 in start_thread /build/glibc-2.28/nptl/pthread_create.c:486 LSAN_STACK_RAW [ 13] 0x7f21bec22fa2 /lib/x86_64-linux-gnu/libpthread.so.0+0x7fa2
#14) 0x7f21beb534ce in clone (/lib/x86_64-linux-gnu/libc.so.6+0xf94ce) LSAN_STACK_RAW [ 14] 0x7f21beb534ce /lib/x86_64-linux-gnu/libc.so.6+0xf94ce
Indirect leak of 5440 byte(s) in 5 object(s) allocated from:
#0) 0x7f21bf5be2ed in __interceptor_posix_memalign /mathworks/devel/sandbox/pnarsing/3p-internal-AH3/3p/sources/gcc-10.3/libsanitizer/lsan/lsan_interceptors.cpp:94 LSAN_STACK_RAW [ 0] 0x7f21bf5be2ed /mathworks/hub/3rdparty/internal/8686358/glnxa64/gcc-10.3.0/lib64/liblsan.so+0x102ed
#1) 0x7f21bbfb04fa in av_malloc (/lib/x86_64-linux-gnu/libavutil.so.56+0x304fa) LSAN_STACK_RAW [ 1] 0x7f21bbfb04fa /lib/x86_64-linux-gnu/libavutil.so.56+0x304fa
#2) 0x7f21bbfb088c in av_mallocz (/lib/x86_64-linux-gnu/libavutil.so.56+0x3088c) LSAN_STACK_RAW [ 2] 0x7f21bbfb088c /lib/x86_64-linux-gnu/libavutil.so.56+0x3088c
#3) 0x7f21b84c8e32 in av_packet_new_side_data (/lib/x86_64-linux-gnu/libavcodec.so.58+0x19ce32) LSAN_STACK_RAW [ 3] 0x7f21b84c8e32 /lib/x86_64-linux-gnu/libavcodec.so.58+0x19ce32
#4) 0x7f21bc1c3e52 (/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstlibav.so+0x1fe52) LSAN_STACK_RAW [ 4] 0x7f21bc1c3e52 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstlibav.so+0x1fe52
#5) 0x7f21bf1e7e0a in gst_video_decoder_decode_frame gst-libs/gst/video/gstvideodecoder.c:3416 LSAN_STACK_RAW [ 5] 0x7f21bf1e7e0a /lib/x86_64-linux-gnu/libgstvideo-1.0.so.0+0x3ee0a
#6) 0x7f21bf1ea913 in gst_video_decoder_chain_forward gst-libs/gst/video/gstvideodecoder.c:2142 LSAN_STACK_RAW [ 6] 0x7f21bf1ea913 /lib/x86_64-linux-gnu/libgstvideo-1.0.so.0+0x41913
#7) 0x7f21bf1eaff1 in gst_video_decoder_chain gst-libs/gst/video/gstvideodecoder.c:2456 LSAN_STACK_RAW [ 7] 0x7f21bf1eaff1 /lib/x86_64-linux-gnu/libgstvideo-1.0.so.0+0x41ff1
#8) 0x7f21bf42fc39 (/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0+0x76c39) LSAN_STACK_RAW [ 8] 0x7f21bf42fc39 /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0+0x76c39
#9) 0x7f21bf437ed1 in gst_pad_push (/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0+0x7eed1) LSAN_STACK_RAW [ 9] 0x7f21bf437ed1 /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0+0x7eed1
#10) 0x7f21bc4c9a8c (/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstcoreelements.so+0x2ca8c) LSAN_STACK_RAW [ 10] 0x7f21bc4c9a8c /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstcoreelements.so+0x2ca8c
#11) 0x7f21bf464f40 (/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0+0xabf40) LSAN_STACK_RAW [ 11] 0x7f21bf464f40 /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0+0xabf40
#12) 0x7f21bf2bae72 (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x76e72) LSAN_STACK_RAW [ 12] 0x7f21bf2bae72 /lib/x86_64-linux-gnu/libglib-2.0.so.0+0x76e72
#13) 0x7f21bf2ba4d4 (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x764d4) LSAN_STACK_RAW [ 13] 0x7f21bf2ba4d4 /lib/x86_64-linux-gnu/libglib-2.0.so.0+0x764d4
#14) 0x7f21bec22fa2 in start_thread /build/glibc-2.28/nptl/pthread_create.c:486 LSAN_STACK_RAW [ 14] 0x7f21bec22fa2 /lib/x86_64-linux-gnu/libpthread.so.0+0x7fa2
#15) 0x7f21beb534ce in clone (/lib/x86_64-linux-gnu/libc.so.6+0xf94ce) LSAN_STACK_RAW [ 15] 0x7f21beb534ce /lib/x86_64-linux-gnu/libc.so.6+0xf94ce
SUMMARY: LeakSanitizer: 22015 byte(s) leaked in 12 allocation(s).
How reproducible is the bug?
Always
Screenshots if relevant
Solutions you have tried
Related non-duplicate issues
Additional Informationclock_odd_size_RLE_g1597902.avi
Edited by Sebastian Dröge