Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Marco Oman via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: Dariusz Frankiewicz via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
Cc: Marco Oman <marco.oman@innovatrieste.it>
Subject: [FFmpeg-devel] Suspected memory leak with CUDA detected by valgrind
Date: Thu, 11 Sep 2025 14:59:21 +0000
Message-ID: <PAVPR01MB103719931D636F0D0B3E5CC8DE109A@PAVPR01MB10371.eurprd01.prod.exchangelabs.com> (raw)

Hi,
I compiled the example hw_decode.c on Ubuntu 24.04 with ffmpeg 7.0 compiled with --enable-cuda-nvcc. Then lauched the decoding over a small mp4 file with a video encoded H264 and checked the whole thing with valgrind with the following command:

valgrind --leak-check=yes --log-file=hw_decode.log ./hw_decode cuda a.mp4 a.raw

The resulting log is quite large, suggesting that there is a memory leak . Anyone found somehting similar?
Is the leak real or valgrind is giving a false positive?

Here there are two sections from hw_decode.log

==1495328== 48 bytes in 1 blocks are definitely lost in loss record 24 of 118
==1495328==    at 0x484DA83: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==1495328==    by 0x7029E01: pthread_cond_broadcast@GLIBC_2.2.5 (old_pthread_cond_broadcast.c:33)
==1495328==    by 0x22095866: ???
==1495328==    by 0x22064373: ???
==1495328==    by 0x2201800E: ???
==1495328==    by 0x4E3CC65: nvdec_test_capabilities (nvdec.c:127)
==1495328==    by 0x4E3CC65: nvdec_decoder_create (nvdec.c:218)
==1495328==    by 0x4E3CC65: ff_nvdec_decode_init (nvdec.c:404)
==1495328==    by 0x4ADDBA3: hwaccel_init (decode.c:1193)
==1495328==    by 0x4ADDBA3: ff_get_format (decode.c:1331)
==1495328==    by 0x4BE3B97: get_pixel_format (h264_slice.c:909)
==1495328==    by 0x4BE5A87: h264_init_ps (h264_slice.c:1142)
==1495328==    by 0x4BE95F7: h264_field_start (h264_slice.c:1393)
==1495328==    by 0x4BE95F7: ff_h264_queue_decode_slice (h264_slice.c:2150)
==1495328==    by 0x4BEE8C5: decode_nal_units (h264dec.c:656)
==1495328==    by 0x4BEE8C5: h264_decode_frame (h264dec.c:1058)
==1495328==    by 0x4ADC4C9: decode_simple_internal (decode.c:409)
==1495328==    by 0x4ADC4C9: decode_simple_receive_frame (decode.c:579)
==1495328==    by 0x4ADC4C9: decode_receive_frame_internal (decode.c:608)

Plus many more of this kind

==1495328== 72 bytes in 1 blocks are possibly lost in loss record 44 of 118
==1495328==    at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==1495328==    by 0xA91E6D9: ??? (in /usr/lib/x86_64-linux-gnu/libcuda.so.570.133.20)
==1495328==    by 0xA80E7A9: ??? (in /usr/lib/x86_64-linux-gnu/libcuda.so.570.133.20)
==1495328==    by 0xA7FF82C: ??? (in /usr/lib/x86_64-linux-gnu/libcuda.so.570.133.20)
==1495328==    by 0xA7CD210: ??? (in /usr/lib/x86_64-linux-gnu/libcuda.so.570.133.20)
==1495328==    by 0xA81B671: ??? (in /usr/lib/x86_64-linux-gnu/libcuda.so.570.133.20)
==1495328==    by 0x5EB4E90: cuda_device_create (hwcontext_cuda.c:446)
==1495328==    by 0x5EB177E: av_hwdevice_ctx_create (hwcontext.c:619)
==1495328==    by 0x10A5A6: hw_decoder_init (in /home/marco/hw_decode)
==1495328==    by 0x10AD66: main (in /home/marco/hw_decode)


________________________________________

Informativa sulla privacy e sulla sicurezza

Questo messaggio può contenere informazioni confidenziali ed è destinato esclusivamente all'indirizzo in intestazione. Il materiale e le informazioni contenuti e/o collegati a questo messaggio sono riservati e non divulgabili a terzi. Ai sensi della legge sul diritto d'autore e del codice civile, sono vietate la riproduzione o la modifica non espressamente autorizzata di questo materiale, o di parte di esso, con qualsiasi mezzo, in quanto di esclusiva proprietà di Innova S.p.A. o dei suoi danti causa. Persone diverse dal destinatario di questo messaggio non possono copiare o distribuire il messaggio stesso a terzi. Punti di vista od opinioni personali presenti in questo messaggio sono riconducibili direttamente al solo mittente del messaggio, e non rappresentano necessariamente il punto di vista o l'opinione di Innova S.p.A., salvo altrimenti specificato. Essendo Internet un canale di comunicazione non sicuro, Innova S.p.A. non è responsabile di eventuali modifiche, né della violazione, sottrazione o soppressione, occorse al messaggio dopo la spedizione da parte del mittente. Si raccomanda al destinatario di effettuare un controllo antivirus prima di aprire qualsiasi allegato alla presente. Innova S.p.A. non è responsabile di eventuali danni occorsi a seguito di virus informatici accidentalmente trasmessi tramite i contenuti del presente messaggio. Chiunque riceva questo messaggio per errore, è pregato di distruggerlo e di informare immediatamente il mittente con lo stesso mezzo e cancellarlo dai propri sistemi. Quanto precede ai fini del rispetto del Regolamento UE 2016/679 in materia di protezione dei dati personali. Per l'informativa estesa consultare il sito Internet di Innova S.p.A. sezione Privacy.

Disclaimer and confidentiality notice

This e-mail may contain confidential information and is intended only for the addressee named above and the contents should not be disclosed to any other person nor copies taken or forwarded. Any views or opinions presented are solely those of the sender and do not necessarily represent the views of Innova S.p.A. unless otherwise specifically stated. As not all internet communications are secure Innova S.p.A. does not accept legal responsibility for the contents of this message nor responsibility for any change or breach or subtraction or suppression of this message after it was sent by the original sender. We advise you to carry out your own virus check before opening any attachments as we cannot accept liability for any damage sustained as a result of any software viruses. Please notify the sender immediately if you have received this e-mail by mistake and delete it from your systems. This disclaimer according to GDPR Regulation EU 2016/679. Privacy-related information is available on the company website, Privacy section.
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

             reply	other threads:[~2025-09-11 14:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-11 14:59 Marco Oman via ffmpeg-devel [this message]
2025-09-11 16:24 ` [FFmpeg-devel] " Timo Rothenpieler via ffmpeg-devel

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=PAVPR01MB103719931D636F0D0B3E5CC8DE109A@PAVPR01MB10371.eurprd01.prod.exchangelabs.com \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=marco.oman@innovatrieste.it \
    /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