Skip to content

Imagick architecture mismatch (x86_64 vs aarch64) on official arm64 image causes Apache segfaults #2599

Description

@rsmnet

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 -m output includes imagick (module version 3.8.1)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions