docker icon indicating copy to clipboard operation
docker copied to clipboard

Add support for 32k page size (ARM?) to avoid `ELF load command address/offset not page-aligned`

Open DJManas opened this issue 9 months ago • 6 comments

Hello,

recently QNAP container station switched to 32k page size from 4k and since then I am having problem with update (last working image, that I had tried is NextCloud 26.0.1, tried to update to 26.0.7 and since then I am having problem starting the container up (no matter if its apache, fpm, etc.). I am getting messages like:

/bin/sh: error while loading shared libraries: libc.so.6: ELF load command address/offset not page-aligned

And the container is still restarting. I had searched the internet and it seems that its related to change to 32k page size. I am not sure if i am able to change it back to 4k though (official QNAP support help is... I don't want to be rude).

Is it possible to make images compatible to 32k, maybee backwards compatible, since I want to upgrade from 26.0.1 to latest release (which is I gues to 26.0.7 and then do 27.0.0 and then to latest).

Thanks, Regards, Petr Sourek

DJManas avatar Oct 03 '23 10:10 DJManas

https://www.qnap.com/da-dk/how-to/faq/article/why-do-the-installed-third-party-containers-not-run-successfully-on-specific-32-bit-arm-devices

This will likely need to be fixed upstream (either the official community PHP Docker image or the Debian one), but I'm honestly not sure. Someone needs to do the leg work to research this matter more, including not only a possible fix for this situation, but a path that makes sure it doesn't break things for others.

I think it's ARM specific.

joshtrichards avatar Oct 03 '23 15:10 joshtrichards

I was looking to see how other Official Docker Library images have dealt with this and I found:

  • https://github.com/docker-library/busybox/issues/149#issuecomment-1288495600
  • https://github.com/docker-library/busybox/pull/150/files

Though from general searches (i.e. outside Docker Library images) I'm surprised this hasn't come up a bit more often with the Official ones. :thinking:

joshtrichards avatar Nov 05 '23 14:11 joshtrichards

Some related posts...

https://gitlab.alpinelinux.org/alpine/aports/-/issues/15167

https://github.com/home-assistant/core/issues/86589#

Wetzel402 avatar Nov 29 '23 18:11 Wetzel402

Also i try experiment in emulation on x86 like this. And get different strange things Alpine Linux 3.18.0 under emulation page size 32k work but give me page size 4K

getconf PAGESIZE
4096

Alpine Linux 3.17.0 under emulation page size 32k give me "bin/sh: getconf: Bad address" on any commands.

And backward on QNAP with pagesize 32K container Alpine Linux 3.17.0 work without problem and Alpine Linux 3.18.0 didnt work at all.

sudo apt-get install qemu binfmt-support qemu-user-static
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
for 32K PAGE SIZE
docker run -e "QEMU_CPU=cortex-a15" -e "QEMU_PAGESIZE=32768" --rm --platform linux/arm/v7 -it alpine:3.17.0 /bin/sh
docker run -e "QEMU_CPU=cortex-a15" -e "QEMU_PAGESIZE=32768" --rm --platform linux/arm/v7 -it alpine:3.18.0 /bin/sh

for 4K PAGE SIZE
docker run -e "QEMU_CPU=cortex-a15" -e "QEMU_PAGESIZE=4096" --rm --platform linux/arm/v7 -it alpine:3.17.0 /bin/sh
docker run -e "QEMU_CPU=cortex-a15" -e "QEMU_PAGESIZE=4096" --rm --platform linux/arm/v7 -it alpine:3.18.0 /bin/sh

magicse avatar Apr 06 '24 13:04 magicse