#1127859 ffmpeg: buffer_pool_flush segfault on loong64

Package:
ffmpeg
Source:
ffmpeg
Description:
Tools for transcoding, streaming and playing of multimedia files
Submitter:
Joachim Bauch
Date:
2026-08-16 12:09:14 UTC
Severity:
normal
#1127859#5
Date:
2026-02-13 22:54:51 UTC
From:
To:
Dear Maintainer,

ffmpeg segfaults in "buffer_pool_flush" when called from the kvazaar test "test_invalid_input.sh" (see #1127385).

These are information to reproduce and some of my first findings.

Command:
ffmpeg -f lavfi -i mandelbrot=size=1x65 -vframes 1 -pix_fmt yuv420p -f yuv4mpegpipe /tmp/tmp.TfM9llmcRd

Output (tested in virtual machine to reproduce issue from buildd):
----------
ffmpeg version 8.0.1-3+b1 Copyright (c) 2000-2025 the FFmpeg developers
   built with gcc 15 (Debian 15.2.0-12)
   configuration: --prefix=/usr --extra-version=3+b1 --toolchain=hardened --libdir=/usr/lib/loongarch64-linux-gnu --incdir=/usr/include/loongarch64-linux-gnu --arch=loong64 --enable-gpl --disable-stripping --disable-pocketsphinx --disable-libcaca --disable-libmfx --disable-omx --enable-gnutls --enable-libaom --enable-libass --enable-libbs2b --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libharfbuzz --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-openal --enable-opencl --enable-opengl --disable-sndio --disable-libvpl --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-ladspa --enable-libbluray --enable-libdvdnav --enable-libdvdread --enable-libjack --enable-libjxl --enable-libpulse --enable-librabbitmq --enable-librist --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libx264 --enable-libzmq --enable-libzvbi --enable-lv2 --enable-sdl2 --enable-libplacebo --enable-librav1e --enable-librsvg --enable-shared
   libavutil      60.  8.100 / 60.  8.100
   libavcodec     62. 11.100 / 62. 11.100
   libavformat    62.  3.100 / 62.  3.100
   libavdevice    62.  1.100 / 62.  1.100
   libavfilter    11.  4.100 / 11.  4.100
   libswscale      9.  1.100 /  9.  1.100
   libswresample   6.  1.100 /  6.  1.100
Input #0, lavfi, from 'mandelbrot=size=1x65':
   Duration: N/A, start: 0.000000, bitrate: N/A
   Stream #0:0: Video: wrapped_avframe, rgb0, 1x65 [SAR 1:1 DAR 1:65], 25 fps, 25 tbr, 25 tbn
Stream mapping:
   Stream #0:0 -> #0:0 (wrapped_avframe (native) -> wrapped_avframe (native))
Press [q] to stop, [?] for help
Output #0, yuv4mpegpipe, to '/tmp/tmp.TfM9llmcRd':
   Metadata:
     encoder         : Lavf62.3.100
   Stream #0:0: Video: wrapped_avframe, yuv420p(progressive), 1x65 [SAR 1:1 DAR 1:65], q=2-31, 200 kb/s, 25 fps, 25 tbn
     Metadata:
       encoder         : Lavc62.11.100 wrapped_avframe
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault (core dumped)
----------

I attached a remote gdb and got this stack trace:
----------
Thread 2 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 92632.92650]
0x00007fd9d8e509a4 in ?? () from target:/usr/lib/loongarch64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007fd9d8e509a4 in ?? () from target:/usr/lib/loongarch64-linux-gnu/libc.so.6
#1  0x00007fd9d8e50c7c in ?? () from target:/usr/lib/loongarch64-linux-gnu/libc.so.6
#2  0x00007fd9c90fc9dc in buffer_pool_flush (pool=0x7fd9ac0021e0) at src/libavutil/buffer.c:308
#3  av_buffer_pool_uninit (ppool=<optimized out>) at src/libavutil/buffer.c:338
#4  0x00007fd9d982359c in ff_frame_pool_uninit (pool=<optimized out>) at src/libavfilter/framepool.c:291
#5  ff_frame_pool_uninit (pool=0x7fd9ac002d78) at src/libavfilter/framepool.c:283
#6  0x00007fd9d97f2bf4 in link_free (link=0x7fd9bc8433f8) at src/libavfilter/avfilter.c:207
#7  free_link (link=<optimized out>) at src/libavfilter/avfilter.c:791
#8  0x00007fd9d97f46d0 in avfilter_free (filter=0x7fd9ac002880) at src/libavfilter/avfilter.c:815
#9  0x00007fd9d97f757c in avfilter_graph_free (graphp=0x7fd9bc8434c8) at src/libavfilter/avfiltergraph.c:128
#10 0x00007fd9dad81768 in ?? ()
#11 0x00007fd9dad94488 in ?? ()
#12 0x00007fd9d8e3e504 in ?? () from target:/usr/lib/loongarch64-linux-gnu/libc.so.6
#13 0x00007fd9d8ebb350 in ?? () from target:/usr/lib/loongarch64-linux-gnu/libc.so.6
(gdb) f 2
#2  0x00007fd9c90fc9dc in buffer_pool_flush (pool=0x7fd9ac0021e0) at src/libavutil/buffer.c:308
308	in src/libavutil/buffer.c
(gdb) p *buf
$1 = {data = 0x7fd9ac07e0e0 "\244", opaque = 0x0, free = 0x7fd9c90fbdc0 <av_buffer_default_free>, pool = 0x7fd9ac0021e0, next = 0x7fd9ac011660, buffer = {
     data = 0x0, size = 0, refcount = 0, free = 0x0, opaque = 0x0, flags = 0, flags_internal = 0}}
----------

Thanks,
   Joachim

#1127859#12
Date:
2026-02-14 08:47:59 UTC
From:
To:
Control: forwarded -1 https://code.ffmpeg.org/FFmpeg/FFmpeg/issues/21756

Forwarded upstream.

Cheers

#1127859#17
Date:
2026-08-16 11:49:30 UTC
From:
To:
Hello,

Bug #1127859 in ffmpeg reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/multimedia-team/ffmpeg/-/commit/d52aea25bc9123bfaf61f7a7e5a0d9da01c8788d
------------------------------------------------------------------------
Backport loong64 fixes

Closes: #1140654, #1127859
------------------------------------------------------------------------

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/1127859

#1127859#24
Date:
2026-08-16 12:07:27 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
ffmpeg, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1127859@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Sebastian Ramacher <sramacher@debian.org> (supplier of updated ffmpeg package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Sun, 16 Aug 2026 13:34:52 +0200
Source: ffmpeg
Architecture: source
Version: 7:9.0.1-1
Distribution: experimental
Urgency: medium
Maintainer: Debian Multimedia Maintainers <debian-multimedia@lists.debian.org>
Changed-By: Sebastian Ramacher <sramacher@debian.org>
Closes: 1127859 1140654
Changes:
 ffmpeg (7:9.0.1-1) experimental; urgency=medium
 .
   * New upstream version 9.0.1
   * debian/: Backport loong64 fixes (Closes: #1140654, #1127859)
Checksums-Sha1:
 09096800f29fe9786b33e8a39656348cab8b6567 5833 ffmpeg_9.0.1-1.dsc
 b543ba1a9603620c4ed1db98f344d937c966b72a 12036420 ffmpeg_9.0.1.orig.tar.xz
 70afa363fa5430ee818a7d39c5453f29bb255e0c 520 ffmpeg_9.0.1.orig.tar.xz.asc
 122f7b582b08bc55c7118885c260d4c03d1758cf 58252 ffmpeg_9.0.1-1.debian.tar.xz
 5fc4db1c221a12762efb4906a3f3f1857f4dd253 33670 ffmpeg_9.0.1-1_amd64.buildinfo
Checksums-Sha256:
 652aaebc7e8ca7479f21df1651388f7b0b2938f101a174e14106fb2f1af1f275 5833 ffmpeg_9.0.1-1.dsc
 cf38e0e28c7e5605942c4a77755349b0145804a397af37eb1fb4c77cb237f635 12036420 ffmpeg_9.0.1.orig.tar.xz
 b613a00005232a1245ace7080088781ac23a916119d3e5b0d6c042368eee0177 520 ffmpeg_9.0.1.orig.tar.xz.asc
 85fdc38cab8bd19661c21ff70ab05d91e9bf2414bb76ceddfdfdc807252d5344 58252 ffmpeg_9.0.1-1.debian.tar.xz
 66a47cc50dec5e688b73ee6d9d946691f79ca8a8b57bb102962eb3ab0056bf28 33670 ffmpeg_9.0.1-1_amd64.buildinfo
Files:
 746e644733ffcd047d3352f6e88ae74d 5833 video optional ffmpeg_9.0.1-1.dsc
 3ed2aab5ce5d18a3c5e0d22d8ca3fadb 12036420 video optional ffmpeg_9.0.1.orig.tar.xz
 ca0bfe91ca61aff210b5ef9fec5985bc 520 video optional ffmpeg_9.0.1.orig.tar.xz.asc
 3235cc2136bb0ac0ce31440808860078 58252 video optional ffmpeg_9.0.1-1.debian.tar.xz
 a8a903324215d51194ff5a1884baa269 33670 video optional ffmpeg_9.0.1-1_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----

wr0EARYKAG8FgmqBo74JECGTazZgD82JRxQAAAAAAB4AIHNhbHRAbm90YXRpb25z
LnNlcXVvaWEtcGdwLm9yZ7NfKKuha4rSBj7XeEKPDuKn5DVmLfQOKbf3VjYZwtSH
FiEEQmJ+hB2ZZ9qD4fqQIZNrNmAPzYkAADOMAP4xU4iOIeYjJj9utF/DauLOtsz9
A8k5LpkSikKYxIqQVgD8CnAKt6VzDXP3V/ZR+N7P/snzXNaf0IA9FVCm3y8/EAM=
=P9Y4
-----END PGP SIGNATURE-----