-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segmentation Fault when decoding PNG on macOS 10.14 #8750
Comments
I tested the image on my macOS machine and found no error. I ran radarhere@f70ccfa to test it in a variety of macOS environments on GitHub Actions, and it passed. I tried installing from our wheels as well - radarhere@18dd6db - but that passed also. How did you install Pillow? |
Thanks for the checks.
Using As far as I can tell from the Actions page, they didn't go as low as macOS 10.14. |
What output do you get for these commands? pip3 --version
python3 --version And does it work with this? python3 -m pip install pillow |
Same outcome ( |
You've found that Pillow 7.2 works, but 11.1.0 doesn't. Would you be able to test and find the first version where there is a problem? |
Oh, I'll explain this a bit. Regarding, Line 382 in ede46d4
the decoder was set atLines 350 to 352 in ede46d4
where Lines 420 to 422 in ede46d4
The return type here might be an instance of Line 792 in ede46d4
So if you were interested in investigating our C code to find out where the problem is, Pillow/src/libImaging/ZipDecode.c Line 43 in ede46d4
would be the place to look. |
Curiously enough, 11.1 turns out to be the first version where it breaks! 11.0 (and below) works fine. So it must be a most recent change that is causing this! and hopefully not difficult to track down. |
I can confirm that installing the first wheel reproduces the error, while the second one passes. |
Thanks. When the segfault happens, I don't suppose you get one of those 'Python quit unexpectedly' dialogs, with a 'Report...' option? If so, could you click 'Report...' and copy and paste the contents here? |
Here it is:
|
Thanks. I've created zlib-ng/zlib-ng#1877, to see what the zlib-ng team makes of this. |
Thanks for your interest, macOS 10.14 doesn't get much love anymore (after Apple decided to abandon it). Reading the mission statement of zlib-ng, I'm curious to see if they care. |
Same issue with Pillow 11.1 and Python 3.11.9 on macOS 10.13. Pillow 11.0 works. |
zlib-ng has a possible fix in zlib-ng/zlib-ng#1878. Would someone like to try it out? pillow-11.2.0.dev0-cp311-cp311-macosx_10_10_x86_64.whl.zip |
Confirmed to work on macOS 10.14.6 |
Thanks. The fix is confirmed to work on macOS 10.13. |
Thanks very much. So the ultimate fix will be to wait for that PR to be merged, become part of a zlib-ng release and then update our wheels accordingly. However, that might not happen before our next scheduled release, so I've created #8772 to temporarily revert to zlib on macOS < 10.15 in the meantime. |
zlib-ng/zlib-ng#1878 has been updated, and they've asked for a retest. If anyone would like to do so? pillow-11.2.0.dev0-cp311-cp311-macosx_10_10_x86_64.whl.zip |
Works fine here! |
The updated fix also works on macOS 10.13. |
Thanks. |
zlib-ng/zlib-ng#1878 has now been merged. |
What did you do?
I've come across this bug while using
pytautogui.screenshot()
. By debugging it, I've narrowed it down to this call:decoder.decode(b)
insideImage.load()
. This call runs successfully when the image is a JPEG format, but not when it's PNG (the latter is the default format used by the screenshot utility on macOS).For now, I've resolved the problem by downgrading Pillow to 7.2, which was the last version tested on macOS 10.14 according to https://pillow.readthedocs.io/en/latest/installation/platform-support.html
What actually happened?
Python crashes with
Segmentation fault: 11
on this line insideImage.load()
:Jumping to the definition of
decode()
shows that the only instruction is to raise "NotImplementedError", with the message "unvailable in base decoder".What are your OS, Python and Pillow versions?
The text was updated successfully, but these errors were encountered: