[FFmpeg-trac] #4819(avcodec:reopened): av_register_all() memory leak
FFmpeg
trac at avcodec.org
Wed Sep 2 15:39:17 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 cehoyos):
While I cannot reproduce an increasing leak no matter how often I call
x265_api_get(), the leak is significantly bigger if the libraries for
different bit-depths are actually available:
{{{
==26924== HEAP SUMMARY:
==26924== in use at exit: 3,244 bytes in 9 blocks
==26924== total heap usage: 11 allocs, 2 frees, 3,548 bytes allocated
==26924==
==26924== 30 bytes in 1 blocks are still reachable in loss record 1 of 7
==26924== at 0x4C2ABED: malloc (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==26924== by 0x4005D9D: open_path (in /lib64/ld-2.15.so)
==26924== by 0x4008266: _dl_map_object (in /lib64/ld-2.15.so)
==26924== by 0x401281D: dl_open_worker (in /lib64/ld-2.15.so)
==26924== by 0x400E5F5: _dl_catch_error (in /lib64/ld-2.15.so)
==26924== by 0x401228B: _dl_open (in /lib64/ld-2.15.so)
==26924== by 0x5C0E015: dlopen_doit (in /lib64/libdl-2.15.so)
==26924== by 0x400E5F5: _dl_catch_error (in /lib64/ld-2.15.so)
==26924== by 0x5C0E5EB: _dlerror_run (in /lib64/libdl-2.15.so)
==26924== by 0x5C0E0B0: dlopen@@GLIBC_2.2.5 (in /lib64/libdl-2.15.so)
==26924== by 0x4ED78EA: x265_api_get_74 (in libx265.so.74)
==26924== by 0x4007B1: main (in a.out)
==26924==
==26924== 30 bytes in 1 blocks are still reachable in loss record 2 of 7
==26924== at 0x4C2ABED: malloc (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==26924== by 0x4005D9D: open_path (in /lib64/ld-2.15.so)
==26924== by 0x4008266: _dl_map_object (in /lib64/ld-2.15.so)
==26924== by 0x401281D: dl_open_worker (in /lib64/ld-2.15.so)
==26924== by 0x400E5F5: _dl_catch_error (in /lib64/ld-2.15.so)
==26924== by 0x401228B: _dl_open (in /lib64/ld-2.15.so)
==26924== by 0x5C0E015: dlopen_doit (in /lib64/libdl-2.15.so)
==26924== by 0x400E5F5: _dl_catch_error (in /lib64/ld-2.15.so)
==26924== by 0x5C0E5EB: _dlerror_run (in /lib64/libdl-2.15.so)
==26924== by 0x5C0E0B0: dlopen@@GLIBC_2.2.5 (in /lib64/libdl-2.15.so)
==26924== by 0x4ED78EA: x265_api_get_74 (in libx265.so.74)
==26924== by 0x4007CD: main (in a.out)
==26924==
==26924== 32 bytes in 1 blocks are still reachable in loss record 3 of 7
==26924== at 0x4C292B8: calloc (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==26924== by 0x5C0E65F: _dlerror_run (in /lib64/libdl-2.15.so)
==26924== by 0x5C0E0B0: dlopen@@GLIBC_2.2.5 (in /lib64/libdl-2.15.so)
==26924== by 0x4ED78EA: x265_api_get_74 (in libx265.so.74)
==26924== by 0x4007B1: main (in a.out)
==26924==
==26924== 240 bytes in 1 blocks are still reachable in loss record 4 of 7
==26924== at 0x4C292B8: calloc (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==26924== by 0x4010042: _dl_check_map_versions (in /lib64/ld-2.15.so)
==26924== by 0x4012D05: dl_open_worker (in /lib64/ld-2.15.so)
==26924== by 0x400E5F5: _dl_catch_error (in /lib64/ld-2.15.so)
==26924== by 0x401228B: _dl_open (in /lib64/ld-2.15.so)
==26924== by 0x5C0E015: dlopen_doit (in /lib64/libdl-2.15.so)
==26924== by 0x400E5F5: _dl_catch_error (in /lib64/ld-2.15.so)
==26924== by 0x5C0E5EB: _dlerror_run (in /lib64/libdl-2.15.so)
==26924== by 0x5C0E0B0: dlopen@@GLIBC_2.2.5 (in /lib64/libdl-2.15.so)
==26924== by 0x4ED78EA: x265_api_get_74 (in libx265.so.74)
==26924== by 0x4007B1: main (in a.out)
==26924==
==26924== 240 bytes in 1 blocks are still reachable in loss record 5 of 7
==26924== at 0x4C292B8: calloc (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==26924== by 0x4010042: _dl_check_map_versions (in /lib64/ld-2.15.so)
==26924== by 0x4012D05: dl_open_worker (in /lib64/ld-2.15.so)
==26924== by 0x400E5F5: _dl_catch_error (in /lib64/ld-2.15.so)
==26924== by 0x401228B: _dl_open (in /lib64/ld-2.15.so)
==26924== by 0x5C0E015: dlopen_doit (in /lib64/libdl-2.15.so)
==26924== by 0x400E5F5: _dl_catch_error (in /lib64/ld-2.15.so)
==26924== by 0x5C0E5EB: _dlerror_run (in /lib64/libdl-2.15.so)
==26924== by 0x5C0E0B0: dlopen@@GLIBC_2.2.5 (in /lib64/libdl-2.15.so)
==26924== by 0x4ED78EA: x265_api_get_74 (in libx265.so.74)
==26924== by 0x4007CD: main (in a.out)
==26924==
==26924== 316 bytes in 2 blocks are still reachable in loss record 6 of 7
==26924== at 0x4C2ABED: malloc (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==26924== by 0x4C2AD6F: realloc (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==26924== by 0x400AF71: _dl_new_object (in /lib64/ld-2.15.so)
==26924== by 0x40062D5: _dl_map_object_from_fd (in /lib64/ld-2.15.so)
==26924== by 0x4008152: _dl_map_object (in /lib64/ld-2.15.so)
==26924== by 0x401281D: dl_open_worker (in /lib64/ld-2.15.so)
==26924== by 0x400E5F5: _dl_catch_error (in /lib64/ld-2.15.so)
==26924== by 0x401228B: _dl_open (in /lib64/ld-2.15.so)
==26924== by 0x5C0E015: dlopen_doit (in /lib64/libdl-2.15.so)
==26924== by 0x400E5F5: _dl_catch_error (in /lib64/ld-2.15.so)
==26924== by 0x5C0E5EB: _dlerror_run (in /lib64/libdl-2.15.so)
==26924== by 0x5C0E0B0: dlopen@@GLIBC_2.2.5 (in /lib64/libdl-2.15.so)
==26924==
==26924== 2,356 bytes in 2 blocks are still reachable in loss record 7 of
7
==26924== at 0x4C292B8: calloc (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==26924== by 0x400ADEE: _dl_new_object (in /lib64/ld-2.15.so)
==26924== by 0x40062D5: _dl_map_object_from_fd (in /lib64/ld-2.15.so)
==26924== by 0x4008152: _dl_map_object (in /lib64/ld-2.15.so)
==26924== by 0x401281D: dl_open_worker (in /lib64/ld-2.15.so)
==26924== by 0x400E5F5: _dl_catch_error (in /lib64/ld-2.15.so)
==26924== by 0x401228B: _dl_open (in /lib64/ld-2.15.so)
==26924== by 0x5C0E015: dlopen_doit (in /lib64/libdl-2.15.so)
==26924== by 0x400E5F5: _dl_catch_error (in /lib64/ld-2.15.so)
==26924== by 0x5C0E5EB: _dlerror_run (in /lib64/libdl-2.15.so)
==26924== by 0x5C0E0B0: dlopen@@GLIBC_2.2.5 (in /lib64/libdl-2.15.so)
==26924== by 0x4ED78EA: x265_api_get_74 (in libx265.so.74)
==26924==
==26924== LEAK SUMMARY:
==26924== definitely lost: 0 bytes in 0 blocks
==26924== indirectly lost: 0 bytes in 0 blocks
==26924== possibly lost: 0 bytes in 0 blocks
==26924== still reachable: 3,244 bytes in 9 blocks
==26924== suppressed: 0 bytes in 0 blocks
}}}
{{{
#include "x265.h"
int main()
{
printf("x265_api_get( 0): %p \n", x265_api_get(0));
printf("x265_api_get( 8): %p \n", x265_api_get(8));
printf("x265_api_get(10): %p \n", x265_api_get(10));
printf("x265_api_get(12): %p \n", x265_api_get(12));
x265_cleanup();
x265_api_get(0);
x265_api_get(8);
x265_api_get(10);
x265_api_get(12);
x265_cleanup();
return 0;
}
}}}
--
Ticket URL: <https://trac.ffmpeg.org/ticket/4819#comment:9>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list