> -----Original Message-----
> From: ffmpeg-devel <[email protected]> On Behalf Of Mark
> Thompson
> Sent: Montag, 19. Mai 2025 22:08
> To: [email protected]
> Subject: Re: [FFmpeg-devel] [PATCH v2] ffmpeg: Don't print graphs if there are
> no outputs yet
>
> On 18/05/2025 15:57, softworkz . wrote:
> >> -----Original Message-----
> >> From: ffmpeg-devel <[email protected]> On Behalf Of Mark
> >> Thompson
> >> Sent: Sonntag, 18. Mai 2025 16:22
> >> To: [email protected]
> >> Subject: Re: [FFmpeg-devel] [PATCH v2] ffmpeg: Don't print graphs if there
> are
> >> no outputs yet
> >>
> >> ...
> >>
> >> Suggest doing any non-performance-critical development (like this) with
> asan
> >> enabled in future; it doesn't slow things down very much and makes it
> easier
> >> to catch and fix leaks as you go along.
> >
> >
> > It's a good idea - I didn't have it on the record anymore after the pause.
> >
> > In the past, it had often caused trouble with MSVC (/fsanitize=address), so
> > we had it only in a Linux CI - which this work didn't go through 😊
> > I'll check it out, maybe MS have made some progress with it.
> >
> > Thanks for the suggestion and the patches,
> > sw
>
> I've run with the mermaidhtml output a bit as well. The output looks nice but
> there are many asan errors, mostly from lost string alloctions - see below.
>
> I had a look at fixing these, but the object lifetime model appears more
> complex than I could straightforwardly divine - it's not obvious when any
> given object can be freed. I suggest that you with your greater understanding
> would be better placed to fix these.
>
> Thanks,
>
> - Mark
Hi Mark,
I think I got all of them covered now, patches sent.
While hunting those leaks, I noticed a lot of leaks around QSV hardware
acceleration, is that known and do you see these as well? I hope it doesn't
go back to my original code for QSV D3D11..
Thanks
sw
Command was something like:
-init_hw_device d3d11va=d1:2 -init_hw_device qsv@d1 -hwaccel qsv -c:v h264_qsv
-i in.mkv -filter_complex "[0:0]scale_qsv=w=512:h=256[f1_out0]" -map [f1_out0]
-c:v hevc_qsv out1.mkv
---------- Block 11879 at 0x000000005A25B810: 103 bytes ----------
Leak Hash: 0xBD2EC68A, Count: 1, Total 103 bytes
Call Stack (TID 51116):
ucrtbased.dll!aligned_malloc()
V:\ffbuild\source\ffmpeg\libavutil\mem.c (110): ffmpegd.exe!av_malloc() +
0x12 bytes
V:\ffbuild\source\ffmpeg\libavutil\mem.c (258): ffmpegd.exe!av_mallocz() +
0xC bytes
V:\ffbuild\source\ffmpeg\libavutil\buffer.c (44):
ffmpegd.exe!buffer_create() + 0xA bytes
V:\ffbuild\source\ffmpeg\libavutil\buffer.c (64):
ffmpegd.exe!av_buffer_create() + 0x34 bytes
V:\ffbuild\source\ffmpeg\libavutil\hwcontext.c (282):
ffmpegd.exe!av_hwframe_ctx_alloc() + 0x20 bytes
V:\ffbuild\source\ffmpeg\libavutil\hwcontext_qsv.c (576):
ffmpegd.exe!qsv_init_child_ctx() + 0x9 bytes
V:\ffbuild\source\ffmpeg\libavutil\hwcontext_qsv.c (754):
ffmpegd.exe!qsv_init_pool() + 0xC bytes
V:\ffbuild\source\ffmpeg\libavutil\hwcontext_qsv.c (1428):
ffmpegd.exe!qsv_frames_init() + 0xF bytes
V:\ffbuild\source\ffmpeg\libavutil\hwcontext.c (364):
ffmpegd.exe!av_hwframe_ctx_init() + 0xF bytes
V:\ffbuild\source\ffmpeg\libavcodec\qsvdec.c (349):
ffmpegd.exe!qsv_decode_preinit() + 0x13 bytes
V:\ffbuild\source\ffmpeg\libavcodec\qsvdec.c (445):
ffmpegd.exe!qsv_decode_header() + 0x21 bytes
---------- Block 14884 at 0x000000005A2548B0: 103 bytes ----------
Leak Hash: 0x48BB8D37, Count: 1, Total 103 bytes
Call Stack (TID 51116):
ucrtbased.dll!aligned_malloc()
V:\ffbuild\source\ffmpeg\libavutil\mem.c (110): ffmpegd.exe!av_malloc() +
0x12 bytes
V:\ffbuild\source\ffmpeg\libavutil\mem.c (258): ffmpegd.exe!av_mallocz() +
0xC bytes
V:\ffbuild\source\ffmpeg\libavutil\buffer.c (105):
ffmpegd.exe!av_buffer_ref() + 0xA bytes
V:\ffbuild\source\ffmpeg\libavcodec\qsv.c (764):
ffmpegd.exe!qsv_create_mids() + 0xC bytes
V:\ffbuild\source\ffmpeg\libavcodec\qsv.c (1143):
ffmpegd.exe!ff_qsv_init_session_frames() + 0xF bytes
V:\ffbuild\source\ffmpeg\libavcodec\qsvdec.c (211):
ffmpegd.exe!qsv_init_session() + 0x77 bytes
V:\ffbuild\source\ffmpeg\libavcodec\qsvdec.c (381):
ffmpegd.exe!qsv_decode_preinit() + 0x38 bytes
V:\ffbuild\source\ffmpeg\libavcodec\qsvdec.c (445):
ffmpegd.exe!qsv_decode_header() + 0x21 bytes
V:\ffbuild\source\ffmpeg\libavcodec\qsvdec.c (1026):
ffmpegd.exe!qsv_process_data() + 0x2A bytes
V:\ffbuild\source\ffmpeg\libavcodec\qsvdec.c (1186):
ffmpegd.exe!qsv_decode_frame() + 0x34 bytes
V:\ffbuild\source\ffmpeg\libavcodec\decode.c (442):
ffmpegd.exe!decode_simple_internal() + 0x23 bytes
V:\ffbuild\source\ffmpeg\libavcodec\decode.c (600):
ffmpegd.exe!decode_simple_receive_frame() + 0x17 bytes
V:\ffbuild\source\ffmpeg\libavcodec\decode.c (636):
ffmpegd.exe!ff_decode_receive_frame_internal() + 0x13 bytes
V:\ffbuild\source\ffmpeg\libavcodec\decode.c (653):
ffmpegd.exe!decode_receive_frame_internal() + 0x13 bytes
V:\ffbuild\source\ffmpeg\libavcodec\decode.c (729):
ffmpegd.exe!avcodec_send_packet() + 0x17 bytes
V:\ffbuild\source\ffmpeg\fftools\ffmpeg_dec.c (724):
ffmpegd.exe!packet_decode() + 0x12 bytes
V:\ffbuild\source\ffmpeg\fftools\ffmpeg_dec.c (952):
ffmpegd.exe!decoder_thread() + 0x30 bytes
V:\ffbuild\source\ffmpeg\fftools\ffmpeg_sched.c (2534):
ffmpegd.exe!task_wrapper() + 0x11 bytes
V:\ffbuild\source\ffmpeg\compat\w32pthreads.h (78):
ffmpegd.exe!win32thread_worker() + 0x11 bytes
ucrtbased.dll!register_onexit_function() + 0xF5 bytes
KERNEL32.DLL!BaseThreadInitThunk() + 0x17 bytes
ntdll.dll!RtlUserThreadStart() + 0x2C bytes
---------- Block 11870 at 0x000000005A1E1DF0: 127 bytes ----------
Leak Hash: 0x73D25304, Count: 1, Total 127 bytes
Call Stack (TID 51116):
ucrtbased.dll!aligned_malloc()
V:\ffbuild\source\ffmpeg\libavutil\mem.c (110): ffmpegd.exe!av_malloc() +
0x12 bytes
V:\ffbuild\source\ffmpeg\libavutil\mem.c (258): ffmpegd.exe!av_mallocz() +
0xC bytes
V:\ffbuild\source\ffmpeg\libavutil\hwcontext.c (273):
ffmpegd.exe!av_hwframe_ctx_alloc() + 0xD bytes
V:\ffbuild\source\ffmpeg\libavutil\hwcontext_qsv.c (576):
ffmpegd.exe!qsv_init_child_ctx() + 0x9 bytes
V:\ffbuild\source\ffmpeg\libavutil\hwcontext_qsv.c (754):
ffmpegd.exe!qsv_init_pool() + 0xC bytes
V:\ffbuild\source\ffmpeg\libavutil\hwcontext_qsv.c (1428):
ffmpegd.exe!qsv_frames_init() + 0xF bytes
V:\ffbuild\source\ffmpeg\libavutil\hwcontext.c (364):
ffmpegd.exe!av_hwframe_ctx_init() + 0xF bytes
V:\ffbuild\source\ffmpeg\libavcodec\qsvdec.c (349):
ffmpegd.exe!qsv_decode_preinit() + 0x13 bytes
V:\ffbuild\source\ffmpeg\libavcodec\qsvdec.c (445):
ffmpegd.exe!qsv_decode_header() + 0x21 bytes
V:\ffbuild\source\ffmpeg\libavcodec\qsvdec.c (1026):
ffmpegd.exe!qsv_process_data() + 0x2A bytes
V:\ffbuild\source\ffmpeg\libavcodec\qsvdec.c (1186):
ffmpegd.exe!qsv_decode_frame() + 0x34 bytes
V:\ffbuild\source\ffmpeg\libavcodec\decode.c (442):
ffmpegd.exe!decode_simple_internal() + 0x23 bytes
V:\ffbuild\source\ffmpeg\libavcodec\decode.c (600):
ffmpegd.exe!decode_simple_receive_frame() + 0x17 bytes
V:\ffbuild\source\ffmpeg\libavcodec\decode.c (636):
ffmpegd.exe!ff_decode_receive_frame_internal() + 0x13 bytes
V:\ffbuild\source\ffmpeg\libavcodec\decode.c (653):
ffmpegd.exe!decode_receive_frame_internal() + 0x13 bytes
V:\ffbuild\source\ffmpeg\libavcodec\decode.c (729):
ffmpegd.exe!avcodec_send_packet() + 0x17 bytes
V:\ffbuild\source\ffmpeg\fftools\ffmpeg_dec.c (724):
ffmpegd.exe!packet_decode() + 0x12 bytes
V:\ffbuild\source\ffmpeg\fftools\ffmpeg_dec.c (952):
ffmpegd.exe!decoder_thread() + 0x30 bytes
V:\ffbuild\source\ffmpeg\fftools\ffmpeg_sched.c (2534):
ffmpegd.exe!task_wrapper() + 0x11 bytes
V:\ffbuild\source\ffmpeg\compat\w32pthreads.h (78):
ffmpegd.exe!win32thread_worker() + 0x11 bytes
ucrtbased.dll!register_onexit_function() + 0xF5 bytes
KERNEL32.DLL!BaseThreadInitThunk() + 0x17 bytes
ntdll.dll!RtlUserThreadStart() + 0x2C bytes
---------- Block 13196 at 0x000000005A049A40: 271 bytes ----------
Leak Hash: 0x8D8100C0, Count: 1, Total 271 bytes
Call Stack (TID 51116):
ucrtbased.dll!aligned_malloc()
V:\ffbuild\source\ffmpeg\libavutil\mem.c (110): ffmpegd.exe!av_malloc() +
0x12 bytes
V:\ffbuild\source\ffmpeg\libavutil\mem.c (258): ffmpegd.exe!av_mallocz() +
0xC bytes
V:\ffbuild\source\ffmpeg\libavutil\mem.c (270): ffmpegd.exe!av_calloc()
V:\ffbuild\source\ffmpeg\libavutil\hwcontext_qsv.c (1436):
ffmpegd.exe!qsv_frames_init() + 0x15 bytes
V:\ffbuild\source\ffmpeg\libavutil\hwcontext.c (364):
ffmpegd.exe!av_hwframe_ctx_init() + 0xF bytes
V:\ffbuild\source\ffmpeg\libavcodec\qsvdec.c (349):
ffmpegd.exe!qsv_decode_preinit() + 0x13 bytes
V:\ffbuild\source\ffmpeg\libavcodec\qsvdec.c (445):
ffmpegd.exe!qsv_decode_header() + 0x21 bytes
V:\ffbuild\source\ffmpeg\libavcodec\qsvdec.c (1026):
ffmpegd.exe!qsv_process_data() + 0x2A bytes
V:\ffbuild\source\ffmpeg\libavcodec\qsvdec.c (1186):
ffmpegd.exe!qsv_decode_frame() + 0x34 bytes
V:\ffbuild\source\ffmpeg\libavcodec\decode.c (442):
ffmpegd.exe!decode_simple_internal() + 0x23 bytes
V:\ffbuild\source\ffmpeg\libavcodec\decode.c (600):
ffmpegd.exe!decode_simple_receive_frame() + 0x17 bytes
V:\ffbuild\source\ffmpeg\libavcodec\decode.c (636):
ffmpegd.exe!ff_decode_receive_frame_internal() + 0x13 bytes
V:\ffbuild\source\ffmpeg\libavcodec\decode.c (653):
ffmpegd.exe!decode_receive_frame_internal() + 0x13 bytes
V:\ffbuild\source\ffmpeg\libavcodec\decode.c (729):
ffmpegd.exe!avcodec_send_packet() + 0x17 bytes
V:\ffbuild\source\ffmpeg\fftools\ffmpeg_dec.c (724):
ffmpegd.exe!packet_decode() + 0x12 bytes
V:\ffbuild\source\ffmpeg\fftools\ffmpeg_dec.c (952):
ffmpegd.exe!decoder_thread() + 0x30 bytes
V:\ffbuild\source\ffmpeg\fftools\ffmpeg_sched.c (2534):
ffmpegd.exe!task_wrapper() + 0x11 bytes
V:\ffbuild\source\ffmpeg\compat\w32pthreads.h (78):
ffmpegd.exe!win32thread_worker() + 0x11 bytes
ucrtbased.dll!register_onexit_function() + 0xF5 bytes
KERNEL32.DLL!BaseThreadInitThunk() + 0x17 bytes
ntdll.dll!RtlUserThreadStart() + 0x2C bytes
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".