[FFmpeg-trac] #4819(avcodec:reopened): av_register_all() memory leak

FFmpeg trac at avcodec.org
Thu Sep 3 00:56:57 CEST 2015


#4819: av_register_all() memory leak
--------------------------------------+------------------------------------
             Reporter:  joeallen      |                    Owner:
                 Type:  defect        |                   Status:  reopened
             Priority:  normal        |                Component:  avcodec
              Version:  unspecified   |               Resolution:
             Keywords:  libx265 leak  |               Blocked By:
             Blocking:                |  Reproduced by developer:  0
Analyzed by developer:  0             |
--------------------------------------+------------------------------------

Comment (by joeallen):

 Also just to throw this out there: avfilter_register_all() also leaks
 additional 49 bytes. Eventually I am gonna have multiple instances(1K+) of
 this conversion application that I am making so those bytes would add up.

 {{{
 int main (int argc, char ** argv){

   //Initialize all codecs
   av_register_all();
   avfilter_register_all();

 }
 }}}

 Valgrind output:
 {{{
 HEAP SUMMARY:
 ==6024==     in use at exit: 130 bytes in 3 blocks
 ==6024==   total heap usage: 1,383 allocs, 1,380 frees, 573,201,253 bytes
 allocated
 ==6024==
 ==6024== Searching for pointers to 3 not-freed blocks
 ==6024== Checked 23,000,312 bytes
 ==6024==
 ==6024== 32 bytes in 1 blocks are still reachable in loss record 1 of 3
 ==6024==    at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-
 amd64-linux.so)
 ==6024==    by 0x714A68F: _dlerror_run (dlerror.c:141)
 ==6024==    by 0x714A197: dlsym (dlsym.c:70)
 ==6024==    by 0x110466BD: ??? (in /usr/lib/libGL.so.340.76)
 ==6024==    by 0x1102A515: ??? (in /usr/lib/libGL.so.340.76)
 ==6024==    by 0x40100FC: call_init.part.0 (dl-init.c:64)
 ==6024==    by 0x4010222: _dl_init (dl-init.c:36)
 ==6024==    by 0x4001309: ??? (in /lib/x86_64-linux-gnu/ld-2.19.so)
 ==6024==    by 0x1: ???
 ==6024==    by 0xFFF00008A: ???
 ==6024==    by 0xFFF000092: ???
 ==6024==
 ==6024== 49 bytes in 1 blocks are still reachable in loss record 2 of 3
 ==6024==    at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-
 amd64-linux.so)
 ==6024==    by 0x5B70839: strdup (strdup.c:42)
 ==6024==    by 0x1104891E: ??? (in /usr/lib/libGL.so.340.76)
 ==6024==    by 0x1102A703: ??? (in /usr/lib/libGL.so.340.76)
 ==6024==    by 0x40100FC: call_init.part.0 (dl-init.c:64)
 ==6024==    by 0x4010222: _dl_init (dl-init.c:36)
 ==6024==    by 0x4001309: ??? (in /lib/x86_64-linux-gnu/ld-2.19.so)
 ==6024==    by 0x1: ???
 ==6024==    by 0xFFF00008A: ???
 ==6024==    by 0xFFF000092: ???
 ==6024==
 ==6024== 49 bytes in 1 blocks are still reachable in loss record 3 of 3
 ==6024==    at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-
 amd64-linux.so)
 ==6024==    by 0x400FDC0: _dl_signal_error (dl-error.c:90)
 ==6024==    by 0x40146CF: _dl_open (dl-open.c:715)
 ==6024==    by 0x714A02A: dlopen_doit (dlopen.c:66)
 ==6024==    by 0x400FFF3: _dl_catch_error (dl-error.c:187)
 ==6024==    by 0x714A62C: _dlerror_run (dlerror.c:163)
 ==6024==    by 0x714A0C0: dlopen@@GLIBC_2.2.5 (dlopen.c:87)
 ==6024==    by 0xD7E9273: x265_api_get_63 (in
 /usr/local/lib/libx265.so.63)
 ==6024==    by 0x5F21E9C: ??? (in /usr/local/lib/libavcodec.so.56.41.100)
 ==6024==    by 0x5FA0C21: avcodec_register_all (in
 /usr/local/lib/libavcodec.so.56.41.100)
 ==6024==    by 0x4E6B452: av_register_all (in
 /usr/local/lib/libavformat.so.56.36.100)
 ==6024==    by 0x4009D0: main (main.cpp:38)
 ==6024==
 ==6024== LEAK SUMMARY:
 ==6024==    definitely lost: 0 bytes in 0 blocks
 ==6024==    indirectly lost: 0 bytes in 0 blocks
 ==6024==      possibly lost: 0 bytes in 0 blocks
 ==6024==    still reachable: 130 bytes in 3 blocks
 ==6024==         suppressed: 0 bytes in 0 blocks
 ==6024==
 ==6024== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
 ==6024== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
 }}}

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


More information about the FFmpeg-trac mailing list