Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: "softworkz ." <softworkz-at-hotmail.com@ffmpeg.org>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH v2] ffmpeg: Don't print graphs if there are no outputs yet
Date: Tue, 20 May 2025 02:14:27 +0000
Message-ID: <DM8P223MB0365A09E722EA7F668EC4D54BA9FA@DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <10a5bb15-dd30-44ae-8e35-d245ebe7aa2e@jkqxz.net>



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Mark
> Thompson
> Sent: Montag, 19. Mai 2025 22:08
> To: ffmpeg-devel@ffmpeg.org
> 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 <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Mark
> >> Thompson
> >> Sent: Sonntag, 18. Mai 2025 16:22
> >> To: ffmpeg-devel@ffmpeg.org
> >> 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
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

      parent reply	other threads:[~2025-05-20  2:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-17 20:02 Mark Thompson
2025-05-17 20:04 ` softworkz .
2025-05-18 14:21   ` Mark Thompson
2025-05-18 14:57     ` softworkz .
2025-05-19 20:08       ` Mark Thompson
2025-05-19 21:13         ` softworkz .
2025-05-20  2:14         ` softworkz . [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM8P223MB0365A09E722EA7F668EC4D54BA9FA@DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM \
    --to=softworkz-at-hotmail.com@ffmpeg.org \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git