Opened 8 months ago

Last modified 8 months ago

#10873 new defect

Memory leaks with ffmpeg cmd when use hwupload to vulkan format

Reported by: quinkblack Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Not sure if it's vulkan specific or not.

cmd:

./ffmpeg_g -init_hw_device vulkan=vk -filter_hw_device vk -i ~/video/bean.mp4  -an -vf hwupload -t 2 -f null -

Indirect leak of 5728 byte(s) in 1 object(s) allocated from:
    #0 0x5622804ffd47 in posix_memalign (/home/quink/work/ffmpeg-ci/build/ffmpeg/ffmpeg_g+0x8f5d47) (BuildId: d8aea9f54becadafdf18355b740030f7094924bb)
    #1 0x56228520a9bf in av_malloc /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/mem.c:105:9
    #2 0x56228520b704 in av_mallocz /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/mem.c:256:17
    #3 0x562285195e40 in av_hwdevice_ctx_alloc /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/hwcontext.c:172:31
    #4 0x56228519ba53 in av_hwdevice_ctx_create /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/hwcontext.c:626:18
    #5 0x56228059b867 in hw_device_init_from_string /home/quink/work/ffmpeg-ci/build/ffmpeg/src/fftools/ffmpeg_hw.c:152:15
    #6 0x5622805ed98a in opt_init_hw_device /home/quink/work/ffmpeg-ci/build/ffmpeg/src/fftools/ffmpeg_opt.c:650:16
    #7 0x562280612d6f in write_option /home/quink/work/ffmpeg-ci/build/ffmpeg/src/fftools/cmdutils.c:346:15
    #8 0x562280613d61 in parse_optgroup /home/quink/work/ffmpeg-ci/build/ffmpeg/src/fftools/cmdutils.c:469:15
    #9 0x5622805e66a3 in ffmpeg_parse_options /home/quink/work/ffmpeg-ci/build/ffmpeg/src/fftools/ffmpeg_opt.c:1363:11
    #10 0x562280627afd in main /home/quink/work/ffmpeg-ci/build/ffmpeg/src/fftools/ffmpeg.c:1032:11
    #11 0x7fc6c9629d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16

Indirect leak of 2520 byte(s) in 5 object(s) allocated from:
    #0 0x5622804ffd47 in posix_memalign (/home/quink/work/ffmpeg-ci/build/ffmpeg/ffmpeg_g+0x8f5d47) (BuildId: d8aea9f54becadafdf18355b740030f7094924bb)
    #1 0x56228520a9bf in av_malloc /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/mem.c:105:9
    #2 0x56228520b704 in av_mallocz /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/mem.c:256:17
    #3 0x5622851c2df1 in av_vk_frame_alloc /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/hwcontext_vulkan.c:3697:20
    #4 0x5622851dc619 in create_frame /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/hwcontext_vulkan.c:2054:20
    #5 0x5622851dea8f in vulkan_pool_alloc /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/hwcontext_vulkan.c:2218:11
    #6 0x56228514e3e9 in pool_alloc_buffer /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/buffer.c:362:26
    #7 0x56228514df38 in av_buffer_pool_get /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/buffer.c:401:15
    #8 0x5622851cb984 in vulkan_get_buffer /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/hwcontext_vulkan.c:2405:21
    #9 0x56228519a3ea in av_hwframe_get_buffer /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/hwcontext.c:563:11
    #10 0x5622812ac4cd in ff_default_get_video_buffer2 /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/video.c:66:15
    #11 0x5622812acd6b in ff_default_get_video_buffer /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/video.c:109:12
    #12 0x5622812abf4f in ff_get_video_buffer /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/video.c:122:15
    #13 0x562280bfc1e1 in hwupload_filter_frame /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/vf_hwupload.c:182:14
    #14 0x56228074c1d5 in ff_filter_frame_framed /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/avfilter.c:998:11
    #15 0x56228074b3ec in ff_filter_frame_to_filter /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/avfilter.c:1155:11
    #16 0x562280746ce8 in ff_filter_activate_default /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/avfilter.c:1219:20
    #17 0x562280746822 in ff_filter_activate /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/avfilter.c:1380:11
    #18 0x562280751dc6 in ff_filter_graph_run_once /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/avfiltergraph.c:1514:12
    #19 0x562280768399 in push_frame /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/buffersrc.c:194:15
    #20 0x562280767ff2 in av_buffersrc_add_frame_flags /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/buffersrc.c:304:15
    #21 0x5622805872e3 in send_frame /home/quink/work/ffmpeg-ci/build/ffmpeg/src/fftools/ffmpeg_filter.c:2723:11
    #22 0x56228057d507 in filter_thread /home/quink/work/ffmpeg-ci/build/ffmpeg/src/fftools/ffmpeg_filter.c:2863:19
    #23 0x562280600753 in task_wrapper /home/quink/work/ffmpeg-ci/build/ffmpeg/src/fftools/ffmpeg_sched.c:2228:21
    #24 0x7fc6c9694ac2 in start_thread nptl/./nptl/pthread_create.c:442:8

Indirect leak of 2176 byte(s) in 1 object(s) allocated from:
    #0 0x5622804ffd47 in posix_memalign (/home/quink/work/ffmpeg-ci/build/ffmpeg/ffmpeg_g+0x8f5d47) (BuildId: d8aea9f54becadafdf18355b740030f7094924bb)
    #1 0x56228520a9bf in av_malloc /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/mem.c:105:9
    #2 0x56228520b704 in av_mallocz /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/mem.c:256:17
    #3 0x56228520b848 in av_calloc /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/mem.c:267:12
    #4 0x5622812f2061 in ff_vk_exec_pool_init /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/vulkan.c:393:22
    #5 0x5622851cb0cf in vulkan_frames_init /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/hwcontext_vulkan.c:2367:11
    #6 0x562285198112 in av_hwframe_ctx_init /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/hwcontext.c:368:15
    #7 0x562280bfd17f in hwupload_config_output /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/vf_hwupload.c:154:11
    #8 0x56228074008d in avfilter_config_links /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/avfilter.c:360:31
    #9 0x56228073fee0 in avfilter_config_links /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/avfilter.c:349:24
    #10 0x56228074ef74 in graph_config_links /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/avfiltergraph.c:254:24
    #11 0x56228074e4e2 in avfilter_graph_config /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/avfiltergraph.c:1333:16
    #12 0x562280583d78 in configure_filtergraph /home/quink/work/ffmpeg-ci/build/ffmpeg/src/fftools/ffmpeg_filter.c:1760:16
    #13 0x562280586ef0 in send_frame /home/quink/work/ffmpeg-ci/build/ffmpeg/src/fftools/ffmpeg_filter.c:2702:15
    #14 0x56228057d507 in filter_thread /home/quink/work/ffmpeg-ci/build/ffmpeg/src/fftools/ffmpeg_filter.c:2863:19
    #15 0x562280600753 in task_wrapper /home/quink/work/ffmpeg-ci/build/ffmpeg/src/fftools/ffmpeg_sched.c:2228:21
    #16 0x7fc6c9694ac2 in start_thread nptl/./nptl/pthread_create.c:442:8

Indirect leak of 1920 byte(s) in 4 object(s) allocated from:
    #0 0x5622804ffd47 in posix_memalign (/home/quink/work/ffmpeg-ci/build/ffmpeg/ffmpeg_g+0x8f5d47) (BuildId: d8aea9f54becadafdf18355b740030f7094924bb)
    #1 0x56228520a9bf in av_malloc /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/mem.c:105:9
    #2 0x56228517fef1 in av_frame_alloc /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/frame.c:90:22
    #3 0x562285186f65 in av_frame_clone /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/frame.c:611:20
    #4 0x5622812f4f91 in ff_vk_exec_add_dep_frame /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/vulkan.c:638:51
    #5 0x5622851e91e2 in transfer_image_buf /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/hwcontext_vulkan.c:3336:11
    #6 0x5622851e67b1 in vulkan_transfer_data /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/hwcontext_vulkan.c:3514:11
    #7 0x5622851cc081 in vulkan_transfer_data_to /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/hwcontext_vulkan.c:3567:20
    #8 0x562285199215 in av_hwframe_transfer_data /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/hwcontext.c:501:19
    #9 0x562280bfc3f0 in hwupload_filter_frame /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/vf_hwupload.c:192:11
    #10 0x56228074c1d5 in ff_filter_frame_framed /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/avfilter.c:998:11
    #11 0x56228074b3ec in ff_filter_frame_to_filter /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/avfilter.c:1155:11
    #12 0x562280746ce8 in ff_filter_activate_default /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/avfilter.c:1219:20
    #13 0x562280746822 in ff_filter_activate /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/avfilter.c:1380:11
    #14 0x562280751dc6 in ff_filter_graph_run_once /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/avfiltergraph.c:1514:12
    #15 0x562280768399 in push_frame /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/buffersrc.c:194:15
    #16 0x562280767ff2 in av_buffersrc_add_frame_flags /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/buffersrc.c:304:15
    #17 0x5622805872e3 in send_frame /home/quink/work/ffmpeg-ci/build/ffmpeg/src/fftools/ffmpeg_filter.c:2723:11
    #18 0x56228057d507 in filter_thread /home/quink/work/ffmpeg-ci/build/ffmpeg/src/fftools/ffmpeg_filter.c:2863:19
    #19 0x562280600753 in task_wrapper /home/quink/work/ffmpeg-ci/build/ffmpeg/src/fftools/ffmpeg_sched.c:2228:21
    #20 0x7fc6c9694ac2 in start_thread nptl/./nptl/pthread_create.c:442:8

Indirect leak of 1520 byte(s) in 5 object(s) allocated from:
    #0 0x5622804ffd47 in posix_memalign (/home/quink/work/ffmpeg-ci/build/ffmpeg/ffmpeg_g+0x8f5d47) (BuildId: d8aea9f54becadafdf18355b740030f7094924bb)
    #1 0x56228520a9bf in av_malloc /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/mem.c:105:9
    #2 0x56228520b704 in av_mallocz /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/mem.c:256:17
    #3 0x5622851c2e1e in av_vk_frame_alloc /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/hwcontext_vulkan.c:3701:19
    #4 0x5622851dc619 in create_frame /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/hwcontext_vulkan.c:2054:20
    #5 0x5622851dea8f in vulkan_pool_alloc /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/hwcontext_vulkan.c:2218:11
    #6 0x56228514e3e9 in pool_alloc_buffer /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/buffer.c:362:26
    #7 0x56228514df38 in av_buffer_pool_get /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/buffer.c:401:15
    #8 0x5622851cb984 in vulkan_get_buffer /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/hwcontext_vulkan.c:2405:21
    #9 0x56228519a3ea in av_hwframe_get_buffer /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavutil/hwcontext.c:563:11
    #10 0x5622812ac4cd in ff_default_get_video_buffer2 /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/video.c:66:15
    #11 0x5622812acd6b in ff_default_get_video_buffer /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/video.c:109:12
    #12 0x5622812abf4f in ff_get_video_buffer /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/video.c:122:15
    #13 0x562280bfc1e1 in hwupload_filter_frame /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/vf_hwupload.c:182:14
    #14 0x56228074c1d5 in ff_filter_frame_framed /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/avfilter.c:998:11
    #15 0x56228074b3ec in ff_filter_frame_to_filter /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/avfilter.c:1155:11
    #16 0x562280746ce8 in ff_filter_activate_default /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/avfilter.c:1219:20
    #17 0x562280746822 in ff_filter_activate /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/avfilter.c:1380:11
    #18 0x562280751dc6 in ff_filter_graph_run_once /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/avfiltergraph.c:1514:12
    #19 0x562280768399 in push_frame /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/buffersrc.c:194:15
    #20 0x562280767ff2 in av_buffersrc_add_frame_flags /home/quink/work/ffmpeg-ci/build/ffmpeg/src/libavfilter/buffersrc.c:304:15
    #21 0x5622805872e3 in send_frame /home/quink/work/ffmpeg-ci/build/ffmpeg/src/fftools/ffmpeg_filter.c:2723:11
    #22 0x56228057d507 in filter_thread /home/quink/work/ffmpeg-ci/build/ffmpeg/src/fftools/ffmpeg_filter.c:2863:19
    #23 0x562280600753 in task_wrapper /home/quink/work/ffmpeg-ci/build/ffmpeg/src/fftools/ffmpeg_sched.c:2228:21
    #24 0x7fc6c9694ac2 in start_thread nptl/./nptl/pthread_create.c:442:8

See attachment for complete leak info.

Attachments (1)

log.txt (124.6 KB ) - added by quinkblack 8 months ago.
sanitizer logs

Download all attachments as: .zip

Change History (2)

by quinkblack, 8 months ago

Attachment: log.txt added

sanitizer logs

Note: See TracTickets for help on using tickets.