containers / build

another build tool for container images (archived, see https://github.com/rkt/rkt/issues/4024)
Apache License 2.0
342 stars 80 forks source link

fatal error: sweep increased allocation count #264

Open jpic opened 7 years ago

jpic commented 7 years ago

Sometimes, acbuild crashes as such:

+ acbuild run -- apk update
Downloading quay.io/coreos/alpine-sh: [========================] 2.65 MB/2.65 MB
run: extracttar error: exit status 2, output: runtime: nelems=512 nfree=491 nalloc=21 previous allocCount=12 nfreed=65527
fatal error: sweep increased allocation count

runtime stack:
runtime.throw(0x882a3b, 0x20)
    /usr/lib/go/src/runtime/panic.go:566 +0x95
runtime.(*mspan).sweep(0x7f40130ba430, 0x300000000, 0xc400000001)
    /usr/lib/go/src/runtime/mgcsweep.go:287 +0x7ab
runtime.sweepone(0x4403a6)
    /usr/lib/go/src/runtime/mgcsweep.go:112 +0xfe
runtime.gosweepone.func1()
    /usr/lib/go/src/runtime/mgcsweep.go:124 +0x2b
runtime.systemstack(0xc42001f500)
    /usr/lib/go/src/runtime/asm_amd64.s:298 +0x79
runtime.mstart()
    /usr/lib/go/src/runtime/proc.go:1079

goroutine 3 [running]:
runtime.systemstack_switch()
    /usr/lib/go/src/runtime/asm_amd64.s:252 fp=0xc42002af48 sp=0xc42002af40
runtime.gosweepone(0x1)
    /usr/lib/go/src/runtime/mgcsweep.go:125 +0x4a fp=0xc42002af78 sp=0xc42002af48
runtime.bgsweep(0xc42005a000)
    /usr/lib/go/src/runtime/mgcsweep.go:66 +0xbb fp=0xc42002afb8 sp=0xc42002af78
runtime.goexit()
    /usr/lib/go/src/runtime/asm_amd64.s:2086 +0x1 fp=0xc42002afc0 sp=0xc42002afb8
created by runtime.gcenable
    /usr/lib/go/src/runtime/mgc.go:195 +0x61

goroutine 1 [runnable]:
archive/tar.(*block).GetFormat(0xc42008f6b8, 0x200)
    /usr/lib/go/src/archive/tar/format.go:67
archive/tar.(*Reader).readHeader(0xc42008f680, 0x0)
    /usr/lib/go/src/archive/tar/reader.go:560 +0x2a3
archive/tar.(*Reader).Next(0xc42008f680, 0x870465, 0x1, 0xc420354750)
    /usr/lib/go/src/archive/tar/reader.go:127 +0x9a
github.com/appc/acbuild/vendor/github.com/coreos/rkt/pkg/tar.ExtractTarInsecure(0xc42008f680, 0x870465, 0x1, 0x1, 0xc42018dbc0, 0xc42031d210, 0x0, 0x0)
    /build/acbuild/src/acbuild-0.4.0/gopath/src/github.com/appc/acbuild/vendor/github.com/coreos/rkt/pkg/tar/tar.go:84 +0xbd
github.com/appc/acbuild/vendor/github.com/coreos/rkt/pkg/tar.extractTarCommand(0x800b60, 0xc4200143f0)
    /build/acbuild/src/acbuild-0.4.0/gopath/src/github.com/appc/acbuild/vendor/github.com/coreos/rkt/pkg/tar/chroot.go:89 +0xc6f
github.com/appc/acbuild/vendor/github.com/coreos/rkt/pkg/multicall.MaybeExec()
    /build/acbuild/src/acbuild-0.4.0/gopath/src/github.com/appc/acbuild/vendor/github.com/coreos/rkt/pkg/multicall/multicall.go:68 +0xa5
main.main()
    /build/acbuild/src/acbuild-0.4.0/gopath/src/github.com/appc/acbuild/acbuild/acbuild.go:255 +0x4b

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
    /usr/lib/go/src/runtime/asm_amd64.s:2086 +0x1

Running acbuild 0.4.0-1 on arch linux.

jpic commented 7 years ago

I can reproduce it systematically with the write command:

+ acbuild write hello-0.0.1-linux-amd64.aci
runtime: nelems=256 nfree=116 nalloc=140 previous allocCount=83 nfreed=65479
fatal error: sweep increased allocation count

runtime stack:
runtime.throw(0x882a3b, 0x20)
    /usr/lib/go/src/runtime/panic.go:566 +0x95
runtime.(*mspan).sweep(0x7f2a73a4aca0, 0x2500000000, 0xc400000001)
    /usr/lib/go/src/runtime/mgcsweep.go:287 +0x7ab
runtime.sweepone(0x4403a6)
    /usr/lib/go/src/runtime/mgcsweep.go:112 +0xfe
runtime.gosweepone.func1()
    /usr/lib/go/src/runtime/mgcsweep.go:124 +0x2b
runtime.systemstack(0xa9c300)
    /usr/lib/go/src/runtime/asm_amd64.s:298 +0x79
runtime.mstart()
    /usr/lib/go/src/runtime/proc.go:1079

goroutine 3 [running]:
runtime.systemstack_switch()
    /usr/lib/go/src/runtime/asm_amd64.s:252 fp=0xc42002af48 sp=0xc42002af40
runtime.gosweepone(0x0)
    /usr/lib/go/src/runtime/mgcsweep.go:125 +0x4a fp=0xc42002af78 sp=0xc42002af48
runtime.bgsweep(0xc42005a000)
    /usr/lib/go/src/runtime/mgcsweep.go:66 +0xbb fp=0xc42002afb8 sp=0xc42002af78
runtime.goexit()
    /usr/lib/go/src/runtime/asm_amd64.s:2086 +0x1 fp=0xc42002afc0 sp=0xc42002afb8
created by runtime.gcenable
    /usr/lib/go/src/runtime/mgc.go:195 +0x61

goroutine 1 [runnable]:
compress/flate.(*compressor).findMatch(0xc420326000, 0x9e52, 0x9e11, 0x3, 0xc4a, 0x102, 0x54a4, 0x1)
    /usr/lib/go/src/compress/flate/deflate.go:229
compress/flate.(*compressor).deflate(0xc420326000)
    /usr/lib/go/src/compress/flate/deflate.go:438 +0xa0d
compress/flate.(*compressor).write(0xc420326000, 0xab9500, 0x164, 0x200, 0x200, 0xc48fc0f92d, 0x41f816)
    /usr/lib/go/src/compress/flate/deflate.go:546 +0x76
compress/flate.(*Writer).Write(0xc420326000, 0xab9500, 0x164, 0x200, 0x200, 0x8fc0f92d, 0x12f)
    /usr/lib/go/src/compress/flate/deflate.go:702 +0x4b
compress/gzip.(*Writer).Write(0xc420111ce0, 0xab9500, 0x164, 0x200, 0xc4206fae40, 0x42bf17, 0x7f2a73a15e69)
    /usr/lib/go/src/compress/gzip/gzip.go:195 +0xc9
archive/tar.(*Writer).Flush(0xc4202d2900, 0x0, 0x200000003)
    /usr/lib/go/src/archive/tar/writer.go:66 +0xa1
archive/tar.(*Writer).writeHeader(0xc4202d2900, 0xc42012aa90, 0xa9bb01, 0x14a0b3b, 0xc42012a928)
    /usr/lib/go/src/archive/tar/writer.go:147 +0xbb4
archive/tar.(*Writer).WriteHeader(0xc4202d2900, 0xc42012aa90, 0xc42012a8f0, 0xc4202df500)
    /usr/lib/go/src/archive/tar/writer.go:134 +0x3a
github.com/appc/acbuild/vendor/github.com/appc/spec/aci.(*imageArchiveWriter).AddFile(0xc4202dd680, 0xc42012aa90, 0xa71c00, 0xc42002e020, 0xc42012aa90, 0x0)
    /build/acbuild/src/acbuild-0.4.0/gopath/src/github.com/appc/acbuild/vendor/github.com/appc/spec/aci/writer.go:52 +0x3c
github.com/appc/acbuild/vendor/github.com/appc/spec/aci.BuildWalker.func1(0xc42010c370, 0x45, 0xa78920, 0xc42012a8f0, 0x0, 0x0, 0x0, 0x0)
    /build/acbuild/src/acbuild-0.4.0/gopath/src/github.com/appc/acbuild/vendor/github.com/appc/spec/aci/build.go:104 +0x252
path/filepath.walk(0xc42010c370, 0x45, 0xa78920, 0xc42012a8f0, 0xc4202db700, 0x0, 0x0)
    /usr/lib/go/src/path/filepath/path.go:351 +0x81
path/filepath.walk(0xc4204b2ac0, 0x36, 0xa78920, 0xc42012b520, 0xc4202db700, 0x0, 0x0)
    /usr/lib/go/src/path/filepath/path.go:376 +0x344
path/filepath.walk(0xc4202deea0, 0x2c, 0xa78920, 0xc4204b0750, 0xc4202db700, 0x0, 0x0)
    /usr/lib/go/src/path/filepath/path.go:376 +0x344
path/filepath.walk(0xc4201fff50, 0x22, 0xa78920, 0xc42044b930, 0xc4202db700, 0x0, 0x0)
    /usr/lib/go/src/path/filepath/path.go:376 +0x344
path/filepath.walk(0xc420281500, 0x1e, 0xa78920, 0xc42028d110, 0xc4202db700, 0x0, 0x0)
    /usr/lib/go/src/path/filepath/path.go:376 +0x344
path/filepath.walk(0xc420318ca0, 0x1a, 0xa78920, 0xc4203240d0, 0xc4202db700, 0x0, 0x0)
    /usr/lib/go/src/path/filepath/path.go:376 +0x344
path/filepath.walk(0xc420281320, 0x13, 0xa78920, 0xc42012bee0, 0xc4202db700, 0x0, 0xc4202df500)
    /usr/lib/go/src/path/filepath/path.go:376 +0x344
path/filepath.Walk(0xc420281320, 0x13, 0xc4202db700, 0xc4202dd680, 0x0)
    /usr/lib/go/src/path/filepath/path.go:398 +0xd5
github.com/appc/acbuild/lib.(*ACBuild).Write(0xc4202a0680, 0x7ffcf330a308, 0x1b, 0x0, 0xc4202dc240, 0x0, 0x0, 0x0, 0x0)
    /build/acbuild/src/acbuild-0.4.0/gopath/src/github.com/appc/acbuild/lib/write.go:95 +0x420
main.runWrite(0xa98080, 0xc4202dc240, 0x1, 0x1, 0x5)
    /build/acbuild/src/acbuild-0.4.0/gopath/src/github.com/appc/acbuild/acbuild/write.go:50 +0xd8
main.runWrapper.func1(0xa98080, 0xc4202dc240, 0x1, 0x1)
    /build/acbuild/src/acbuild-0.4.0/gopath/src/github.com/appc/acbuild/acbuild/acbuild.go:131 +0x86
github.com/appc/acbuild/vendor/github.com/spf13/cobra.(*Command).execute(0xa98080, 0xc4202dc1e0, 0x1, 0x1, 0xa98080, 0xc4202dc1e0)
    /build/acbuild/src/acbuild-0.4.0/gopath/src/github.com/appc/acbuild/vendor/github.com/spf13/cobra/command.go:565 +0x411
github.com/appc/acbuild/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xa93280, 0x0, 0x0, 0x0)
    /build/acbuild/src/acbuild-0.4.0/gopath/src/github.com/appc/acbuild/vendor/github.com/spf13/cobra/command.go:651 +0x367
github.com/appc/acbuild/vendor/github.com/spf13/cobra.(*Command).Execute(0xa93280, 0xe, 0x8b0360)
    /build/acbuild/src/acbuild-0.4.0/gopath/src/github.com/appc/acbuild/vendor/github.com/spf13/cobra/command.go:610 +0x2b
main.main()
    /build/acbuild/src/acbuild-0.4.0/gopath/src/github.com/appc/acbuild/acbuild/acbuild.go:268 +0xbc

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
    /usr/lib/go/src/runtime/asm_amd64.s:2086 +0x1
sanmai-NL commented 7 years ago

Can you please list all your system properties, then test again with a current version of acbuild?