[ASAN] memory leak in test_libvlc_media with ancillary support
[000060e000000040] main libvlc warning: cannot read /home/janniaux/Projects/videolabs/vlc/build-asan/src/.libs/vlc/plugins/plugins.dat: No such file or directory
[00007ffcfac33f40] main generic error: cannot load plug-in ../modules/.libs/libdcp_plugin.so: libasan.so.6: cannot open shared object file: No such file or directory
[00007ffcfac33f40] main generic error: cannot load plug-in ../modules/.libs/libglfilter_blend_splitfields_plugin.so: libasan.so.6: cannot open shared object file: No such file or directory
[00007ffcfac33f40] main generic error: cannot load plug-in ../modules/.libs/libwl_drm_lease_plugin.so: libasan.so.6: cannot open shared object file: No such file or directory
[00007ffcfac33f40] main generic error: cannot load plug-in ../modules/.libs/libskins2_plugin.so: libasan.so.6: cannot open shared object file: No such file or directory
[00007ffcfac33f40] main generic error: cannot load plug-in ../modules/.libs/libtaglib_plugin.so: libasan.so.6: cannot open shared object file: No such file or directory
[00007ffcfac33f40] main generic error: cannot load plug-in ../modules/.libs/librist_plugin.so: libasan.so.6: cannot open shared object file: No such file or directory
[00007ffcfac33f40] main generic error: cannot load plug-in ../modules/.libs/libsmb2_plugin.so: libasan.so.6: cannot open shared object file: No such file or directory
[00007ffcfac33f40] main generic error: cannot load plug-in ../modules/.libs/libmedialibrary_plugin.so: libasan.so.6: cannot open shared object file: No such file or directory
[00007ffcfac33f40] main generic error: cannot load plug-in ../modules/.libs/libbluez_sensor_plugin.so: libasan.so.6: cannot open shared object file: No such file or directory
[00007ffcfac33f40] main generic error: cannot load plug-in ../modules/.libs/libpl_scale_plugin.so: libasan.so.6: cannot open shared object file: No such file or directory
[00007ffcfac33f40] main generic error: cannot load plug-in ../modules/.libs/libqt_plugin.so: libasan.so.6: cannot open shared object file: No such file or directory
[00007ffcfac33f40] main generic error: cannot load plug-in ../modules/.libs/libaccess_output_rist_plugin.so: libasan.so.6: cannot open shared object file: No such file or directory
[00007ffcfac33f40] main generic error: cannot load plug-in ../modules/.libs/libgme_plugin.so: libasan.so.6: cannot open shared object file: No such file or directory
[00007ffcfac33f40] main generic error: cannot load plug-in ../modules/.libs/libsid_plugin.so: libasan.so.6: cannot open shared object file: No such file or directory
[00007ffcfac33f40] main generic error: cannot load plug-in ../modules/.libs/libspatialaudio_plugin.so: libasan.so.6: cannot open shared object file: No such file or directory
[0000611000015940] main access warning: cannot insert stream filter record
testapi: test_media_preparsed: ../../test/samples/image.jpg, expected: 5
testapi: track(0/0): codec: RV24/RV24, video: 1x1, sar: 1/1, fps: 10/1
testapi: meta(0): 'image.jpg'
testapi: test_media_preparsed: http://parsing_should_be_skipped.org/video.mp4, expected: 2
testapi: test_media_preparsed: unknown://parsing_should_be_skipped.org/video.mp4, expected: 2
testapi: Testing media_subitems: path: '../../test/samples/subitems'
testapi: subitem_added, file: directory
testapi: subitem_added, file: file.jpg
testapi: subitem_added, file: file.mkv
testapi: subitem_added, file: file.mp3
testapi: subitem_added, file: file.png
testapi: subitem_added, file: file.ts
testapi: test if directory was added
testapi: test if file.jpg was added
testapi: test if file.mkv was added
testapi: test if file.mp3 was added
testapi: test if file.png was added
testapi: test if file.ts was added
testapi: Testing media_subitems: location: 'file:///home/janniaux/Projects/videolabs/vlc/test/samples/subitems'
testapi: subitem_added, file: directory
testapi: subitem_added, file: file.jpg
testapi: subitem_added, file: file.mkv
testapi: subitem_added, file: file.mp3
testapi: subitem_added, file: file.png
testapi: subitem_added, file: file.ts
testapi: test if directory was added
testapi: test if file.jpg was added
testapi: test if file.mkv was added
testapi: test if file.mp3 was added
testapi: test if file.png was added
testapi: test if file.ts was added
testapi: Testing media_subitems: location: 'dir:///home/janniaux/Projects/videolabs/vlc/test/samples/subitems'
testapi: subitem_added, file: directory
testapi: subitem_added, file: file.jpg
testapi: subitem_added, file: file.mkv
testapi: subitem_added, file: file.mp3
testapi: subitem_added, file: file.png
testapi: subitem_added, file: file.ts
testapi: test if directory was added
testapi: test if file.jpg was added
testapi: test if file.mkv was added
testapi: test if file.mp3 was added
testapi: test if file.png was added
testapi: test if file.ts was added
testapi: Testing media_subitems: fd: '5'
testapi: subitem_added, file: directory
testapi: subitem_added, file: file.jpg
testapi: subitem_added, file: file.mkv
testapi: subitem_added, file: file.mp3
testapi: subitem_added, file: file.png
testapi: subitem_added, file: file.ts
testapi: test if directory was added
testapi: test if file.jpg was added
testapi: test if file.mkv was added
testapi: test if file.mp3 was added
testapi: test if file.png was added
testapi: test if file.ts was added
testapi: Testing media_subitems failure
testapi: test_input_metadata_timeout: timeout: 100, wait_and_cancel: 0 ms
testapi: test_input_metadata_timeout: timeout: 0, wait_and_cancel: 100 ms
=================================================================
==331329==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 32 byte(s) in 1 object(s) allocated from:
#0 0x7f504dcbfa89 in __interceptor_malloc /usr/src/debug/gcc/libsanitizer/asan/asan_malloc_linux.cpp:69
#1 0x7f504d222f81 in vlc_ancillary_CreateWithFreeCb ../../src/misc/ancillary.c:44
#2 0x7f504d2434c5 in vlc_ancillary_Create ../../include/vlc_ancillary.h:93
#3 0x7f504d2434c5 in picture_AttachNewAncillary ../../src/misc/picture.c:489
#4 0x7f5042b52610 in DecodeBlock ../../modules/codec/jpeg.c:567
#5 0x7f504d274a6f in ImageRead ../../src/misc/image.c:180
#6 0x7f5042e2343d in Decode ../../modules/demux/image.c:152
#7 0x7f5042e2343d in Open ../../modules/demux/image.c:719
#8 0x7f504d01657d in demux_Probe ../../src/input/demux.c:111
#9 0x7f504cf6f5c5 in vlc_module_load ../../src/modules/modules.c:243
#10 0x7f504d01768a in demux_NewAdvanced ../../src/input/demux.c:194
#11 0x7f504d084b0c in InputDemuxNew ../../src/input/input.c:2546
#12 0x7f504d084b0c in InputSourceInit ../../src/input/input.c:2680
#13 0x7f504d08c130 in Init ../../src/input/input.c:1288
#14 0x7f504d0a6eae in Preparse ../../src/input/input.c:447
#15 0x7f504be8c54c (/usr/lib/libc.so.6+0x8c54c)
Indirect leak of 1336 byte(s) in 1 object(s) allocated from:
#0 0x7f504dcbfa89 in __interceptor_malloc /usr/src/debug/gcc/libsanitizer/asan/asan_malloc_linux.cpp:69
#1 0x7f504d2434a8 in picture_AttachNewAncillary ../../src/misc/picture.c:485
#2 0x7f5042b52610 in DecodeBlock ../../modules/codec/jpeg.c:567
#3 0x7f504d274a6f in ImageRead ../../src/misc/image.c:180
#4 0x7f5042e2343d in Decode ../../modules/demux/image.c:152
#5 0x7f5042e2343d in Open ../../modules/demux/image.c:719
#6 0x7f504d01657d in demux_Probe ../../src/input/demux.c:111
#7 0x7f504cf6f5c5 in vlc_module_load ../../src/modules/modules.c:243
#8 0x7f504d01768a in demux_NewAdvanced ../../src/input/demux.c:194
#9 0x7f504d084b0c in InputDemuxNew ../../src/input/input.c:2546
#10 0x7f504d084b0c in InputSourceInit ../../src/input/input.c:2680
#11 0x7f504d08c130 in Init ../../src/input/input.c:1288
#12 0x7f504d0a6eae in Preparse ../../src/input/input.c:447
#13 0x7f504be8c54c (/usr/lib/libc.so.6+0x8c54c)
SUMMARY: AddressSanitizer: 1368 byte(s) leaked in 2 allocation(s).
FAIL test_libvlc_media (exit status: 1)
╭─janniaux@unidan-tower ~/Projects/videolabs/vlc ‹954c112542*›
╰─$ git bisect log
git bisect start
# good: [d8c883e273f333d7e2d8c2c2df1e35b280021df5] transcode: fix asynchronous decoder encoding
git bisect good d8c883e273f333d7e2d8c2c2df1e35b280021df5
# bad: [9383a3e8767c2334840131a03c2bb53bd339adaa] qml/Player: Adjust PlaylistListView placement and size
git bisect bad 9383a3e8767c2334840131a03c2bb53bd339adaa
# good: [4b5880da56e89adecb41645b497cba525d0a3b56] xcb/window: wait for window to be mapped
git bisect good 4b5880da56e89adecb41645b497cba525d0a3b56
# bad: [26af61217bf0d8cd85aa811a98ec403a0951a29c] dsm: forward the vlc_interrupt_unregister() return value
git bisect bad 26af61217bf0d8cd85aa811a98ec403a0951a29c
# good: [dd8c8e03b631a51e1063c5908c39679ff2a2fc5e] video_output: remove dropped_current_frame test
git bisect good dd8c8e03b631a51e1063c5908c39679ff2a2fc5e
# bad: [8876fd6614f13c1bd63ceae3c0cf5ff2ea9bb7af] video_output: make date_refresh local in the only block it's used
git bisect bad 8876fd6614f13c1bd63ceae3c0cf5ff2ea9bb7af
# bad: [ac85c5a658e0eeeb1a24822252c5bbd6d54f9274] video_output: copy the redisplay handling in the if/else branch
git bisect bad ac85c5a658e0eeeb1a24822252c5bbd6d54f9274
# bad: [7669876f3298b4eeb0146a4180e631830ac9e4c1] png: decode ICC profiles
git bisect bad 7669876f3298b4eeb0146a4180e631830ac9e4c1
# good: [c0b2f318ceb7e235883550008eee148e6f98dc93] vlc_opengl: document vlc_gl_GetProcAddress
git bisect good c0b2f318ceb7e235883550008eee148e6f98dc93
# good: [d986d36b6effe49116aff05a31d9d229976c21a3] avcodec: decode ICC profile side data
git bisect good d986d36b6effe49116aff05a31d9d229976c21a3
# bad: [954c1125425d0b55d346e4f1e08c0f0917366322] jpeg: decode ICC profiles
git bisect bad 954c1125425d0b55d346e4f1e08c0f0917366322
# first bad commit: [954c1125425d0b55d346e4f1e08c0f0917366322] jpeg: decode ICC profiles
╰─$ git bisect bad
954c1125425d0b55d346e4f1e08c0f0917366322 is the first bad commit
commit 954c1125425d0b55d346e4f1e08c0f0917366322
Author: Niklas Haas <git@haasn.dev>
Date: Tue May 24 15:14:27 2022 +0200
jpeg: decode ICC profiles
This implementation relies on the helper function jpeg_read_icc_profile
which was introduced in libjpeg-turbo v1.5.90. Its absence from other
versions of libjpeg means we may wish to copy this helper function into
our own code in the future. But for now, keep it simple and avoid
unnecessary bloat.
modules/codec/jpeg.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
Of course, the problem is exposed here because it's the first usage, and it probably comes from be4cb6f6 instead.
Edited by Alexandre Janniaux