segmentation fault in apk.static at 2.6.7 blocks build on aarch64
On ARMv8 (aarch64) the “apk.static” binary at 2.6.7 crashes with a “segmentation fault” when you attempt to build a Docker image for it from the script at https://github.com/docker/docker/blob/master/contrib/mkimage-alpine.sh . This makes it impossible to build the aarch64/alpine Docker image. Replicate by getting Docker source, then running the “contrib/mkimage-alpine.sh” script.
root@armv8hello:/var/tmp/alpine-docker-y2oEFmD4Ye/sbin# ./apk.static
—version
apk-tools 2.6.7, compiled for aarch64.
I’m not sure precisely how the apk.static binary is being called, and I haven’t been able to isolate a minimum repeat of this. Noting however that the http://git.alpinelinux.org/cgit/apk-tools repository has an update after 2.6.7 that is specific to aarch64 which might possibly be related (it’s at http://git.alpinelinux.org/cgit/apk-tools/commit/?id=06ae5fdfdccd0c8e6d5501d93666bd915d2604d1 ).
I can provide access to an ARMv8 system to replicate this.
Transcript:
emv@armv8hello:~/src/docker/contrib$ sudo ./mkimage-alpine.sh
tar: Ignoring unknown extended header keyword
‘APK-TOOLS.checksum.SHA1’
tar: Ignoring unknown extended header keyword
‘APK-TOOLS.checksum.SHA1’
fetch
http://nl.alpinelinux.org/alpine/edge/main/aarch64/APKINDEX.tar.gz
(1/16) Installing musl (1.1.15-r4)
(2/16) Installing busybox (1.25.1-r0)
Executing busybox-1.25.1-r0.post-install
(3/16) Installing alpine-baselayout (3.0.3-r2)
Executing alpine-baselayout-3.0.3-r2.pre-install
Executing alpine-baselayout-3.0.3-r2.post-install
(4/16) Installing openrc (0.21.7-r1)
Executing openrc-0.21.7-r1.post-install
(5/16) Installing alpine-conf (3.4.1-r5)
(6/16) Installing libressl2.4-libcrypto (2.4.3-r1)
(7/16) Installing libressl2.4-libssl (2.4.3-r1)
(8/16) Installing zlib (1.2.8-r2)
(9/16) Installing apk-tools (2.6.7-r2)
(10/16) Installing busybox-suid (1.25.1-r0)
(11/16) Installing busybox-initscripts (3.0-r6)
Executing busybox-initscripts-3.0-r6.post-install
(12/16) Installing scanelf (1.1.6-r0)
(13/16) Installing musl-utils (1.1.15-r4)
(14/16) Installing libc-utils (0.7-r1)
(15/16) Installing alpine-keys (1.2-r0)
(16/16) Installing alpine-base (3.4.0-r0)
Executing busybox-1.25.1-r0.trigger
OK: 5 MiB in 16 packages
Segmentation fault
(from redmine: issue id 6372, created on 2016-10-21, closed on 2017-05-22)
- Changesets:
- Revision c9e1d3182f84e917a20d1836b163082455a8eb6b by Timo Teräs on 2016-10-25T17:51:24Z:
main/gcc: add ld -Bsymbolic for static pie linking
ref #6372
- Revision 6ae8e4414d963c8812c86c2eb0d26c2434a93bec by Timo Teräs on 2016-10-25T19:16:33Z:
main/apk-tools: rebuild with fixed gcc
fixes #6372