-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
I've been debugging this for most of the day, mostly with the assistance of an LLM. I'm assuming it could be a Pillow issue, but maybe it could be a libavif (or other dependency) issue, let me know if it's not a direct Pillow issue.
On AWS Graviton 4 instances (c8g), saving AVIF files with specific dimensions causes a signal 6 (SIGABRT). On Intel/AMD instances - it's fine, on Graviton 2 instances (t4g) - it's fine, on Graviton 3 instances (c7g) - also fine. I even tested it on a Raspberry Pi and inside Docker on my M1 MacBook - also fine!
From /proc/cpuinfo on c7g:
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm paca pacg dcpodp svei8mm svebf16 i8mm bf16 dgh rng
And c8g:
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
Tested on: Debian bookworm, Debian trixie, Amazon Linux 2023.
Python: 3.14 (also 3.12)
Pillow: 12.1.1
I've attached avif_debug.py, and used https://raw.githubusercontent.com/python-pillow/Pillow/refs/heads/main/Tests/images/1_trns.png as a source image, running it results in:
# python avif_debug.py
--- Testing Isolation (Width: 974px) ---
1. Prepared RGBA file: killer_input.png (974x623)
2. Attempting conversion via libavif CLI (avifenc)... ✅ CLI SUCCESS (libavif might be safe, Pillow bridge suspect)
3. Attempting conversion via Pillow... corrupted size vs. prev_size
4.
Aborted (core dumped)
Consistently crashing.
I've also attached avif_working.py - which happily loops around generating thumbnails without crashing, and avif_crashing.py - which crashes after a bunch of iterations when there's certain dimensions that causes the issue.
Bit of debug info:
# python3 -m PIL.report
--------------------------------------------------------------------
Pillow 12.1.1
Python 3.14.3 (main, Feb 12 2026, 00:45:04) [Clang 21.1.4 ]
--------------------------------------------------------------------
Python executable is /root/.venv/bin/python3
Environment Python files loaded from /root/.venv
System Python files loaded from /root/.local/share/uv/python/cpython-3.14.3-linux-aarch64-gnu
--------------------------------------------------------------------
Python Pillow modules loaded from /root/.venv/lib/python3.14/site-packages/PIL
Binary Pillow modules loaded from /root/.venv/lib/python3.14/site-packages/PIL
--------------------------------------------------------------------
--- PIL CORE support ok, compiled for 12.1.1
--- TKINTER support ok, loaded 9.0
--- FREETYPE2 support ok, loaded 2.14.1
--- LITTLECMS2 support ok, loaded 2.17
--- WEBP support ok, loaded 1.6.0
--- AVIF support ok, loaded 1.3.0
--- JPEG support ok, compiled for libjpeg-turbo 3.1.3
--- OPENJPEG (JPEG2000) support ok, loaded 2.5.4
--- ZLIB (PNG/ZIP) support ok, loaded 1.3.1, compiled for zlib-ng 2.3.2
--- LIBTIFF support ok, loaded 4.7.1
*** RAQM (Bidirectional Text) support not installed
*** LIBIMAGEQUANT (Quantization method) support not installed
--- XCB (X protocol) support ok
--------------------------------------------------------------------
I did try a non-binary install with a fresh libavif (1.3.0) under Amazon Linux 2023 - mostly because libavif just wasn't available - still the same problem.
Happy to help give more detail if there's anything I'm missing!