-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Aborted when loading a specific png in ARM64 environments #3225
Comments
Information: It happens with sharp 0.30.0 or later. Using libjemalloc2 resolves this error but I hope it will work without any manipulation on our part. |
Thanks for reporting this, I'll try to reproduce on some ARM64 hardware when I can. Please can you test the following code with the same image to help narrow down if this might be a decode or encode problem. await sharp('favicon.png').raw().toBuffer(); // decode only, no PNG encoding sharp v0.29.x provides libspng v0.6.3 whereas sharp v.30.x provides libspng v0.7.1. The sample input is palette-based, and when decoded on ARM64 will use libspng v0.7.1's NEON optimised path, which leads me to suspect this might relate to randy408/libspng#189 |
I was able to reproduce this crash with the libvips v8.12.2-build2 Windows ARM64 binaries on my Raspberry Pi 4B by simply doing: vips.exe avg favicon.png Doing the same with the (unpublished) v8.12.2 binaries, built against libspng 0.7.2, works without problems. While looking at the temporary fix (commit randy408/libspng@a4270af), I noticed that only
I think |
This is confirmed to be the case. When the quickfix was released the root cause was not yet known, the image from the initial bug report did not trigger the same problem in the other function. It does with this new image. The last release in February fixed both functions and also another issue that is listed in the announcement, so there was good reason to upgrade to the latest version, as it already declared the previous version (v0.7.1) buggy for other reasons. |
Thanks all for confirming, the future v0.31.0 release of sharp will provide prebuilt binaries with a more recent version of libspng with the fix. |
In the meantime, pinning to |
Same problem here on M1 Mac, fixing version to 0.29.3 helped. In my case it influences NextJS and the upload-plugin of Strapi. |
Fixing version to 0.29.3 helps on aarch64 fedora |
All versions above |
@oebilgen This issue relates only to ARM64. If you're seeing it on Intel hardware, please open a new issue and provide as much information as possible, including sample code with appropriate error handling, sample images, and ideally a backtrace of the crash. |
v0.31.0 now available with prebuilt binaries that contain the upstream fix, thanks all for reporting/helping with this. |
solves this issue which was happening in docker containers on ARM cpus (M1 mac): lovell/sharp#3225
Possible bug
Is this a possible bug in a feature of sharp, unrelated to installation?
npm install sharp
completes without error.node -e "require('sharp')"
completes without error.Are you using the latest version of sharp?
sharp
as reported bynpm view sharp dist-tags.latest
.What is the output of running
npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp
?(Oracle Cloud Infrastructure A1 instance)
What are the steps to reproduce?
Download PixelFed's favicon.png: https://pixelfed.tokyo/img/favicon.png?v=2
Load...
It throws error.
This error kills our software.
What is the expected behaviour?
No error and no killing
The text was updated successfully, but these errors were encountered: