tar: using "--no-overwrite-dir" aborts with a core dump
It would appear that the latest update to the tar
package
(https://github.com/alpinelinux/aports/pull/5967 /
https://github.com/alpinelinux/aports/commit/0119db774c8cbd96f7d4d966f9fa9c2f788f223a
?) has introduced a regression in —no-overwrite-dir
:
$ docker run -it --rm alpine:3.9
/ # apk add --no-cache tar
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz
(1/1) Installing tar (1.31-r0)
Executing busybox-1.29.3-r10.trigger
OK: 6 MiB in 15 packages
/ # tar -cC /tmp . | tar -xC /run/ --no-overwrite-dir
Aborted (core dumped)
$ docker run -it --rm alpine:3.8
/ # apk add --no-cache tar
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
(1/1) Installing tar (1.31-r0)
Executing busybox-1.28.4-r3.trigger
OK: 5 MiB in 14 packages
/ # tar -cC /tmp . | tar -xC /run/ --no-overwrite-dir
Aborted (core dumped)
$ docker run -it --rm alpine:3.7
/ # apk add --no-cache tar
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
(1/1) Installing tar (1.31-r0)
Executing busybox-1.27.2-r11.trigger
OK: 5 MiB in 14 packages
/ # tar -cC /tmp . | tar -xC /run/ --no-overwrite-dir
Aborted (core dumped)
$ docker run -it --rm alpine:3.6
/ # apk add --no-cache tar
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/community/x86_64/APKINDEX.tar.gz
(1/1) Installing tar (1.31-r0)
Executing busybox-1.26.2-r11.trigger
OK: 4 MiB in 14 packages
/ # tar -cC /tmp . | tar -xC /run/ --no-overwrite-dir
Aborted (core dumped)
$ docker run -it --rm alpine:edge
/ # apk add --no-cache tar
fetch http://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
(1/1) Installing tar (1.31-r0)
Executing busybox-1.29.3-r4.trigger
OK: 6 MiB in 14 packages
/ # tar -cC /tmp . | tar -xC /run/ --no-overwrite-dir
Aborted (core dumped)
I had to go all the way back to Alpine 3.5 (in other words, it affects
3.6, 3.7, 3.8, 3.9, and Edge) to get a tar
version that
wasn’t 1.31-r0
and thus worked as expected:
$ docker run -it --rm alpine:3.5
/ # apk add --no-cache tar
fetch http://dl-cdn.alpinelinux.org/alpine/v3.5/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.5/community/x86_64/APKINDEX.tar.gz
(1/1) Installing tar (1.29-r1)
Executing busybox-1.25.1-r2.trigger
OK: 4 MiB in 12 packages
/ # tar -cC /tmp . | tar -xC /run/ --no-overwrite-dir
/ #
(See https://github.com/docker-library/wordpress/issues/372 for where this bug was originally discovered.)
(from redmine: issue id 10027, created on 2019-02-22, closed on 2019-03-05)
- Changesets:
- Revision e14f3077 on 2019-02-25T10:29:04Z:
main/tar: upgrade to 1.32
ref #10027
- Revision 2f83e667 on 2019-02-25T10:36:32Z:
main/tar: upgrade to 1.32
ref #10027
(cherry picked from commit e14f30776ab55c428f268da628c29a97fe8885af)
- Revision cc8d915c on 2019-02-25T10:45:22Z:
main/tar: upgrade to 1.32
ref #10027
(cherry picked from commit e14f30776ab55c428f268da628c29a97fe8885af)
- Revision 440aca84 on 2019-02-25T10:51:47Z:
main/tar: upgrade to 1.32
ref #10027
(cherry picked from commit e14f30776ab55c428f268da628c29a97fe8885af)
- Revision 5a35683a on 2019-02-25T10:52:30Z:
main/tar: upgrade to 1.32
fixes #10027
(cherry picked from commit e14f30776ab55c428f268da628c29a97fe8885af)