Huge memory leaks in video_output on Mac OS X
I recently found a huge numbers of memory leaks on Mac OS X. This issue is caused by forgetting subpicure_Delete in modules/video_output/macosx.m
The following log is generated by leaks command. (not all)
Process: VLC [14719]
Path: /Applications/VLC.app/Contents/MacOS/VLC
Load Address: 0x100000000
Identifier: org.videolan.vlc
Version: 2.1.0-git (2.1.0-git)
Code Type: X86-64 (Native)
Parent Process: launchd [216]
Date/Time: 2012-02-28 07:36:19.197 +0900
OS Version: Mac OS X 10.7.3 (11D50)
Report Version: 7
leaks Report Version: 2.0
Process 14719: 77357 nodes malloced for 93933 KB
Process 14719: 371 leaks for 1629312 total leaked bytes.
Leak: 0x10a183000 size=1581056 zone: DefaultMallocZone_0x100128000
0x80000000 0x80000000 0x80000000 0x80000000 ................
0x80000000 0x80000000 0x80000000 0x80000000 ................
0x80000000 0x80000000 0x80000000 0x80000000 ................
0x80000000 0x80000000 0x80000000 0x80000000 ................
0x80000000 0x80000000 0x80000000 0x80000000 ................
0x80000000 0x80000000 0x80000000 0x80000000 ................
0x80000000 0x80000000 0x80000000 0x80000000 ................
0x80000000 0x80000000 0x80000000 0x80000000 ................
...
Call stack: [thread 0x10e781000]: | thread_start | _pthread_start | Thread | ThreadDisplayPicture | spu_Render | RenderCommon | RenderAXYZ | picture_NewFromResource | posix_memalign | malloc_zone_memalign
Leak: 0x10c547120 size=768 zone: DefaultMallocZone_0x100128000
0x0e32f278 0x00000001 0x0e32f788 0x00000001 x.2.......2.....
0x0e32fbf8 0x00000001 0x0e330068 0x00000001 ..2.....h.3.....
0x0e3304d8 0x00000001 0x0e330910 0x00000001 ..3.......3.....
0x0e331e48 0x00000001 0x0e332980 0x00000001 H.3......)3.....
0x0e334478 0x00000001 0x0e336040 0x00000001 xD3.....@`3.....
0x0e336620 0x00000001 0x0e337018 0x00000001 f3......p3.....
0x0e337670 0x00000001 0x0e338140 0x00000001 pv3.....@.3.....
0x0e3389e0 0x00000001 0x0e339350 0x00000001 ..3.....P.3.....
...
Call stack: [thread 0x10ca06000]: | ff_alloc_picture | ffmpeg_GetFrameBuf | decoder_NewPicture | vout_new_buffer | input_resource_RequestVout | vout_Request | spu_Attach | SpuRenderCreateAndLoadText | vlc_module_load | Create | FcConfigBuildFonts | FcConfigAddDirList | FcConfigAddCache | FcFontSetAdd | malloc | malloc_zone_malloc
Leak: 0x10d958f80 size=768 zone: DefaultMallocZone_0x100128000
0x0e32f278 0x00000001 0x0e32f788 0x00000001 x.2.......2.....
0x0e32fbf8 0x00000001 0x0e330068 0x00000001 ..2.....h.3.....
0x0e3304d8 0x00000001 0x0e330910 0x00000001 ..3.......3.....
0x0e331e48 0x00000001 0x0e332980 0x00000001 H.3......)3.....
0x0e334478 0x00000001 0x0e336040 0x00000001 xD3.....@`3.....
0x0e336620 0x00000001 0x0e337018 0x00000001 f3......p3.....
0x0e337670 0x00000001 0x0e338140 0x00000001 pv3.....@.3.....
0x0e3389e0 0x00000001 0x0e339350 0x00000001 ..3.....P.3.....
...
Call stack: [thread 0x10ca06000]: | ff_alloc_picture | ffmpeg_GetFrameBuf | decoder_NewPicture | vout_new_buffer | input_resource_RequestVout | vout_Request | spu_Create | SpuRenderCreateAndLoadText | vlc_module_load | Create | FcConfigBuildFonts | FcConfigAddDirList | FcConfigAddCache | FcFontSetAdd | realloc | malloc_zone_realloc
Leak: 0x10d969650 size=352 zone: DefaultMallocZone_0x100128000
0x41424752 0x0000063a 0x000000b2 0x00000000 RGBA:...........
0x00000000 0x0000063a 0x000000b2 0x00000020 ....:....... ...
0x00000001 0x00000001 0x00000000 0x00000000 ................
0x00000000 0x00000000 0x00000000 0x00000000 ................
0x00000000 0x00000000 0x00000000 0x00000000 ................
0x00000000 0x00000000 0x00000000 0x00000000 ................
0x0a183000 0x00000001 0x0a183000 0x00000001 .0.......0......
0x000000c2 0x00001900 0x00000004 0x000000b2 ................
...
Call stack: [thread 0x10e781000]: | thread_start | _pthread_start | Thread | ThreadDisplayPicture | spu_Render | RenderCommon | RenderAXYZ | picture_NewFromResource | calloc | malloc_zone_calloc
Leak: 0x101120410 size=160 zone: DefaultMallocZone_0x100128000
0x41424752 0x000004ab 0x000000b2 0x00000000 RGBA............
0x00000000 0x000004ab 0x000000b2 0x00000020 ............ ...
0x0000063a 0x000004ab 0x00000000 0x00000000 :...............
0x00000000 0x00000000 0x00000000 0x00000000 ................
0x00000000 0x00000000 0x00000000 0x00000000 ................
0x00000000 0x00000000 0x00000000 0x00000000 ................
0x0d967e70 0x00000001 0x00000079 0x0000035b p~......y...[...
0x00000000 0x00000003 0x00000000 0x00000000 ................
...
Call stack: [thread 0x10e781000]: | thread_start | _pthread_start | Thread | ThreadDisplayPicture | spu_Render | subpicture_region_New | calloc | malloc_zone_calloc
Leak: 0x1011475d0 size=160 zone: DefaultMallocZone_0x100128000
0x41424752 0x000004ab 0x000000b2 0x00000000 RGBA............
0x00000000 0x000004ab 0x000000b2 0x00000020 ............ ...
0x0000063a 0x000004ab 0x00000000 0x00000000 :...............
0x00000000 0x00000000 0x00000000 0x00000000 ................
0x00000000 0x00000000 0x00000000 0x00000000 ................
0x00000000 0x00000000 0x00000000 0x00000000 ................
0x0d967e70 0x00000001 0x00000079 0x0000035b p~......y...[...
0x00000000 0x000000ff 0x00000000 0x00000000 ................
...
Call stack: [thread 0x10e781000]: | thread_start | _pthread_start | Thread | ThreadDisplayPicture | spu_Render | subpicture_region_New | calloc | malloc_zone_calloc