Imagick architecture mismatch (x86_64 vs aarch64) on official arm64 image causes Apache segfaults
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 7.4k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
Description
Running the official nextcloud:34.0.4-apache image on an ARM64 host, I'm experiencing intermittent
Apache child process segfaults. The container recovers only after a full restart.
Suspected root cause
php -i shows a mismatch between the architecture the Imagick extension reports as
"compiled with" versus the ImageMagick library it's actually loading at runtime:
/usr/local/etc/php/conf.d/docker-php-ext-imagick.ini,
imagick
imagick module => enabled
imagick module version => 3.8.1
imagick classes => Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel
Imagick compiled with ImageMagick version => ImageMagick 7.1.1-43 Q16 x86_64 22550 https://imagemagick.org
Imagick using ImageMagick library version => ImageMagick 7.1.1-43 Q16 aarch64 22550 https://imagemagick.org
This looks like a mismatch introduced during the multi-arch build pipeline (possibly a
$BUILDPLATFORM vs $TARGETPLATFORM confusion in a multi-stage Dockerfile build), where a
build-time string/header from an x86_64 build stage ends up embedded in the arm64 image,
while the actual shared library is correctly built for aarch64.
Environment
- Nextcloud image tag:
nextcloud:34.0.4-apache - Host: QNAP TS-435XeU NAS (ARM64, Marvell/Annapurna Labs Cortex-A72)
- Docker via QNAP Container Station
docker exec -it <container> php -moutput includesimagick(module version 3.8.1)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the report with php -i and php -m in the nextcloud:34.0.4-apache arm64 image, checking the Imagick and ImageMagick architecture values. Then inspect the multi-stage Dockerfile build around $BUILDPLATFORM and $TARGETPLATFORM; done means the arm64 image no longer reports an x86_64 Imagick build and the Apache segfault issue is addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, php
- Domain
- build-system, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100