[FFmpeg-trac] #6212(undetermined:new): Memory leak on Ubuntu 16.04

FFmpeg trac at avcodec.org
Fri Mar 3 14:54:39 EET 2017


#6212: Memory leak on Ubuntu 16.04
-------------------------------------+-------------------------------------
             Reporter:  alqemyst     |                    Owner:
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:
              Version:  git-master   |  undetermined
             Keywords:  leak         |               Resolution:
             Blocking:               |               Blocked By:
Analyzed by developer:  0            |  Reproduced by developer:  0
-------------------------------------+-------------------------------------

Comment (by alqemyst):

 What I can tell now is when cuvid and libnpp are removed, nvidia looks
 stable over 30 min. Resident size 577 MB. Here is valgrind:

 {{{
 valgrind ./ffmpeg_g -y -loglevel error -i
 "udp://239.250.14.12:5004?reuse=1&timeout=3000000&fifo_size=1000000&overrun_nonfatal=1&buffer_size=16777216"
 -ignore_unknown -sn -an -c:v nvenc_h264 -profile:v high -b:v 2M -maxrate:v
 2M -bufsize:v 1M -f hls -hls_time 6 -hls_list_size 6 -use_localtime 1
 -hls_segment_filename "hls/0-%s.ts" "hls/0.m3u8"
 ==2052== Memcheck, a memory error detector
 ==2052== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
 ==2052== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright
 info
 ==2052== Command: ./ffmpeg_g -y -loglevel error -i
 udp://239.250.14.12:5004?reuse=1&timeout=3000000&fifo_size=1000000&overrun_nonfatal=1&buffer_size=16777216
 -ignore_unknown -sn -an -c:v nvenc_h264 -profile:v high -b:v 2M -maxrate:v
 2M -bufsize:v 1M -f hls -hls_time 6 -hls_list_size 6 -use_localtime 1
 -hls_segment_filename hls/0-%s.ts hls/0.m3u8
 ==2052==
 [mpeg2video @ 0xc4f6800] Invalid frame dimensions 0x0.
 ==2052== Warning: noted but unhandled ioctl 0x30000001 with no
 size/direction hints.
 ==2052==    This could cause spurious value errors to appear.
 ==2052==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a
 proper wrapper.
 ==2052== Warning: noted but unhandled ioctl 0x27 with no size/direction
 hints.
 ==2052==    This could cause spurious value errors to appear.
 ==2052==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a
 proper wrapper.
 ==2052== Warning: noted but unhandled ioctl 0x7ff with no size/direction
 hints.
 ==2052==    This could cause spurious value errors to appear.
 ==2052==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a
 proper wrapper.
 ==2052== Warning: noted but unhandled ioctl 0x25 with no size/direction
 hints.
 ==2052==    This could cause spurious value errors to appear.
 ==2052==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a
 proper wrapper.
 ==2052== Warning: noted but unhandled ioctl 0x17 with no size/direction
 hints.
 ==2052==    This could cause spurious value errors to appear.
 ==2052==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a
 proper wrapper.
 ==2052== Warning: set address range perms: large range [0x200000000,
 0x700000000) (noaccess)
 ==2052== Warning: set address range perms: large range [0x900000000,
 0xc00000000) (noaccess)
 ==2052== Warning: noted but unhandled ioctl 0x19 with no size/direction
 hints.
 ==2052==    This could cause spurious value errors to appear.
 ==2052==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a
 proper wrapper.
 ==2052== Warning: noted but unhandled ioctl 0x21 with no size/direction
 hints.
 ==2052==    This could cause spurious value errors to appear.
 ==2052==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a
 proper wrapper.
 ==2052== Warning: noted but unhandled ioctl 0x1b with no size/direction
 hints.
 ==2052==    This could cause spurious value errors to appear.
 ==2052==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a
 proper wrapper.
 ==2052== Conditional jump or move depends on uninitialised value(s)
 ==2052==    at 0x2421978F: ??? (in
 /usr/lib/nvidia-378/libnvcuvid.so.378.13)
 ==2052==    by 0x2422D4BC: ??? (in
 /usr/lib/nvidia-378/libnvcuvid.so.378.13)
 ==2052==    by 0x2422B6BE: ??? (in
 /usr/lib/nvidia-378/libnvcuvid.so.378.13)
 ==2052==    by 0x2421A4A1: ??? (in
 /usr/lib/nvidia-378/libnvcuvid.so.378.13)
 ==2052==    by 0x2429D873: ??? (in
 /usr/lib/nvidia-378/libnvcuvid.so.378.13)
 ==2052==    by 0x23FE2F82: ??? (in /usr/lib/nvidia-378/libnvidia-
 encode.so.378.13)
 ==2052==    by 0x23FF221C: ??? (in /usr/lib/nvidia-378/libnvidia-
 encode.so.378.13)
 ==2052==    by 0x46D441: nvenc_open_session (nvenc.c:168)
 ==2052==    by 0x46F950: nvenc_check_device (nvenc.c:362)
 ==2052==    by 0x46F950: nvenc_setup_device (nvenc.c:449)
 ==2052==    by 0x46F950: ff_nvenc_encode_init (nvenc.c:1270)
 ==2052==    by 0xAF86C9: avcodec_open2 (utils.c:1609)
 ==2052==    by 0x49ED5F: init_output_stream.constprop.23 (ffmpeg.c:3404)
 ==2052==    by 0x4A3427: reap_filters (ffmpeg.c:1437)
 ==2052==
 ==2052== Conditional jump or move depends on uninitialised value(s)
 ==2052==    at 0x2421979F: ??? (in
 /usr/lib/nvidia-378/libnvcuvid.so.378.13)
 ==2052==    by 0x2422D4BC: ??? (in
 /usr/lib/nvidia-378/libnvcuvid.so.378.13)
 ==2052==    by 0x2422B6BE: ??? (in
 /usr/lib/nvidia-378/libnvcuvid.so.378.13)
 ==2052==    by 0x2421A4A1: ??? (in
 /usr/lib/nvidia-378/libnvcuvid.so.378.13)
 ==2052==    by 0x2429D873: ??? (in
 /usr/lib/nvidia-378/libnvcuvid.so.378.13)
 ==2052==    by 0x23FE2F82: ??? (in /usr/lib/nvidia-378/libnvidia-
 encode.so.378.13)
 ==2052==    by 0x23FF221C: ??? (in /usr/lib/nvidia-378/libnvidia-
 encode.so.378.13)
 ==2052==    by 0x46D441: nvenc_open_session (nvenc.c:168)
 ==2052==    by 0x46F950: nvenc_check_device (nvenc.c:362)
 ==2052==    by 0x46F950: nvenc_setup_device (nvenc.c:449)
 ==2052==    by 0x46F950: ff_nvenc_encode_init (nvenc.c:1270)
 ==2052==    by 0xAF86C9: avcodec_open2 (utils.c:1609)
 ==2052==    by 0x49ED5F: init_output_stream.constprop.23 (ffmpeg.c:3404)
 ==2052==    by 0x4A3427: reap_filters (ffmpeg.c:1437)
 ==2052==
 ==2052== Conditional jump or move depends on uninitialised value(s)
 ==2052==    at 0x242197AF: ??? (in
 /usr/lib/nvidia-378/libnvcuvid.so.378.13)
 ==2052==    by 0x2422D4BC: ??? (in
 /usr/lib/nvidia-378/libnvcuvid.so.378.13)
 ==2052==    by 0x2422B6BE: ??? (in
 /usr/lib/nvidia-378/libnvcuvid.so.378.13)
 ==2052==    by 0x2421A4A1: ??? (in
 /usr/lib/nvidia-378/libnvcuvid.so.378.13)
 ==2052==    by 0x2429D873: ??? (in
 /usr/lib/nvidia-378/libnvcuvid.so.378.13)
 ==2052==    by 0x23FE2F82: ??? (in /usr/lib/nvidia-378/libnvidia-
 encode.so.378.13)
 ==2052==    by 0x23FF221C: ??? (in /usr/lib/nvidia-378/libnvidia-
 encode.so.378.13)
 ==2052==    by 0x46D441: nvenc_open_session (nvenc.c:168)
 ==2052==    by 0x46F950: nvenc_check_device (nvenc.c:362)
 ==2052==    by 0x46F950: nvenc_setup_device (nvenc.c:449)
 ==2052==    by 0x46F950: ff_nvenc_encode_init (nvenc.c:1270)
 ==2052==    by 0xAF86C9: avcodec_open2 (utils.c:1609)
 ==2052==    by 0x49ED5F: init_output_stream.constprop.23 (ffmpeg.c:3404)
 ==2052==    by 0x4A3427: reap_filters (ffmpeg.c:1437)
 ==2052==
     Last message repeated 4 times
 ==2052== Warning: noted but unhandled ioctl 0x42 with no size/direction
 hints.
 ==2052==    This could cause spurious value errors to appear.
 ==2052==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a
 proper wrapper.
 ==2052== Warning: noted but unhandled ioctl 0x22 with no size/direction
 hints.
 ==2052==    This could cause spurious value errors to appear.
 ==2052==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a
 proper wrapper.
 ==2052==
 ==2052== HEAP SUMMARY:
 ==2052==     in use at exit: 497,122 bytes in 3,060 blocks
 ==2052==   total heap usage: 3,205,074 allocs, 3,202,014 frees,
 8,895,453,494 bytes allocated
 ==2052==
 ==2052== LEAK SUMMARY:
 ==2052==    definitely lost: 2,556 bytes in 128 blocks
 ==2052==    indirectly lost: 80 bytes in 2 blocks
 ==2052==      possibly lost: 3,088 bytes in 22 blocks
 ==2052==    still reachable: 491,398 bytes in 2,908 blocks
 ==2052==         suppressed: 0 bytes in 0 blocks
 ==2052== Rerun with --leak-check=full to see details of leaked memory
 ==2052==
 ==2052== For counts of detected and suppressed errors, rerun with: -v
 ==2052== Use --track-origins=yes to see where uninitialised values come
 from
 ==2052== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0)
 }}}

 What I can do next is to add cuvid and libnpp in 2 separate tests and let
 you know which of these two leaks.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/6212#comment:8>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list