Over at https://github.com/python-pillow/Pillow, we switched from zlib to zlib-ng in the wheels of our latest release. Since then, a macOS 10.14 user has reported a segmentation fault in python-pillow/Pillow#8750, and it appears that zlib-ng is the key difference.
I’ve created a branch at https://github.com/radarhere/Pillow/tree/zlib_demo. radarhere/Pillow@1a38c92 removes almost all Pillow code to set up a simplified reproduction. With that,
- I build the wheel using GitHub Actions - https://github.com/radarhere/Pillow/actions/runs/13469046394
- I download the wheel on a macOS 10.14.6 x86_64 machine and install it with
python3.11 -m pip install pillow-11.1.0-cp311-cp311-macosx_10_10_x86_64.whl
- I run the Python code
from PIL import _imaging to trigger the C code
The relevant C code in src/_imaging.c is
z_stream z_stream;
z_stream.zalloc = (alloc_func)NULL;
z_stream.zfree = (free_func)NULL;
z_stream.opaque = (voidpf)NULL;
By itself, that does not produce a problem. When I add in radarhere/Pillow@753d484
at the end then https://github.com/radarhere/Pillow/actions/runs/13469051411 creates another wheel, and there is a segfault - report.txt
If I change the wheel process to target macOS 11 and build on arm64, and then run the resulting wheel on macOS 15, there is no problem.
Thanks for any help.
Over at https://github.com/python-pillow/Pillow, we switched from zlib to zlib-ng in the wheels of our latest release. Since then, a macOS 10.14 user has reported a segmentation fault in python-pillow/Pillow#8750, and it appears that zlib-ng is the key difference.
I’ve created a branch at https://github.com/radarhere/Pillow/tree/zlib_demo. radarhere/Pillow@1a38c92 removes almost all Pillow code to set up a simplified reproduction. With that,
python3.11 -m pip install pillow-11.1.0-cp311-cp311-macosx_10_10_x86_64.whlfrom PIL import _imagingto trigger the C codeThe relevant C code in
src/_imaging.cisBy itself, that does not produce a problem. When I add in radarhere/Pillow@753d484
at the end then https://github.com/radarhere/Pillow/actions/runs/13469051411 creates another wheel, and there is a segfault - report.txt
If I change the wheel process to target macOS 11 and build on arm64, and then run the resulting wheel on macOS 15, there is no problem.
Thanks for any help.