[FFmpeg-trac] #4173(avformat:new): mxf: memory leak with fuzzed file

FFmpeg trac at avcodec.org
Tue Dec 9 18:29:53 CET 2014


#4173: mxf: memory leak with fuzzed file
----------------------------------+--------------------------------------
             Reporter:  tholin    |                     Type:  defect
               Status:  new       |                 Priority:  important
            Component:  avformat  |                  Version:  git-master
             Keywords:            |               Blocked By:
             Blocking:            |  Reproduced by developer:  0
Analyzed by developer:  0         |
----------------------------------+--------------------------------------
 I found a memory leak in mpv with a fuzzed file. The problem appears to be
 in ffmpeg so I report it here directly.
 Adding several fuzzed files like these to mpvs playlist will deplete my
 16G of ram.


 {{{
 $ valgrind -v --tool=memcheck --leak-check=full ~/repository/mpv-
 build_vanilla_debug/ffmpeg_build/ffmpeg -loglevel 99 -i mxf_leak1.mxf
 ==850== Memcheck, a memory error detector
 ==850== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
 ==850== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
 ==850== Command: /home/cocobo/repository/mpv-
 build_vanilla_debug/ffmpeg_build/ffmpeg -loglevel 99 -i mxf_leak1.mxf
 ==850==
 --850-- Valgrind options:
 --850--    -v
 --850--    --tool=memcheck
 --850--    --leak-check=full
 --850-- Contents of /proc/version:
 --850--   Linux version 3.17.4+ (root at multivac) (gcc version 4.8.3 (Gentoo
 4.8.3 p1.1, pie-0.5.9) ) #1 SMP PREEMPT Fri Nov 28 10:00:08 CET 2014
 --850-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-lzcnt-rdtscp-sse3
 -avx-avx2-bmi
 --850-- Page sizes: currently 4096, max supported 4096
 --850-- Valgrind library directory: /usr/lib64/valgrind
 --850-- Reading syms from /home/cocobo/repository/mpv-
 build_vanilla_debug/ffmpeg_build/ffmpeg
 --850-- Reading syms from /lib64/ld-2.19.so
 --850--   Considering /usr/lib/debug/lib64/ld-2.19.so.debug ..
 --850--   .. CRC is valid
 --850-- Reading syms from /usr/lib64/valgrind/memcheck-amd64-linux
 --850--   Considering /usr/lib/debug/.build-
 id/a3/0b3405999aba7a8e56f06c16d44bee973e62de.debug ..
 --850--   .. build-id is valid
 --850--    object doesn't have a dynamic symbol table
 --850-- Scheduler: using generic scheduler lock implementation.
 --850-- Reading suppressions file: /usr/lib64/valgrind/default.supp
 ==850== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-850
 -by-cocobo-on-???
 ==850== embedded gdbserver: writing to   /tmp/vgdb-pipe-to-vgdb-from-850
 -by-cocobo-on-???
 ==850== embedded gdbserver: shared mem   /tmp/vgdb-pipe-shared-mem-
 vgdb-850-by-cocobo-on-???
 ==850==
 ==850== TO CONTROL THIS PROCESS USING vgdb (which you probably
 ==850== don't want to do, unless you know exactly what you're doing,
 ==850== or are doing some strange experiment):
 ==850==   /usr/lib64/valgrind/../../bin/vgdb --pid=850 ...command...
 ==850==
 ==850== TO DEBUG THIS PROCESS USING GDB: start GDB like this
 ==850==   /path/to/gdb /home/cocobo/repository/mpv-
 build_vanilla_debug/ffmpeg_build/ffmpeg
 ==850== and then give GDB the following command
 ==850==   target remote | /usr/lib64/valgrind/../../bin/vgdb --pid=850
 ==850== --pid is optional if only one valgrind process is running
 ==850==
 --850-- REDIR: 0x4017d50 (ld-linux-x86-64.so.2:strlen) redirected to
 0x38076571 (vgPlain_amd64_linux_REDIR_FOR_strlen)
 --850-- Reading syms from /usr/lib64/valgrind/vgpreload_core-
 amd64-linux.so
 --850--   Considering /usr/lib/debug/.build-
 id/58/67b922f0bc96aee7b64c349a285bd67f59f007.debug ..
 --850--   .. build-id is valid
 --850-- Reading syms from /usr/lib64/valgrind/vgpreload_memcheck-
 amd64-linux.so
 --850--   Considering /usr/lib/debug/.build-
 id/d4/d2468b6123ae7af22107a7a93631c42003a021.debug ..
 --850--   .. build-id is valid
 ==850== WARNING: new redirection conflicts with existing -- ignoring it
 --850--     old: 0x04017d50 (strlen              ) R-> (0000.0) 0x38076571
 vgPlain_amd64_linux_REDIR_FOR_strlen
 --850--     new: 0x04017d50 (strlen              ) R-> (2007.0) 0x04c2c600
 strlen
 --850-- REDIR: 0x4017a20 (ld-linux-x86-64.so.2:index) redirected to
 0x4c2c1b0 (index)
 --850-- REDIR: 0x4017c40 (ld-linux-x86-64.so.2:strcmp) redirected to
 0x4c2d750 (strcmp)
 --850-- REDIR: 0x4018a50 (ld-linux-x86-64.so.2:mempcpy) redirected to
 0x4c30200 (mempcpy)
 --850-- Reading syms from /usr/lib64/libXv.so.1.0.0
 --850--   Considering /usr/lib/debug/usr/lib64/libXv.so.1.0.0.debug ..
 --850--   .. CRC is valid
 --850-- Reading syms from /usr/lib64/libX11.so.6.3.0
 --850--   Considering /usr/lib/debug/usr/lib64/libX11.so.6.3.0.debug ..
 --850--   .. CRC is valid
 --850-- Reading syms from /usr/lib64/libXext.so.6.4.0
 --850--   Considering /usr/lib/debug/usr/lib64/libXext.so.6.4.0.debug ..
 --850--   .. CRC is valid
 --850-- Reading syms from /usr/lib64/libxcb.so.1.1.0
 --850--   Considering /usr/lib/debug/usr/lib64/libxcb.so.1.1.0.debug ..
 --850--   .. CRC is valid
 --850-- Reading syms from /usr/lib64/libxcb-shm.so.0.0.0
 --850--   Considering /usr/lib/debug/usr/lib64/libxcb-shm.so.0.0.0.debug
 ..
 --850--   .. CRC is valid
 --850-- Reading syms from /usr/lib64/libxcb-xfixes.so.0.0.0
 --850--   Considering /usr/lib/debug/usr/lib64/libxcb-
 xfixes.so.0.0.0.debug ..
 --850--   .. CRC is valid
 --850-- Reading syms from /usr/lib64/libxcb-shape.so.0.0.0
 --850--   Considering /usr/lib/debug/usr/lib64/libxcb-shape.so.0.0.0.debug
 ..
 --850--   .. CRC is valid
 --850-- Reading syms from /usr/lib64/libjack.so.0.0.28
 --850--   Considering /usr/lib/debug/usr/lib64/libjack.so.0.0.28.debug ..
 --850--   .. CRC is valid
 --850-- Reading syms from /usr/lib64/libasound.so.2.0.0
 --850--   Considering /usr/lib/debug/.build-
 id/2e/80b4d78320a5a3cdfbd2e77ca2d0e7287635c0.debug ..
 --850--   .. build-id is valid
 --850-- Reading syms from /usr/lib64/libSDL-1.2.so.0.11.4
 --850--   Considering /usr/lib/debug/usr/lib64/libSDL-1.2.so.0.11.4.debug
 ..
 --850--   .. CRC is valid
 --850-- Reading syms from /lib64/libpthread-2.19.so
 --850--   Considering /usr/lib/debug/lib64/libpthread-2.19.so.debug ..
 --850--   .. CRC is valid
 --850-- Reading syms from /lib64/libm-2.19.so
 --850--   Considering /usr/lib/debug/lib64/libm-2.19.so.debug ..
 --850--   .. CRC is valid
 --850-- Reading syms from /lib64/liblzma.so.5.0.7
 --850--   Considering /usr/lib/debug/lib64/liblzma.so.5.0.7.debug ..
 --850--   .. CRC is valid
 --850-- Reading syms from /lib64/libbz2.so.1.0.6
 --850--   Considering /usr/lib/debug/lib64/libbz2.so.1.0.6.debug ..
 --850--   .. CRC is valid
 --850-- Reading syms from /lib64/libz.so.1.2.8
 --850--   Considering /usr/lib/debug/lib64/libz.so.1.2.8.debug ..
 --850--   .. CRC is valid
 --850-- Reading syms from /usr/lib64/libvdpau.so.1.0.0
 --850--   Considering /usr/lib/debug/usr/lib64/libvdpau.so.1.0.0.debug ..
 --850--   .. CRC is valid
 --850-- Reading syms from /lib64/libc-2.19.so
 --850--   Considering /usr/lib/debug/lib64/libc-2.19.so.debug ..
 --850--   .. CRC is valid
 --850-- Reading syms from /lib64/libdl-2.19.so
 --850--   Considering /usr/lib/debug/lib64/libdl-2.19.so.debug ..
 --850--   .. CRC is valid
 --850-- Reading syms from /usr/lib64/libXau.so.6.0.0
 --850--   Considering /usr/lib/debug/usr/lib64/libXau.so.6.0.0.debug ..
 --850--   .. CRC is valid
 --850-- Reading syms from /usr/lib64/libXdmcp.so.6.0.0
 --850--   Considering /usr/lib/debug/usr/lib64/libXdmcp.so.6.0.0.debug ..
 --850--   .. CRC is valid
 --850-- Reading syms from /lib64/librt-2.19.so
 --850--   Considering /usr/lib/debug/lib64/librt-2.19.so.debug ..
 --850--   .. CRC is valid
 --850-- REDIR: 0x72f2130 (libc.so.6:strcasecmp) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --850-- REDIR: 0x72f4420 (libc.so.6:strncasecmp) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --850-- REDIR: 0x72f1900 (libc.so.6:memcpy at GLIBC_2.2.5) redirected to
 0x4a23770 (_vgnU_ifunc_wrapper)
 --850-- REDIR: 0x72efc80 (libc.so.6:rindex) redirected to 0x4c2be90
 (rindex)
 --850-- REDIR: 0x72ec2e0 (libc.so.6:index) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --850-- REDIR: 0x72ec310 (libc.so.6:__GI_strchr) redirected to 0x4c2bff0
 (__GI_strchr)
 --850-- REDIR: 0x72edf80 (libc.so.6:strlen) redirected to 0x4c2c540
 (strlen)
 --850-- REDIR: 0x72ee3a0 (libc.so.6:strncmp) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --850-- REDIR: 0x738f6f0 (libc.so.6:__strncmp_ssse3) redirected to
 0x4c2cd20 (strncmp)
 --850-- REDIR: 0x72ec530 (libc.so.6:strcmp) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --850-- REDIR: 0x738e490 (libc.so.6:__strcmp_ssse3) redirected to
 0x4c2d610 (strcmp)
 --850-- REDIR: 0x72f0d90 (libc.so.6:strstr) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --850-- REDIR: 0x7305c80 (libc.so.6:__strstr_sse2_unaligned) redirected to
 0x4c30400 (strstr)
 --850-- REDIR: 0x72f6b50 (libc.so.6:__GI_memcpy) redirected to 0x4c2e0f0
 (__GI_memcpy)
 --850-- REDIR: 0x72e88d0 (libc.so.6:free) redirected to 0x4c2a1d0 (free)
 --850-- REDIR: 0x72ea290 (libc.so.6:posix_memalign) redirected to
 0x4c2b640 (posix_memalign)
 --850-- REDIR: 0x72f8ac0 (libc.so.6:strchrnul) redirected to 0x4c2fe10
 (strchrnul)
 --850-- REDIR: 0x72ed9c0 (libc.so.6:strcpy) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --850-- REDIR: 0x73015e0 (libc.so.6:__strcpy_sse2_unaligned) redirected to
 0x4c2c620 (strcpy)
 --850-- REDIR: 0x72ee3f0 (libc.so.6:__GI_strncmp) redirected to 0x4c2cd90
 (__GI_strncmp)
 ffmpeg version N-68291-g4fa2758 Copyright (c) 2000-2014 the FFmpeg
 developers
   built on Dec  8 2014 09:25:34 with gcc 4.8.3 (Gentoo 4.8.3 p1.1,
 pie-0.5.9)
   configuration: --prefix=/home/cocobo/repository/mpv-
 build_vanilla_debug/build_libs --enable-static --disable-shared --enable-
 gpl --enable-avresample --enable-debug=gdb --disable-doc --disable-
 optimizations --disable-stripping
   libavutil      54. 15.100 / 54. 15.100
   libavcodec     56. 14.100 / 56. 14.100
   libavformat    56. 15.102 / 56. 15.102
   libavdevice    56.  3.100 / 56.  3.100
   libavfilter     5.  2.103 /  5.  2.103
   libavresample   2.  1.  0 /  2.  1.  0
   libswscale      3.  1.101 /  3.  1.101
   libswresample   1.  1.100 /  1.  1.100
   libpostproc    53.  3.100 / 53.  3.100
 --850-- REDIR: 0x72f1990 (libc.so.6:memset) redirected to 0x4c2f7b0
 (memset)
 --850-- REDIR: 0x739e320 (libc.so.6:__memmove_ssse3_back) redirected to
 0x4c2d8b0 (memcpy at GLIBC_2.2.5)
 Splitting the commandline.
 Reading option '-loglevel' ...--850-- REDIR: 0x72e8960 (libc.so.6:realloc)
 redirected to 0x4c2b260 (realloc)
  matched as option 'loglevel' (set logging level) with argument '99'.
 Reading option '-i' ... matched as input file with argument
 'mxf_leak1.mxf'.
 Finished splitting the commandline.
 Parsing a group of options: global .
 Applying option loglevel (set logging level) with argument 99.
 Successfully parsed a group of options.
 Parsing a group of options: input file mxf_leak1.mxf.
 Successfully parsed a group of options.
 Opening an input file: mxf_leak1.mxf.
 --850-- REDIR: 0x72f6b00 (libc.so.6:memcpy@@GLIBC_2.14) redirected to
 0x4a23770 (_vgnU_ifunc_wrapper)
 --850-- REDIR: 0x72fca20 (libc.so.6:__memcpy_sse2_unaligned) redirected to
 0x4c2db10 (memcpy@@GLIBC_2.14)
 --850-- REDIR: 0x72f02f0 (libc.so.6:strspn) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --850-- REDIR: 0x738b350 (libc.so.6:__strspn_sse42) redirected to
 0x4c30680 (strspn)
 --850-- REDIR: 0x72f1320 (libc.so.6:bcmp) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --850-- REDIR: 0x73ae2f0 (libc.so.6:__memcmp_sse4_1) redirected to
 0x4c2f060 (__memcmp_sse4_1)
 --850-- REDIR: 0x72f88b0 (libc.so.6:rawmemchr) redirected to 0x4c2fe50
 (rawmemchr)
 --850-- REDIR: 0x72edae0 (libc.so.6:strcspn) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --850-- REDIR: 0x738b100 (libc.so.6:__strcspn_sse42) redirected to
 0x4c30610 (strcspn)
 [mxf @ 0x7e38140] Format mxf probed with size=2048 and score=100
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.05.01.01.0d.01.02.01.01.02.04.00
     Last message repeated 3 times
 [mxf @ 0x7e38140] invalid KAGSize 0 - guessing 512
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.01.01.01.01.03.01.02.10.01.00.00.00
     Last message repeated 33 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.2f.00
     Last message repeated 33 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.30.00
     Last message repeated 10 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.18.00
     Last message repeated 11 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.23.00
     Last message repeated 33 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.36.00
     Last message repeated 13 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.3b.00
     Last message repeated 28 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.0f.00
     Last message repeated 14 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.11.00
     Last message repeated 16 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.3b.00
     Last message repeated 28 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.0f.00
     Last message repeated 14 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.11.00
     Last message repeated 16 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.37.00
     Last message repeated 12 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.44.00
     Last message repeated 17 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.28.00
     Last message repeated 19 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.42.00
     Last message repeated 75 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.3b.00
     Last message repeated 28 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.0f.00
 ==850== Warning: set address range perms: large range [0x8225080,
 0x2a4ae7a0) (undefined)
     Last message repeated 14 times
 [mxf @ 0x7e38140] local tag 0x1001 extends past end of local set @ 0x10d9
 [mxf @ 0x7e38140] error reading header metadata
 [AVIOContext @ 0x7e40e40] Statistics: 6952 bytes read, 0 seeks
 mxf_leak1.mxf: Invalid data found when processing input
 ==850==
 ==850== HEAP SUMMARY:
 ==850==     in use at exit: 573,117,580 bytes in 28 blocks
 ==850==   total heap usage: 161 allocs, 133 frees, 573,227,858 bytes
 allocated
 ==850==
 ==850== Searching for pointers to 28 not-freed blocks
 ==850== Checked 580,354,184 bytes
 ==850==
 ==850== 573,085,472 bytes in 1 blocks are possibly lost in loss record 25
 of 25
 ==850==    at 0x4C2B560: memalign (vg_replace_malloc.c:760)
 ==850==    by 0x4C2B677: posix_memalign (vg_replace_malloc.c:913)
 ==850==    by 0x11E106F: av_malloc (mem.c:95)
 ==850==    by 0x11E12FF: av_mallocz (mem.c:245)
 ==850==    by 0x11E1368: av_calloc (mem.c:255)
 ==850==    by 0x63CC45: mxf_read_sequence (mxfdec.c:744)
 ==850==    by 0x640A29: mxf_read_local_tags (mxfdec.c:2141)
 ==850==    by 0x640C20: mxf_parse_klv (mxfdec.c:2185)
 ==850==    by 0x641911: mxf_read_header (mxfdec.c:2522)
 ==850==    by 0x6C48B9: avformat_open_input (utils.c:463)
 ==850==    by 0x410FB7: open_input_file (ffmpeg_opt.c:873)
 ==850==    by 0x419107: open_files (ffmpeg_opt.c:2699)
 ==850==
 ==850== LEAK SUMMARY:
 ==850==    definitely lost: 0 bytes in 0 blocks
 ==850==    indirectly lost: 0 bytes in 0 blocks
 ==850==      possibly lost: 573,085,472 bytes in 1 blocks
 ==850==    still reachable: 32,108 bytes in 27 blocks
 ==850==         suppressed: 0 bytes in 0 blocks
 ==850== Reachable blocks (those to which a pointer was found) are not
 shown.
 ==850== To see them, rerun with: --leak-check=full --show-leak-kinds=all
 ==850==
 ==850== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
 ==850== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
 }}}

 {{{
 $ valgrind -v --tool=memcheck --leak-check=full ~/repository/mpv-
 build_vanilla_debug/ffmpeg_build/ffmpeg -loglevel 99 -i mxf_leak2.mxf
 ==18483== Memcheck, a memory error detector
 ==18483== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
 ==18483== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright
 info
 ==18483== Command: /home/cocobo/repository/mpv-
 build_vanilla_debug/ffmpeg_build/ffmpeg -loglevel 99 -i mxf_leak2.mxf
 ==18483==
 --18483-- Valgrind options:
 --18483--    -v
 --18483--    --tool=memcheck
 --18483--    --leak-check=full
 --18483-- Contents of /proc/version:
 --18483--   Linux version 3.17.4+ (root at multivac) (gcc version 4.8.3
 (Gentoo 4.8.3 p1.1, pie-0.5.9) ) #1 SMP PREEMPT Fri Nov 28 10:00:08 CET
 2014
 --18483-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-lzcnt-rdtscp-
 sse3-avx-avx2-bmi
 --18483-- Page sizes: currently 4096, max supported 4096
 --18483-- Valgrind library directory: /usr/lib64/valgrind
 --18483-- Reading syms from /home/cocobo/repository/mpv-
 build_vanilla_debug/ffmpeg_build/ffmpeg
 --18483-- Reading syms from /lib64/ld-2.19.so
 --18483--   Considering /usr/lib/debug/lib64/ld-2.19.so.debug ..
 --18483--   .. CRC is valid
 --18483-- Reading syms from /usr/lib64/valgrind/memcheck-amd64-linux
 --18483--   Considering /usr/lib/debug/.build-
 id/a3/0b3405999aba7a8e56f06c16d44bee973e62de.debug ..
 --18483--   .. build-id is valid
 --18483--    object doesn't have a dynamic symbol table
 --18483-- Scheduler: using generic scheduler lock implementation.
 --18483-- Reading suppressions file: /usr/lib64/valgrind/default.supp
 ==18483== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-
 to-18483-by-cocobo-on-???
 ==18483== embedded gdbserver: writing to   /tmp/vgdb-pipe-to-vgdb-
 from-18483-by-cocobo-on-???
 ==18483== embedded gdbserver: shared mem   /tmp/vgdb-pipe-shared-mem-
 vgdb-18483-by-cocobo-on-???
 ==18483==
 ==18483== TO CONTROL THIS PROCESS USING vgdb (which you probably
 ==18483== don't want to do, unless you know exactly what you're doing,
 ==18483== or are doing some strange experiment):
 ==18483==   /usr/lib64/valgrind/../../bin/vgdb --pid=18483 ...command...
 ==18483==
 ==18483== TO DEBUG THIS PROCESS USING GDB: start GDB like this
 ==18483==   /path/to/gdb /home/cocobo/repository/mpv-
 build_vanilla_debug/ffmpeg_build/ffmpeg
 ==18483== and then give GDB the following command
 ==18483==   target remote | /usr/lib64/valgrind/../../bin/vgdb --pid=18483
 ==18483== --pid is optional if only one valgrind process is running
 ==18483==
 --18483-- REDIR: 0x4017d50 (ld-linux-x86-64.so.2:strlen) redirected to
 0x38076571 (vgPlain_amd64_linux_REDIR_FOR_strlen)
 --18483-- Reading syms from /usr/lib64/valgrind/vgpreload_core-
 amd64-linux.so
 --18483--   Considering /usr/lib/debug/.build-
 id/58/67b922f0bc96aee7b64c349a285bd67f59f007.debug ..
 --18483--   .. build-id is valid
 --18483-- Reading syms from /usr/lib64/valgrind/vgpreload_memcheck-
 amd64-linux.so
 --18483--   Considering /usr/lib/debug/.build-
 id/d4/d2468b6123ae7af22107a7a93631c42003a021.debug ..
 --18483--   .. build-id is valid
 ==18483== WARNING: new redirection conflicts with existing -- ignoring it
 --18483--     old: 0x04017d50 (strlen              ) R-> (0000.0)
 0x38076571 vgPlain_amd64_linux_REDIR_FOR_strlen
 --18483--     new: 0x04017d50 (strlen              ) R-> (2007.0)
 0x04c2c600 strlen
 --18483-- REDIR: 0x4017a20 (ld-linux-x86-64.so.2:index) redirected to
 0x4c2c1b0 (index)
 --18483-- REDIR: 0x4017c40 (ld-linux-x86-64.so.2:strcmp) redirected to
 0x4c2d750 (strcmp)
 --18483-- REDIR: 0x4018a50 (ld-linux-x86-64.so.2:mempcpy) redirected to
 0x4c30200 (mempcpy)
 --18483-- Reading syms from /usr/lib64/libXv.so.1.0.0
 --18483--   Considering /usr/lib/debug/usr/lib64/libXv.so.1.0.0.debug ..
 --18483--   .. CRC is valid
 --18483-- Reading syms from /usr/lib64/libX11.so.6.3.0
 --18483--   Considering /usr/lib/debug/usr/lib64/libX11.so.6.3.0.debug ..
 --18483--   .. CRC is valid
 --18483-- Reading syms from /usr/lib64/libXext.so.6.4.0
 --18483--   Considering /usr/lib/debug/usr/lib64/libXext.so.6.4.0.debug ..
 --18483--   .. CRC is valid
 --18483-- Reading syms from /usr/lib64/libxcb.so.1.1.0
 --18483--   Considering /usr/lib/debug/usr/lib64/libxcb.so.1.1.0.debug ..
 --18483--   .. CRC is valid
 --18483-- Reading syms from /usr/lib64/libxcb-shm.so.0.0.0
 --18483--   Considering /usr/lib/debug/usr/lib64/libxcb-shm.so.0.0.0.debug
 ..
 --18483--   .. CRC is valid
 --18483-- Reading syms from /usr/lib64/libxcb-xfixes.so.0.0.0
 --18483--   Considering /usr/lib/debug/usr/lib64/libxcb-
 xfixes.so.0.0.0.debug ..
 --18483--   .. CRC is valid
 --18483-- Reading syms from /usr/lib64/libxcb-shape.so.0.0.0
 --18483--   Considering /usr/lib/debug/usr/lib64/libxcb-
 shape.so.0.0.0.debug ..
 --18483--   .. CRC is valid
 --18483-- Reading syms from /usr/lib64/libjack.so.0.0.28
 --18483--   Considering /usr/lib/debug/usr/lib64/libjack.so.0.0.28.debug
 ..
 --18483--   .. CRC is valid
 --18483-- Reading syms from /usr/lib64/libasound.so.2.0.0
 --18483--   Considering /usr/lib/debug/.build-
 id/2e/80b4d78320a5a3cdfbd2e77ca2d0e7287635c0.debug ..
 --18483--   .. build-id is valid
 --18483-- Reading syms from /usr/lib64/libSDL-1.2.so.0.11.4
 --18483--   Considering
 /usr/lib/debug/usr/lib64/libSDL-1.2.so.0.11.4.debug ..
 --18483--   .. CRC is valid
 --18483-- Reading syms from /lib64/libpthread-2.19.so
 --18483--   Considering /usr/lib/debug/lib64/libpthread-2.19.so.debug ..
 --18483--   .. CRC is valid
 --18483-- Reading syms from /lib64/libm-2.19.so
 --18483--   Considering /usr/lib/debug/lib64/libm-2.19.so.debug ..
 --18483--   .. CRC is valid
 --18483-- Reading syms from /lib64/liblzma.so.5.0.7
 --18483--   Considering /usr/lib/debug/lib64/liblzma.so.5.0.7.debug ..
 --18483--   .. CRC is valid
 --18483-- Reading syms from /lib64/libbz2.so.1.0.6
 --18483--   Considering /usr/lib/debug/lib64/libbz2.so.1.0.6.debug ..
 --18483--   .. CRC is valid
 --18483-- Reading syms from /lib64/libz.so.1.2.8
 --18483--   Considering /usr/lib/debug/lib64/libz.so.1.2.8.debug ..
 --18483--   .. CRC is valid
 --18483-- Reading syms from /usr/lib64/libvdpau.so.1.0.0
 --18483--   Considering /usr/lib/debug/usr/lib64/libvdpau.so.1.0.0.debug
 ..
 --18483--   .. CRC is valid
 --18483-- Reading syms from /lib64/libc-2.19.so
 --18483--   Considering /usr/lib/debug/lib64/libc-2.19.so.debug ..
 --18483--   .. CRC is valid
 --18483-- Reading syms from /lib64/libdl-2.19.so
 --18483--   Considering /usr/lib/debug/lib64/libdl-2.19.so.debug ..
 --18483--   .. CRC is valid
 --18483-- Reading syms from /usr/lib64/libXau.so.6.0.0
 --18483--   Considering /usr/lib/debug/usr/lib64/libXau.so.6.0.0.debug ..
 --18483--   .. CRC is valid
 --18483-- Reading syms from /usr/lib64/libXdmcp.so.6.0.0
 --18483--   Considering /usr/lib/debug/usr/lib64/libXdmcp.so.6.0.0.debug
 ..
 --18483--   .. CRC is valid
 --18483-- Reading syms from /lib64/librt-2.19.so
 --18483--   Considering /usr/lib/debug/lib64/librt-2.19.so.debug ..
 --18483--   .. CRC is valid
 --18483-- REDIR: 0x72f2130 (libc.so.6:strcasecmp) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --18483-- REDIR: 0x72f4420 (libc.so.6:strncasecmp) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --18483-- REDIR: 0x72f1900 (libc.so.6:memcpy at GLIBC_2.2.5) redirected to
 0x4a23770 (_vgnU_ifunc_wrapper)
 --18483-- REDIR: 0x72efc80 (libc.so.6:rindex) redirected to 0x4c2be90
 (rindex)
 --18483-- REDIR: 0x72ec2e0 (libc.so.6:index) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --18483-- REDIR: 0x72ec310 (libc.so.6:__GI_strchr) redirected to 0x4c2bff0
 (__GI_strchr)
 --18483-- REDIR: 0x72edf80 (libc.so.6:strlen) redirected to 0x4c2c540
 (strlen)
 --18483-- REDIR: 0x72ee3a0 (libc.so.6:strncmp) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --18483-- REDIR: 0x738f6f0 (libc.so.6:__strncmp_ssse3) redirected to
 0x4c2cd20 (strncmp)
 --18483-- REDIR: 0x72ec530 (libc.so.6:strcmp) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --18483-- REDIR: 0x738e490 (libc.so.6:__strcmp_ssse3) redirected to
 0x4c2d610 (strcmp)
 --18483-- REDIR: 0x72f0d90 (libc.so.6:strstr) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --18483-- REDIR: 0x7305c80 (libc.so.6:__strstr_sse2_unaligned) redirected
 to 0x4c30400 (strstr)
 --18483-- REDIR: 0x72f6b50 (libc.so.6:__GI_memcpy) redirected to 0x4c2e0f0
 (__GI_memcpy)
 --18483-- REDIR: 0x72e88d0 (libc.so.6:free) redirected to 0x4c2a1d0 (free)
 --18483-- REDIR: 0x72ea290 (libc.so.6:posix_memalign) redirected to
 0x4c2b640 (posix_memalign)
 --18483-- REDIR: 0x72f8ac0 (libc.so.6:strchrnul) redirected to 0x4c2fe10
 (strchrnul)
 --18483-- REDIR: 0x72ed9c0 (libc.so.6:strcpy) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --18483-- REDIR: 0x73015e0 (libc.so.6:__strcpy_sse2_unaligned) redirected
 to 0x4c2c620 (strcpy)
 --18483-- REDIR: 0x72ee3f0 (libc.so.6:__GI_strncmp) redirected to
 0x4c2cd90 (__GI_strncmp)
 ffmpeg version N-68291-g4fa2758 Copyright (c) 2000-2014 the FFmpeg
 developers
   built on Dec  8 2014 09:25:34 with gcc 4.8.3 (Gentoo 4.8.3 p1.1,
 pie-0.5.9)
   configuration: --prefix=/home/cocobo/repository/mpv-
 build_vanilla_debug/build_libs --enable-static --disable-shared --enable-
 gpl --enable-avresample --enable-debug=gdb --disable-doc --disable-
 optimizations --disable-stripping
   libavutil      54. 15.100 / 54. 15.100
   libavcodec     56. 14.100 / 56. 14.100
   libavformat    56. 15.102 / 56. 15.102
   libavdevice    56.  3.100 / 56.  3.100
   libavfilter     5.  2.103 /  5.  2.103
   libavresample   2.  1.  0 /  2.  1.  0
   libswscale      3.  1.101 /  3.  1.101
   libswresample   1.  1.100 /  1.  1.100
   libpostproc    53.  3.100 / 53.  3.100
 --18483-- REDIR: 0x72f1990 (libc.so.6:memset) redirected to 0x4c2f7b0
 (memset)
 --18483-- REDIR: 0x739e320 (libc.so.6:__memmove_ssse3_back) redirected to
 0x4c2d8b0 (memcpy at GLIBC_2.2.5)
 Splitting the commandline.
 Reading option '-loglevel' ...--18483-- REDIR: 0x72e8960
 (libc.so.6:realloc) redirected to 0x4c2b260 (realloc)
  matched as option 'loglevel' (set logging level) with argument '99'.
 Reading option '-i' ... matched as input file with argument
 'mxf_leak2.mxf'.
 Finished splitting the commandline.
 Parsing a group of options: global .
 Applying option loglevel (set logging level) with argument 99.
 Successfully parsed a group of options.
 Parsing a group of options: input file mxf_leak2.mxf.
 Successfully parsed a group of options.
 Opening an input file: mxf_leak2.mxf.
 --18483-- REDIR: 0x72f6b00 (libc.so.6:memcpy@@GLIBC_2.14) redirected to
 0x4a23770 (_vgnU_ifunc_wrapper)
 --18483-- REDIR: 0x72fca20 (libc.so.6:__memcpy_sse2_unaligned) redirected
 to 0x4c2db10 (memcpy@@GLIBC_2.14)
 --18483-- REDIR: 0x72f02f0 (libc.so.6:strspn) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --18483-- REDIR: 0x738b350 (libc.so.6:__strspn_sse42) redirected to
 0x4c30680 (strspn)
 --18483-- REDIR: 0x72f1320 (libc.so.6:bcmp) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --18483-- REDIR: 0x73ae2f0 (libc.so.6:__memcmp_sse4_1) redirected to
 0x4c2f060 (__memcmp_sse4_1)
 --18483-- REDIR: 0x72f88b0 (libc.so.6:rawmemchr) redirected to 0x4c2fe50
 (rawmemchr)
 --18483-- REDIR: 0x72edae0 (libc.so.6:strcspn) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --18483-- REDIR: 0x738b100 (libc.so.6:__strcspn_sse42) redirected to
 0x4c30610 (strcspn)
 [mxf @ 0x7e38140] Format mxf probed with size=2048 and score=100
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.05.01.01.0d.01.02.01.01.02.04.00
     Last message repeated 3 times
 [mxf @ 0x7e38140] invalid KAGSize 0 - guessing 512
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.01.01.01.01.03.01.02.10.01.00.00.00
     Last message repeated 33 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.04.01.01.01.0e.06.06.02.02.01.00.00
     Last message repeated 33 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.04.01.01.01.0e.06.02.01.40.01.09.00
     Last message repeated 33 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.04.01.01.03.0e.06.01.20.02.01.02.00
     Last message repeated 33 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.23.00
     Last message repeated 33 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.36.00
     Last message repeated 13 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.3b.00
     Last message repeated 28 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.0f.00
     Last message repeated 14 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.14.00
     Last message repeated 29 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.3b.00
     Last message repeated 28 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.0f.00
     Last message repeated 14 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.11.00
     Last message repeated 16 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.3b.00
     Last message repeated 28 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.0f.00
     Last message repeated 14 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.11.00
     Last message repeated 16 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.3b.00
     Last message repeated 28 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.0f.00
     Last message repeated 14 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.11.00
     Last message repeated 16 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.3b.00
     Last message repeated 28 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.0f.00
     Last message repeated 14 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.11.00
     Last message repeated 16 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.3b.00
     Last message repeated 28 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.0f.00
     Last message repeated 14 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.11.00
     Last message repeated 16 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.37.00
     Last message repeated 12 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.44.00
     Last message repeated 17 times
 [mxf @ 0x7e38140] local tag 0x3001 with 0 size
 [mxf @ 0x7e38140] local tag 0000 with 0 size
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.11.00
     Last message repeated 16 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.3b.00
     Last message repeated 28 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.0f.00
     Last message repeated 14 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.11.00
     Last message repeated 16 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.3b.00
     Last message repeated 28 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.0f.00
     Last message repeated 14 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.11.00
     Last message repeated 16 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.3b.00
     Last message repeated 28 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.0f.00
     Last message repeated 14 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.11.00
     Last message repeated 16 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.01.01.01.01.03.01.02.10.01.00.00.00
     Last message repeated 33 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.02.01.01.10.01.00
 ==18483== Warning: set address range perms: large range [0x8225080,
 0x1c225080) (undefined)
 ==18483== Warning: set address range perms: large range [0x3a049080,
 0x8a049080) (undefined)
     Last message repeated 32 times
 [mxf @ 0x7e38140] error reading header metadata
 [AVIOContext @ 0x7e40e40] Statistics: 7201 bytes read, 0 seeks
 --18483-- REDIR: 0x72f1fc0 (libc.so.6:__GI_stpcpy) redirected to 0x4c2f200
 (__GI_stpcpy)
 mxf_leak2.mxf: Cannot allocate memory
 ==18483==
 ==18483== HEAP SUMMARY:
 ==18483==     in use at exit: 1,677,753,796 bytes in 30 blocks
 ==18483==   total heap usage: 176 allocs, 146 frees, 1,677,867,143 bytes
 allocated
 ==18483==
 ==18483== Searching for pointers to 30 not-freed blocks
 ==18483== Checked 1,684,990,312 bytes
 ==18483==
 ==18483== 88 bytes in 1 blocks are definitely lost in loss record 19 of 27
 ==18483==    at 0x4C2B560: memalign (vg_replace_malloc.c:760)
 ==18483==    by 0x4C2B677: posix_memalign (vg_replace_malloc.c:913)
 ==18483==    by 0x11E106F: av_malloc (mem.c:95)
 ==18483==    by 0x11E12FF: av_mallocz (mem.c:245)
 ==18483==    by 0x6407FA: mxf_read_local_tags (mxfdec.c:2110)
 ==18483==    by 0x640C20: mxf_parse_klv (mxfdec.c:2185)
 ==18483==    by 0x641911: mxf_read_header (mxfdec.c:2522)
 ==18483==    by 0x6C48B9: avformat_open_input (utils.c:463)
 ==18483==    by 0x410FB7: open_input_file (ffmpeg_opt.c:873)
 ==18483==    by 0x419107: open_files (ffmpeg_opt.c:2699)
 ==18483==    by 0x419294: ffmpeg_parse_options (ffmpeg_opt.c:2736)
 ==18483==    by 0x42C7A3: main (ffmpeg.c:3919)
 ==18483==
 ==18483== 335,544,320 bytes in 1 blocks are possibly lost in loss record
 26 of 27
 ==18483==    at 0x4C2B560: memalign (vg_replace_malloc.c:760)
 ==18483==    by 0x4C2B677: posix_memalign (vg_replace_malloc.c:913)
 ==18483==    by 0x11E106F: av_malloc (mem.c:95)
 ==18483==    by 0x11E12FF: av_mallocz (mem.c:245)
 ==18483==    by 0x11E1368: av_calloc (mem.c:255)
 ==18483==    by 0x63CFD3: mxf_read_index_entry_array (mxfdec.c:832)
 ==18483==    by 0x63D1AA: mxf_read_index_table_segment (mxfdec.c:865)
 ==18483==    by 0x640A29: mxf_read_local_tags (mxfdec.c:2141)
 ==18483==    by 0x640C20: mxf_parse_klv (mxfdec.c:2185)
 ==18483==    by 0x641911: mxf_read_header (mxfdec.c:2522)
 ==18483==    by 0x6C48B9: avformat_open_input (utils.c:463)
 ==18483==    by 0x410FB7: open_input_file (ffmpeg_opt.c:873)
 ==18483==
 ==18483== 1,342,177,280 bytes in 1 blocks are possibly lost in loss record
 27 of 27
 ==18483==    at 0x4C2B560: memalign (vg_replace_malloc.c:760)
 ==18483==    by 0x4C2B677: posix_memalign (vg_replace_malloc.c:913)
 ==18483==    by 0x11E106F: av_malloc (mem.c:95)
 ==18483==    by 0x11E12FF: av_mallocz (mem.c:245)
 ==18483==    by 0x11E1368: av_calloc (mem.c:255)
 ==18483==    by 0x63D001: mxf_read_index_entry_array (mxfdec.c:833)
 ==18483==    by 0x63D1AA: mxf_read_index_table_segment (mxfdec.c:865)
 ==18483==    by 0x640A29: mxf_read_local_tags (mxfdec.c:2141)
 ==18483==    by 0x640C20: mxf_parse_klv (mxfdec.c:2185)
 ==18483==    by 0x641911: mxf_read_header (mxfdec.c:2522)
 ==18483==    by 0x6C48B9: avformat_open_input (utils.c:463)
 ==18483==    by 0x410FB7: open_input_file (ffmpeg_opt.c:873)
 ==18483==
 ==18483== LEAK SUMMARY:
 ==18483==    definitely lost: 88 bytes in 1 blocks
 ==18483==    indirectly lost: 0 bytes in 0 blocks
 ==18483==      possibly lost: 1,677,721,600 bytes in 2 blocks
 ==18483==    still reachable: 32,108 bytes in 27 blocks
 ==18483==         suppressed: 0 bytes in 0 blocks
 ==18483== Reachable blocks (those to which a pointer was found) are not
 shown.
 ==18483== To see them, rerun with: --leak-check=full --show-leak-kinds=all
 ==18483==
 ==18483== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0)
 ==18483== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0)
 }}}

 {{{
 $ valgrind -v --tool=memcheck --leak-check=full ~/repository/mpv-
 build_vanilla_debug/ffmpeg_build/ffmpeg -loglevel 99 -i mxf_leak4.mxf
 ==22408== Memcheck, a memory error detector
 ==22408== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
 ==22408== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright
 info
 ==22408== Command: /home/cocobo/repository/mpv-
 build_vanilla_debug/ffmpeg_build/ffmpeg -loglevel 99 -i mxf_leak4.mxf
 ==22408==
 --22408-- Valgrind options:
 --22408--    -v
 --22408--    --tool=memcheck
 --22408--    --leak-check=full
 --22408-- Contents of /proc/version:
 --22408--   Linux version 3.17.4+ (root at multivac) (gcc version 4.8.3
 (Gentoo 4.8.3 p1.1, pie-0.5.9) ) #1 SMP PREEMPT Fri Nov 28 10:00:08 CET
 2014
 --22408-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-lzcnt-rdtscp-
 sse3-avx-avx2-bmi
 --22408-- Page sizes: currently 4096, max supported 4096
 --22408-- Valgrind library directory: /usr/lib64/valgrind
 --22408-- Reading syms from /home/cocobo/repository/mpv-
 build_vanilla_debug/ffmpeg_build/ffmpeg
 --22408-- Reading syms from /lib64/ld-2.19.so
 --22408--   Considering /usr/lib/debug/lib64/ld-2.19.so.debug ..
 --22408--   .. CRC is valid
 --22408-- Reading syms from /usr/lib64/valgrind/memcheck-amd64-linux
 --22408--   Considering /usr/lib/debug/.build-
 id/a3/0b3405999aba7a8e56f06c16d44bee973e62de.debug ..
 --22408--   .. build-id is valid
 --22408--    object doesn't have a dynamic symbol table
 --22408-- Scheduler: using generic scheduler lock implementation.
 --22408-- Reading suppressions file: /usr/lib64/valgrind/default.supp
 ==22408== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-
 to-22408-by-cocobo-on-???
 ==22408== embedded gdbserver: writing to   /tmp/vgdb-pipe-to-vgdb-
 from-22408-by-cocobo-on-???
 ==22408== embedded gdbserver: shared mem   /tmp/vgdb-pipe-shared-mem-
 vgdb-22408-by-cocobo-on-???
 ==22408==
 ==22408== TO CONTROL THIS PROCESS USING vgdb (which you probably
 ==22408== don't want to do, unless you know exactly what you're doing,
 ==22408== or are doing some strange experiment):
 ==22408==   /usr/lib64/valgrind/../../bin/vgdb --pid=22408 ...command...
 ==22408==
 ==22408== TO DEBUG THIS PROCESS USING GDB: start GDB like this
 ==22408==   /path/to/gdb /home/cocobo/repository/mpv-
 build_vanilla_debug/ffmpeg_build/ffmpeg
 ==22408== and then give GDB the following command
 ==22408==   target remote | /usr/lib64/valgrind/../../bin/vgdb --pid=22408
 ==22408== --pid is optional if only one valgrind process is running
 ==22408==
 --22408-- REDIR: 0x4017d50 (ld-linux-x86-64.so.2:strlen) redirected to
 0x38076571 (vgPlain_amd64_linux_REDIR_FOR_strlen)
 --22408-- Reading syms from /usr/lib64/valgrind/vgpreload_core-
 amd64-linux.so
 --22408--   Considering /usr/lib/debug/.build-
 id/58/67b922f0bc96aee7b64c349a285bd67f59f007.debug ..
 --22408--   .. build-id is valid
 --22408-- Reading syms from /usr/lib64/valgrind/vgpreload_memcheck-
 amd64-linux.so
 --22408--   Considering /usr/lib/debug/.build-
 id/d4/d2468b6123ae7af22107a7a93631c42003a021.debug ..
 --22408--   .. build-id is valid
 ==22408== WARNING: new redirection conflicts with existing -- ignoring it
 --22408--     old: 0x04017d50 (strlen              ) R-> (0000.0)
 0x38076571 vgPlain_amd64_linux_REDIR_FOR_strlen
 --22408--     new: 0x04017d50 (strlen              ) R-> (2007.0)
 0x04c2c600 strlen
 --22408-- REDIR: 0x4017a20 (ld-linux-x86-64.so.2:index) redirected to
 0x4c2c1b0 (index)
 --22408-- REDIR: 0x4017c40 (ld-linux-x86-64.so.2:strcmp) redirected to
 0x4c2d750 (strcmp)
 --22408-- REDIR: 0x4018a50 (ld-linux-x86-64.so.2:mempcpy) redirected to
 0x4c30200 (mempcpy)
 --22408-- Reading syms from /usr/lib64/libXv.so.1.0.0
 --22408--   Considering /usr/lib/debug/usr/lib64/libXv.so.1.0.0.debug ..
 --22408--   .. CRC is valid
 --22408-- Reading syms from /usr/lib64/libX11.so.6.3.0
 --22408--   Considering /usr/lib/debug/usr/lib64/libX11.so.6.3.0.debug ..
 --22408--   .. CRC is valid
 --22408-- Reading syms from /usr/lib64/libXext.so.6.4.0
 --22408--   Considering /usr/lib/debug/usr/lib64/libXext.so.6.4.0.debug ..
 --22408--   .. CRC is valid
 --22408-- Reading syms from /usr/lib64/libxcb.so.1.1.0
 --22408--   Considering /usr/lib/debug/usr/lib64/libxcb.so.1.1.0.debug ..
 --22408--   .. CRC is valid
 --22408-- Reading syms from /usr/lib64/libxcb-shm.so.0.0.0
 --22408--   Considering /usr/lib/debug/usr/lib64/libxcb-shm.so.0.0.0.debug
 ..
 --22408--   .. CRC is valid
 --22408-- Reading syms from /usr/lib64/libxcb-xfixes.so.0.0.0
 --22408--   Considering /usr/lib/debug/usr/lib64/libxcb-
 xfixes.so.0.0.0.debug ..
 --22408--   .. CRC is valid
 --22408-- Reading syms from /usr/lib64/libxcb-shape.so.0.0.0
 --22408--   Considering /usr/lib/debug/usr/lib64/libxcb-
 shape.so.0.0.0.debug ..
 --22408--   .. CRC is valid
 --22408-- Reading syms from /usr/lib64/libjack.so.0.0.28
 --22408--   Considering /usr/lib/debug/usr/lib64/libjack.so.0.0.28.debug
 ..
 --22408--   .. CRC is valid
 --22408-- Reading syms from /usr/lib64/libasound.so.2.0.0
 --22408--   Considering /usr/lib/debug/.build-
 id/2e/80b4d78320a5a3cdfbd2e77ca2d0e7287635c0.debug ..
 --22408--   .. build-id is valid
 --22408-- Reading syms from /usr/lib64/libSDL-1.2.so.0.11.4
 --22408--   Considering
 /usr/lib/debug/usr/lib64/libSDL-1.2.so.0.11.4.debug ..
 --22408--   .. CRC is valid
 --22408-- Reading syms from /lib64/libpthread-2.19.so
 --22408--   Considering /usr/lib/debug/lib64/libpthread-2.19.so.debug ..
 --22408--   .. CRC is valid
 --22408-- Reading syms from /lib64/libm-2.19.so
 --22408--   Considering /usr/lib/debug/lib64/libm-2.19.so.debug ..
 --22408--   .. CRC is valid
 --22408-- Reading syms from /lib64/liblzma.so.5.0.7
 --22408--   Considering /usr/lib/debug/lib64/liblzma.so.5.0.7.debug ..
 --22408--   .. CRC is valid
 --22408-- Reading syms from /lib64/libbz2.so.1.0.6
 --22408--   Considering /usr/lib/debug/lib64/libbz2.so.1.0.6.debug ..
 --22408--   .. CRC is valid
 --22408-- Reading syms from /lib64/libz.so.1.2.8
 --22408--   Considering /usr/lib/debug/lib64/libz.so.1.2.8.debug ..
 --22408--   .. CRC is valid
 --22408-- Reading syms from /usr/lib64/libvdpau.so.1.0.0
 --22408--   Considering /usr/lib/debug/usr/lib64/libvdpau.so.1.0.0.debug
 ..
 --22408--   .. CRC is valid
 --22408-- Reading syms from /lib64/libc-2.19.so
 --22408--   Considering /usr/lib/debug/lib64/libc-2.19.so.debug ..
 --22408--   .. CRC is valid
 --22408-- Reading syms from /lib64/libdl-2.19.so
 --22408--   Considering /usr/lib/debug/lib64/libdl-2.19.so.debug ..
 --22408--   .. CRC is valid
 --22408-- Reading syms from /usr/lib64/libXau.so.6.0.0
 --22408--   Considering /usr/lib/debug/usr/lib64/libXau.so.6.0.0.debug ..
 --22408--   .. CRC is valid
 --22408-- Reading syms from /usr/lib64/libXdmcp.so.6.0.0
 --22408--   Considering /usr/lib/debug/usr/lib64/libXdmcp.so.6.0.0.debug
 ..
 --22408--   .. CRC is valid
 --22408-- Reading syms from /lib64/librt-2.19.so
 --22408--   Considering /usr/lib/debug/lib64/librt-2.19.so.debug ..
 --22408--   .. CRC is valid
 --22408-- REDIR: 0x72f2130 (libc.so.6:strcasecmp) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --22408-- REDIR: 0x72f4420 (libc.so.6:strncasecmp) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --22408-- REDIR: 0x72f1900 (libc.so.6:memcpy at GLIBC_2.2.5) redirected to
 0x4a23770 (_vgnU_ifunc_wrapper)
 --22408-- REDIR: 0x72efc80 (libc.so.6:rindex) redirected to 0x4c2be90
 (rindex)
 --22408-- REDIR: 0x72ec2e0 (libc.so.6:index) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --22408-- REDIR: 0x72ec310 (libc.so.6:__GI_strchr) redirected to 0x4c2bff0
 (__GI_strchr)
 --22408-- REDIR: 0x72edf80 (libc.so.6:strlen) redirected to 0x4c2c540
 (strlen)
 --22408-- REDIR: 0x72ee3a0 (libc.so.6:strncmp) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --22408-- REDIR: 0x738f6f0 (libc.so.6:__strncmp_ssse3) redirected to
 0x4c2cd20 (strncmp)
 --22408-- REDIR: 0x72ec530 (libc.so.6:strcmp) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --22408-- REDIR: 0x738e490 (libc.so.6:__strcmp_ssse3) redirected to
 0x4c2d610 (strcmp)
 --22408-- REDIR: 0x72f0d90 (libc.so.6:strstr) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --22408-- REDIR: 0x7305c80 (libc.so.6:__strstr_sse2_unaligned) redirected
 to 0x4c30400 (strstr)
 --22408-- REDIR: 0x72f6b50 (libc.so.6:__GI_memcpy) redirected to 0x4c2e0f0
 (__GI_memcpy)
 --22408-- REDIR: 0x72e88d0 (libc.so.6:free) redirected to 0x4c2a1d0 (free)
 --22408-- REDIR: 0x72ea290 (libc.so.6:posix_memalign) redirected to
 0x4c2b640 (posix_memalign)
 --22408-- REDIR: 0x72f8ac0 (libc.so.6:strchrnul) redirected to 0x4c2fe10
 (strchrnul)
 --22408-- REDIR: 0x72ed9c0 (libc.so.6:strcpy) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --22408-- REDIR: 0x73015e0 (libc.so.6:__strcpy_sse2_unaligned) redirected
 to 0x4c2c620 (strcpy)
 --22408-- REDIR: 0x72ee3f0 (libc.so.6:__GI_strncmp) redirected to
 0x4c2cd90 (__GI_strncmp)
 ffmpeg version N-68291-g4fa2758 Copyright (c) 2000-2014 the FFmpeg
 developers
   built on Dec  8 2014 09:25:34 with gcc 4.8.3 (Gentoo 4.8.3 p1.1,
 pie-0.5.9)
   configuration: --prefix=/home/cocobo/repository/mpv-
 build_vanilla_debug/build_libs --enable-static --disable-shared --enable-
 gpl --enable-avresample --enable-debug=gdb --disable-doc --disable-
 optimizations --disable-stripping
   libavutil      54. 15.100 / 54. 15.100
   libavcodec     56. 14.100 / 56. 14.100
   libavformat    56. 15.102 / 56. 15.102
   libavdevice    56.  3.100 / 56.  3.100
   libavfilter     5.  2.103 /  5.  2.103
   libavresample   2.  1.  0 /  2.  1.  0
   libswscale      3.  1.101 /  3.  1.101
   libswresample   1.  1.100 /  1.  1.100
   libpostproc    53.  3.100 / 53.  3.100
 --22408-- REDIR: 0x72f1990 (libc.so.6:memset) redirected to 0x4c2f7b0
 (memset)
 --22408-- REDIR: 0x739e320 (libc.so.6:__memmove_ssse3_back) redirected to
 0x4c2d8b0 (memcpy at GLIBC_2.2.5)
 Splitting the commandline.
 Reading option '-loglevel' ...--22408-- REDIR: 0x72e8960
 (libc.so.6:realloc) redirected to 0x4c2b260 (realloc)
  matched as option 'loglevel' (set logging level) with argument '99'.
 Reading option '-i' ... matched as input file with argument
 'mxf_leak4.mxf'.
 Finished splitting the commandline.
 Parsing a group of options: global .
 Applying option loglevel (set logging level) with argument 99.
 Successfully parsed a group of options.
 Parsing a group of options: input file mxf_leak4.mxf.
 Successfully parsed a group of options.
 Opening an input file: mxf_leak4.mxf.
 --22408-- REDIR: 0x72f6b00 (libc.so.6:memcpy@@GLIBC_2.14) redirected to
 0x4a23770 (_vgnU_ifunc_wrapper)
 --22408-- REDIR: 0x72fca20 (libc.so.6:__memcpy_sse2_unaligned) redirected
 to 0x4c2db10 (memcpy@@GLIBC_2.14)
 --22408-- REDIR: 0x72f02f0 (libc.so.6:strspn) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --22408-- REDIR: 0x738b350 (libc.so.6:__strspn_sse42) redirected to
 0x4c30680 (strspn)
 --22408-- REDIR: 0x72f1320 (libc.so.6:bcmp) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --22408-- REDIR: 0x73ae2f0 (libc.so.6:__memcmp_sse4_1) redirected to
 0x4c2f060 (__memcmp_sse4_1)
 --22408-- REDIR: 0x72f88b0 (libc.so.6:rawmemchr) redirected to 0x4c2fe50
 (rawmemchr)
 --22408-- REDIR: 0x72edae0 (libc.so.6:strcspn) redirected to 0x4a23770
 (_vgnU_ifunc_wrapper)
 --22408-- REDIR: 0x738b100 (libc.so.6:__strcspn_sse42) redirected to
 0x4c30610 (strcspn)
 [mxf @ 0x7e38140] Format mxf probed with size=2048 and score=100
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.05.01.01.0d.01.02.01.01.02.04.00
     Last message repeated 3 times
 [mxf @ 0x7e38140] invalid KAGSize 0 - guessing 512
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.01.01.01.04.04.02.03.01.04.00.00.00
     Last message repeated 33 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.00.00.00.00.00.00.00.00.00.00.00.00
     Last message repeated 33 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.04.01.01.01.0e.06.02.01.40.df.08.00
     Last message repeated 33 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.23.00
     Last message repeated 33 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.36.00
     Last message repeated 13 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.0f.00
     Last message repeated 14 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.14.00
     Last message repeated 29 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.3b.00
     Last message repeated 28 times
 [mxf @ 0x7e38140] local tag 0000 with 0 size
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.11.00
     Last message repeated 16 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.3b.00
     Last message repeated 28 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.0f.00
     Last message repeated 14 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.11.00
     Last message repeated 16 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.ff.ff.0d.01.01.01.01.01.37.00
     Last message repeated 33 times
 [mxf @ 0x7e38140] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.44.00
     Last message repeated 17 times
 [mxf @ 0x7e38140] local tag 0x3f01 extends past end of local set @ 0xd4a
 [mxf @ 0x7e38140] error reading header metadata
 [AVIOContext @ 0x7e40e40] Statistics: 6551 bytes read, 0 seeks
 mxf_leak4.mxf: Invalid data found when processing input
 ==22408==
 ==22408== HEAP SUMMARY:
 ==22408==     in use at exit: 251,690,428 bytes in 28 blocks
 ==22408==   total heap usage: 121 allocs, 93 frees, 251,798,119 bytes
 allocated
 ==22408==
 ==22408== Searching for pointers to 28 not-freed blocks
 ==22408== Checked 258,927,032 bytes
 ==22408==
 ==22408== 251,658,320 bytes in 1 blocks are possibly lost in loss record
 25 of 25
 ==22408==    at 0x4C2B560: memalign (vg_replace_malloc.c:760)
 ==22408==    by 0x4C2B677: posix_memalign (vg_replace_malloc.c:913)
 ==22408==    by 0x11E106F: av_malloc (mem.c:95)
 ==22408==    by 0x11E12FF: av_mallocz (mem.c:245)
 ==22408==    by 0x11E1368: av_calloc (mem.c:255)
 ==22408==    by 0x63D41D: mxf_read_generic_descriptor (mxfdec.c:910)
 ==22408==    by 0x640A29: mxf_read_local_tags (mxfdec.c:2141)
 ==22408==    by 0x640C20: mxf_parse_klv (mxfdec.c:2185)
 ==22408==    by 0x641911: mxf_read_header (mxfdec.c:2522)
 ==22408==    by 0x6C48B9: avformat_open_input (utils.c:463)
 ==22408==    by 0x410FB7: open_input_file (ffmpeg_opt.c:873)
 ==22408==    by 0x419107: open_files (ffmpeg_opt.c:2699)
 ==22408==
 ==22408== LEAK SUMMARY:
 ==22408==    definitely lost: 0 bytes in 0 blocks
 ==22408==    indirectly lost: 0 bytes in 0 blocks
 ==22408==      possibly lost: 251,658,320 bytes in 1 blocks
 ==22408==    still reachable: 32,108 bytes in 27 blocks
 ==22408==         suppressed: 0 bytes in 0 blocks
 ==22408== Reachable blocks (those to which a pointer was found) are not
 shown.
 ==22408== To see them, rerun with: --leak-check=full --show-leak-kinds=all
 ==22408==
 ==22408== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
 ==22408== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/4173>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list