genuinetools / img

Standalone, daemon-less, unprivileged Dockerfile and OCI compatible container image builder.
https://blog.jessfraz.com/post/building-container-images-securely-on-kubernetes/
MIT License
3.89k stars 230 forks source link

img 0.5.7 : "save" crash where img 0.5.6 works fine #250

Open lefebsy opened 5 years ago

lefebsy commented 5 years ago

Command : img save --format oci -o image-app.tar image-app:latest Img version : 0.5.7 Env : Kubernetes (tested OK with img downgraded to 0.5.6...)

Stacktrace : ...

10 exporting to image

10 digest: sha256:8ae30bf09f07a47bf8c8077bc0d424ce30aa5e28180e6048061eb1faaa1533b0

10 name: "exporting to image"

10 started: 2019-07-15 12:02:13.5138002 +0000 UTC m=+115.003825193

10 exporting layers

fatal error: unexpected signal during runtime execution [signal SIGSEGV: segmentation violation code=0x1 addr=0xe5 pc=0x7fd83c5f2638]

runtime stack: runtime.throw(0xfa127f, 0x2a) /home/travis/.gimme/versions/go1.11.10.linux.amd64/src/runtime/panic.go:608 +0x72 runtime.sigpanic() /home/travis/.gimme/versions/go1.11.10.linux.amd64/src/runtime/signal_unix.go:374 +0x2f2

goroutine 14505 [syscall]: runtime.cgocall(0xc9d980, 0xc0014257d8, 0x29) /home/travis/.gimme/versions/go1.11.10.linux.amd64/src/runtime/cgocall.go:128 +0x5e fp=0xc0014257a0 sp=0xc001425768 pc=0x4039ee os/user._Cfunc_mygetgrgid_r(0x2b, 0xc0005b77a0, 0x7fd8180008c0, 0x400, 0xc0000c4750, 0xc000000000)

issue-label-bot[bot] commented 5 years ago

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.93. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

SJrX commented 5 years ago

I also am having this (or a similar issue), I haven't checked whether downgrading helps yet but I'm running as a host: Linux 5.1.15-arch1-1-ARCH #1 SMP PREEMPT Tue Jun 25 04:49:39 UTC 2019 x86_64 GNU/Linux

If I build this file:

#
# Super simple example of a Dockerfile
#
FROM ubuntu:latest
MAINTAINER Andrew Odewahn "odewahn@oreilly.com"

RUN apt-get update
RUN apt-get install -y python python-pip wget
RUN pip install Flask

ADD hello.py /home/hello.py

WORKDIR /home

With this command:

img build --tag=friendlyhello --no-console --no-cache -s /tmp . 2>&1

I get:

...
fatal error: unexpected signal during runtime execution
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0xe5 pc=0x7f06280ab6d8]

runtime stack:
runtime.throw(0xfa127f, 0x2a)
        /home/travis/.gimme/versions/go1.11.10.linux.amd64/src/runtime/panic.go:608 +0x72
runtime.sigpanic()
        /home/travis/.gimme/versions/go1.11.10.linux.amd64/src/runtime/signal_unix.go:374 +0x2f2

goroutine 2927 [syscall]:
runtime.cgocall(0xc9d980, 0xc0008b37d8, 0x29)
        /home/travis/.gimme/versions/go1.11.10.linux.amd64/src/runtime/cgocall.go:128 +0x5e fp=0xc0008b37a0 sp=0xc0008b3768 pc=0x4039ee
os/user._Cfunc_mygetgrgid_r(0x0, 0xc000492140, 0x7f05ec0008c0, 0x400, 0xc0006185c8, 0xc000000000)
        _cgo_gotypes.go:106 +0x4d fp=0xc0008b37d8 sp=0xc0008b37a0 pc=0x4f419d
os/user.lookupUnixGid.func1.1(0x0, 0xc000492140, 0x7f05ec0008c0, 0x400, 0xc0006185c8, 0xc0008b3870)
        /home/travis/.gimme/versions/go1.11.10.linux.amd64/src/os/user/cgo_lookup_unix.go:181 +0x135 fp=0xc0008b3818 sp=0xc0008b37d8 pc=0x4f6105
os/user.lookupUnixGid.func1(0xe9c960)
        /home/travis/.gimme/versions/go1.11.10.linux.amd64/src/os/user/cgo_lookup_unix.go:181 +0x50 fp=0xc0008b3858 sp=0xc0008b3818 pc=0x4f61a0
os/user.retryWithBuffer(0xc00028e580, 0xc0008b3940, 0xc00028e580, 0xc0008b38e8)
        /home/travis/.gimme/versions/go1.11.10.linux.amd64/src/os/user/cgo_lookup_unix.go:253 +0x3e fp=0xc0008b38b0 sp=0xc0008b3858 pc=0x4f53fe
os/user.lookupUnixGid(0x0, 0x0, 0x0, 0x0)
        /home/travis/.gimme/versions/go1.11.10.linux.amd64/src/os/user/cgo_lookup_unix.go:177 +0x130 fp=0xc0008b3978 sp=0xc0008b38b0 pc=0x4f4f00
os/user.lookupGroupId(0xf9acfe, 0x1, 0xa, 0xf9acfe, 0x1)
        /home/travis/.gimme/versions/go1.11.10.linux.amd64/src/os/user/cgo_lookup_unix.go:167 +0x73 fp=0xc0008b39b0 sp=0xc0008b3978 pc=0x4f4d93
os/user.LookupGroupId(0xf9acfe, 0x1, 0x1, 0x0, 0x0)
        /home/travis/.gimme/versions/go1.11.10.linux.amd64/src/os/user/lookup.go:53 +0x35 fp=0xc0008b39e8 sp=0xc0008b39b0 pc=0x4f3e75
archive/tar.statUnix(0x10890a0, 0xc00085a340, 0xc0006901c0, 0x1ceb620, 0x0)
        /home/travis/.gimme/versions/go1.11.10.linux.amd64/src/archive/tar/stat_unix.go:45 +0x379 fp=0xc0008b3a58 sp=0xc0008b39e8 pc=0x4ff9c9
archive/tar.FileInfoHeader(0x10890a0, 0xc00085a340, 0x0, 0x0, 0x2a, 0x0, 0x0)
        /home/travis/.gimme/versions/go1.11.10.linux.amd64/src/archive/tar/common.go:702 +0x454 fp=0xc0008b3bd8 sp=0xc0008b3a58 pc=0x4f9004
github.com/genuinetools/img/vendor/github.com/containerd/containerd/archive.(*changeWriter).HandleChange(0xc0007506e0, 0x0, 0xc0000feb40, 0xc, 0x10890a0, 0xc00085a340, 0x0, 0x0, 0x0, 0x0)
        /home/travis/gopath/src/github.com/genuinetools/img/vendor/github.com/containerd/containerd/archive/tar.go:489 +0x47e fp=0xc0008b3e28 sp=0xc0008b3bd8 pc=0xb82c5e
github.com/genuinetools/img/vendor/github.com/containerd/containerd/archive.(*changeWriter).HandleChange-fm(0x0, 0xc0000feb40, 0xc, 0x10890a0, 0xc00085a340, 0x0, 0x0, 0xc0003b01e0, 0x0)
        /home/travis/gopath/src/github.com/genuinetools/img/vendor/github.com/containerd/containerd/archive/tar.go:76 +0x7d fp=0xc0008b3e88 sp=0xc0008b3e28 pc=0xb8559d
github.com/genuinetools/img/vendor/github.com/containerd/continuity/fs.doubleWalkDiff.func3(0x8, 0xfbf508)
        /home/travis/gopath/src/github.com/genuinetools/img/vendor/github.com/containerd/continuity/fs/diff.go:318 +0x217 fp=0xc0008b3f88 sp=0xc0008b3e88 pc=0x5e55a7
github.com/genuinetools/img/vendor/golang.org/x/sync/errgroup.(*Group).Go.func1(0xc0003bfef0, 0xc000750780)
        /home/travis/gopath/src/github.com/genuinetools/img/vendor/golang.org/x/sync/errgroup/errgroup.go:58 +0x57 fp=0xc0008b3fd0 sp=0xc0008b3f88 pc=0x5df957
runtime.goexit()
        /home/travis/.gimme/versions/go1.11.10.linux.amd64/src/runtime/asm_amd64.s:1333 +0x1 fp=0xc0008b3fd8 sp=0xc0008b3fd0 pc=0x459571
created by github.com/genuinetools/img/vendor/golang.org/x/sync/errgroup.(*Group).Go
        /home/travis/gopath/src/github.com/genuinetools/img/vendor/golang.org/x/sync/errgroup/errgroup.go:55 +0x66

Also FYI, I am installing the binary from the releases page into an Ubuntu 18.04 container.

SJrX commented 5 years ago

Downgrading to 0.5.6 does fix it for me as well.

sh0rez commented 5 years ago

It looks like the current master (https://github.com/genuinetools/img/commit/5a8119fb4ce7d712ca2ed589a345213fdf576268) works fine as well.

It would be great if it could be tagged, to avoid having to install from source