concourse: fly is segfaulting

Bug Report

Hi there! I’m using fly version 5.4.0 and it’s crashing with a segfault. This previously worked find in fly 5.3.0 and many other previous versions of fly.

Steps to Reproduce

I’m running the command:

fly -t ci execute --input=ci=. --input=nokogiri=. -l 'concourse/private.yml' -c /tmp/concourse-task20190720-14274-19n1dgl

where the tempfile contents are:

platform: linux
image_resource:
  type: docker-image
  source:
    repository: flavorjones/nokogiri-test
    tag: mri-2.6
inputs:
- name: ci
- name: nokogiri
params:
  NOKOGIRI_USE_SYSTEM_LIBRARIES: t
  CC_TEST_REPORTER_ID: "((code_climate_reporter_id_nokogiri))"
  GIT_BRANCH: master
run:
  path: ci/concourse/tasks/rake-test/run.sh

and the CWD is commit 6c6a8a7 on https//github.com/sparklemotion/nokogiri

Expected Results

With previous versions, (<= 5.3.0) I’d see the CWD get uploaded twice (see multiple --input parameters) and then used appropriately to run the job

Actual Results

Segfault!

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

runtime stack:
runtime.throw(0xc0e736, 0x2a)
	/usr/local/go/src/runtime/panic.go:617 +0x72
runtime.sigpanic()
	/usr/local/go/src/runtime/signal_unix.go:374 +0x4a9

goroutine 63 [syscall]:
runtime.cgocall(0x973db0, 0xc00058b5e0, 0xc0002ac218)
	/usr/local/go/src/runtime/cgocall.go:128 +0x5b fp=0xc00058b5b0 sp=0xc00058b578 pc=0x40776b
net._C2func_getaddrinfo(0xc0004139f0, 0x0, 0xc000154360, 0xc0002ac218, 0x0, 0x0, 0x0)
	_cgo_gotypes.go:92 +0x55 fp=0xc00058b5e0 sp=0xc00058b5b0 pc=0x52ad85
net.cgoLookupIPCNAME.func1(0xc0004139f0, 0x10, 0x10, 0xc000154360, 0xc0002ac218, 0xf, 0x42f68f, 0xc000000008)
	/usr/local/go/src/net/cgo_unix.go:154 +0x13e fp=0xc00058b628 sp=0xc00058b5e0 pc=0x5305be
net.cgoLookupIPCNAME(0xbf112e, 0x3, 0xc0004ea500, 0xf, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/usr/local/go/src/net/cgo_unix.go:154 +0x176 fp=0xc00058b718 sp=0xc00058b628 pc=0x52c256
net.cgoIPLookup(0xc0004d4a80, 0xbf112e, 0x3, 0xc0004ea500, 0xf)
	/usr/local/go/src/net/cgo_unix.go:206 +0x67 fp=0xc00058b7b8 sp=0xc00058b718 pc=0x52c947
runtime.goexit()
	/usr/local/go/src/runtime/asm_amd64.s:1337 +0x1 fp=0xc00058b7c0 sp=0xc00058b7b8 pc=0x45d121
created by net.cgoLookupIP
	/usr/local/go/src/net/cgo_unix.go:216 +0xc7

goroutine 1 [semacquire]:
sync.runtime_Semacquire(0xc000412a88)
	/usr/local/go/src/runtime/sema.go:56 +0x39
sync.(*WaitGroup).Wait(0xc000412a80)
	/usr/local/go/src/sync/waitgroup.go:130 +0x65
github.com/vbauerster/mpb/v4.(*Progress).Wait(0xc0000859e0)
	/tmp/build/8885cc21/gopath/pkg/mod/github.com/vbauerster/mpb/v4@v4.6.1-0.20190319154207-3a6acfe12ac6/progress.go:200 +0x3c
github.com/concourse/concourse/fly/ui/progress.(*Progress).Wait(0xc0003d6420, 0xc00030d860, 0x12)
	/tmp/build/8885cc21/concourse/fly/ui/progress/progress.go:57 +0x2e
github.com/concourse/concourse/fly/commands/internal/executehelpers.GenerateLocalInputs(0xc000412a48, 0xcf94c0, 0xc0003e6cc0, 0xc00003b180, 0x2, 0x2, 0x0, 0xc0004128e8, 0x5, 0x0, ...)
	/tmp/build/8885cc21/concourse/fly/commands/internal/executehelpers/inputs.go:166 +0x23a
github.com/concourse/concourse/fly/commands/internal/executehelpers.DetermineInputs(0xc000412a48, 0xcf94c0, 0xc0003e6cc0, 0xc00057e190, 0x2, 0x2, 0xc00003b180, 0x2, 0x2, 0x0, ...)
	/tmp/build/8885cc21/concourse/fly/commands/internal/executehelpers/inputs.go:59 +0x1b0
github.com/concourse/concourse/fly/commands.(*ExecuteCommand).Execute(0x13fbcc0, 0xc0002107e0, 0x0, 0x9, 0x13fbcc0, 0x1)
	/tmp/build/8885cc21/concourse/fly/commands/execute.go:59 +0x294
github.com/jessevdk/go-flags.(*Parser).ParseArgs(0xc000084e40, 0xc0000200b0, 0x9, 0x9, 0x40a06f, 0xc0000321d8, 0x0, 0x0, 0x96eb91)
	/tmp/build/8885cc21/gopath/pkg/mod/github.com/jessevdk/go-flags@v1.4.0/parser.go:316 +0x8ce
github.com/jessevdk/go-flags.(*Parser).Parse(...)
	/tmp/build/8885cc21/gopath/pkg/mod/github.com/jessevdk/go-flags@v1.4.0/parser.go:186
main.main()
	/tmp/build/8885cc21/concourse/fly/main.go:24 +0x148

goroutine 5 [syscall]:
os/signal.signal_recv(0x0)
	/usr/local/go/src/runtime/sigqueue.go:139 +0x9c
os/signal.loop()
	/usr/local/go/src/os/signal/signal_unix.go:23 +0x22
created by os/signal.init.0
	/usr/local/go/src/os/signal/signal_unix.go:29 +0x41

goroutine 13 [IO wait]:
internal/poll.runtime_pollWait(0x7f1250145108, 0x72, 0xffffffffffffffff)
	/usr/local/go/src/runtime/netpoll.go:182 +0x56
internal/poll.(*pollDesc).wait(0xc0001d1b98, 0x72, 0xe00, 0xe40, 0xffffffffffffffff)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:87 +0x9b
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Read(0xc0001d1b80, 0xc00027c000, 0xe40, 0xe40, 0x0, 0x0, 0x0)
	/usr/local/go/src/internal/poll/fd_unix.go:169 +0x19b
net.(*netFD).Read(0xc0001d1b80, 0xc00027c000, 0xe40, 0xe40, 0x203000, 0x0, 0xc000000030)
	/usr/local/go/src/net/fd_unix.go:202 +0x4f
net.(*conn).Read(0xc000248000, 0xc00027c000, 0xe40, 0xe40, 0x0, 0x0, 0x0)
	/usr/local/go/src/net/net.go:177 +0x69
crypto/tls.(*atLeastReader).Read(0xc0003e6100, 0xc00027c000, 0xe40, 0xe40, 0x3, 0xa, 0xc00006a938)
	/usr/local/go/src/crypto/tls/conn.go:761 +0x60
bytes.(*Buffer).ReadFrom(0xc00008e958, 0xcd83c0, 0xc0003e6100, 0x40e265, 0xb50a60, 0xbd3860)
	/usr/local/go/src/bytes/buffer.go:207 +0xbd
crypto/tls.(*Conn).readFromUntil(0xc00008e700, 0xcd8d60, 0xc000248000, 0x5, 0xc000248000, 0x203000)
	/usr/local/go/src/crypto/tls/conn.go:783 +0xf8
crypto/tls.(*Conn).readRecordOrCCS(0xc00008e700, 0xc22500, 0xc00008e838, 0xc00006ab88)
	/usr/local/go/src/crypto/tls/conn.go:590 +0x125
crypto/tls.(*Conn).readRecord(...)
	/usr/local/go/src/crypto/tls/conn.go:558
crypto/tls.(*Conn).Read(0xc00008e700, 0xc000132000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
	/usr/local/go/src/crypto/tls/conn.go:1236 +0x137
net/http.(*persistConn).Read(0xc0000b90e0, 0xc000132000, 0x1000, 0x1000, 0xc00006ac88, 0x409605, 0xc000290000)
	/usr/local/go/src/net/http/transport.go:1524 +0x7b
bufio.(*Reader).fill(0xc000245620)
	/usr/local/go/src/bufio/bufio.go:100 +0x10f
bufio.(*Reader).Peek(0xc000245620, 0x1, 0x0, 0x0, 0x1, 0xc000033200, 0x0)
	/usr/local/go/src/bufio/bufio.go:138 +0x4f
net/http.(*persistConn).readLoop(0xc0000b90e0)
	/usr/local/go/src/net/http/transport.go:1677 +0x1a3
created by net/http.(*Transport).dialConn
	/usr/local/go/src/net/http/transport.go:1357 +0xae8

goroutine 14 [select]:
io.(*pipe).Read(0xc00057e500, 0xc0004ec000, 0x8000, 0x8000, 0x10, 0x7f1250147738, 0xc00040dbf0)
	/usr/local/go/src/io/pipe.go:50 +0xe7
io.(*PipeReader).Read(0xc0002ac1a8, 0xc0004ec000, 0x8000, 0x8000, 0x101000000b50bc0, 0x0, 0x8000)
	/usr/local/go/src/io/pipe.go:127 +0x4c
github.com/vbauerster/mpb/v4.(*proxyReader).Read(0xc0001abb30, 0xc0004ec000, 0x8000, 0x8000, 0xc00040dc20, 0x4462bc, 0x8000)
	/tmp/build/8885cc21/gopath/pkg/mod/github.com/vbauerster/mpb/v4@v4.6.1-0.20190319154207-3a6acfe12ac6/proxyreader.go:16 +0x58
net/http.transferBodyReader.Read(0xc000420000, 0xc0004ec000, 0x8000, 0x8000, 0x0, 0x7f123b77f300, 0x18)
	/usr/local/go/src/net/http/transfer.go:62 +0x56
io.copyBuffer(0x7f123b77f398, 0xc0003d68d0, 0xcda3c0, 0xc000420000, 0xc0004ec000, 0x8000, 0x8000, 0xc00008e8d8, 0xc00008e8c8, 0xc00040dd38)
	/usr/local/go/src/io/io.go:402 +0x122
io.Copy(...)
	/usr/local/go/src/io/io.go:364
net/http.(*transferWriter).writeBody(0xc000420000, 0xcd8260, 0xc000284400, 0x2, 0x2)
	/usr/local/go/src/net/http/transfer.go:358 +0x16b
net/http.(*Request).write(0xc00015b000, 0xcd8260, 0xc000284400, 0x0, 0xc000154000, 0x0, 0x0, 0x0)
	/usr/local/go/src/net/http/request.go:655 +0x721
net/http.(*persistConn).writeLoop(0xc0000b90e0)
	/usr/local/go/src/net/http/transport.go:1979 +0x1b8
created by net/http.(*Transport).dialConn
	/usr/local/go/src/net/http/transport.go:1358 +0xb0d

goroutine 50 [select]:
github.com/vbauerster/mpb/v4.(*Progress).serve(0xc0000859e0, 0xc000210ea0, 0xc00057e230)
	/tmp/build/8885cc21/gopath/pkg/mod/github.com/vbauerster/mpb/v4@v4.6.1-0.20190319154207-3a6acfe12ac6/progress.go:221 +0x17c
created by github.com/vbauerster/mpb/v4.NewWithContext
	/tmp/build/8885cc21/gopath/pkg/mod/github.com/vbauerster/mpb/v4@v4.6.1-0.20190319154207-3a6acfe12ac6/progress.go:94 +0x3b8

goroutine 52 [select]:
github.com/vbauerster/mpb/v4.fanInRefreshSrc.func1(0xc0002901e0)
	/tmp/build/8885cc21/gopath/pkg/mod/github.com/vbauerster/mpb/v4@v4.6.1-0.20190319154207-3a6acfe12ac6/progress.go:346 +0x101
created by github.com/vbauerster/mpb/v4.fanInRefreshSrc
	/tmp/build/8885cc21/gopath/pkg/mod/github.com/vbauerster/mpb/v4@v4.6.1-0.20190319154207-3a6acfe12ac6/progress.go:361 +0xea

goroutine 53 [select]:
github.com/vbauerster/mpb/v4.fanInRefreshSrc.func1(0xc000085aa0)
	/tmp/build/8885cc21/gopath/pkg/mod/github.com/vbauerster/mpb/v4@v4.6.1-0.20190319154207-3a6acfe12ac6/progress.go:346 +0x101
created by github.com/vbauerster/mpb/v4.fanInRefreshSrc
	/tmp/build/8885cc21/gopath/pkg/mod/github.com/vbauerster/mpb/v4@v4.6.1-0.20190319154207-3a6acfe12ac6/progress.go:361 +0xea

goroutine 54 [semacquire]:
sync.runtime_Semacquire(0xc000412ae8)
	/usr/local/go/src/runtime/sema.go:56 +0x39
sync.(*WaitGroup).Wait(0xc000412ae0)
	/usr/local/go/src/sync/waitgroup.go:130 +0x65
github.com/vbauerster/mpb/v4.fanInRefreshSrc.func2(0xc000412ae0, 0xc000290360)
	/tmp/build/8885cc21/gopath/pkg/mod/github.com/vbauerster/mpb/v4@v4.6.1-0.20190319154207-3a6acfe12ac6/progress.go:365 +0x2b
created by github.com/vbauerster/mpb/v4.fanInRefreshSrc
	/tmp/build/8885cc21/gopath/pkg/mod/github.com/vbauerster/mpb/v4@v4.6.1-0.20190319154207-3a6acfe12ac6/progress.go:364 +0x128

goroutine 55 [select]:
github.com/vbauerster/mpb/v4.(*Bar).serve(0xc000210f30, 0xce7b20, 0xc0003e2640, 0xc0004440f0)
	/tmp/build/8885cc21/gopath/pkg/mod/github.com/vbauerster/mpb/v4@v4.6.1-0.20190319154207-3a6acfe12ac6/bar.go:278 +0x12b
created by github.com/vbauerster/mpb/v4.newBar
	/tmp/build/8885cc21/gopath/pkg/mod/github.com/vbauerster/mpb/v4@v4.6.1-0.20190319154207-3a6acfe12ac6/bar.go:115 +0x52c

goroutine 56 [select]:
net/http.(*Transport).getConn(0xc0000b8fc0, 0xc000154210, 0x0, 0xc000270a00, 0x5, 0xc0004ea500, 0x13, 0x0, 0x0, 0x0, ...)
	/usr/local/go/src/net/http/transport.go:1020 +0x63d
net/http.(*Transport).roundTrip(0xc0000b8fc0, 0xc00015b200, 0xc00015b100, 0xc0002109e0, 0xc000206dd0)
	/usr/local/go/src/net/http/transport.go:467 +0x6ef
net/http.(*Transport).RoundTrip(0xc0000b8fc0, 0xc00015b200, 0xc00015b200, 0x0, 0x10)
	/usr/local/go/src/net/http/roundtrip.go:17 +0x35
golang.org/x/oauth2.(*Transport).RoundTrip(0xc000206db0, 0xc00015b100, 0x0, 0x0, 0x0)
	/tmp/build/8885cc21/gopath/pkg/mod/golang.org/x/oauth2@v0.0.0-20181203162652-d668ce993890/transport.go:56 +0xfc
net/http.send(0xc00015b100, 0xcd88c0, 0xc000206db0, 0x0, 0x0, 0x0, 0xc0002ac208, 0x8, 0x1, 0x0)
	/usr/local/go/src/net/http/client.go:250 +0x461
net/http.(*Client).send(0xc000206de0, 0xc00015b100, 0x0, 0x0, 0x0, 0xc0002ac208, 0x0, 0x1, 0x7f1254bb48b8)
	/usr/local/go/src/net/http/client.go:174 +0xfb
net/http.(*Client).do(0xc000206de0, 0xc00015b100, 0x0, 0x0, 0x0)
	/usr/local/go/src/net/http/client.go:641 +0x279
net/http.(*Client).Do(...)
	/usr/local/go/src/net/http/client.go:509
github.com/concourse/concourse/go-concourse/concourse/internal.(*connection).send(0xc000206e70, 0xc00015b100, 0x0, 0xc0003e7200, 0x0, 0x0)
	/tmp/build/8885cc21/concourse/go-concourse/concourse/internal/connection.go:101 +0x53
github.com/concourse/concourse/go-concourse/concourse/internal.(*connection).Send(0xc000206e70, 0xbf9ce8, 0xe, 0xc000154090, 0xc0001540f0, 0xc0001540c0, 0x7f123b77f358, 0xc000154030, 0x0, 0xc0003e7200, ...)
	/tmp/build/8885cc21/concourse/go-concourse/concourse/internal/connection.go:84 +0xba
github.com/concourse/concourse/go-concourse/concourse.(*team).CreateArtifact(0xc0003e6cc0, 0x7f123b77f358, 0xc000154030, 0xc0004128e8, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/tmp/build/8885cc21/concourse/go-concourse/concourse/artifacts.go:21 +0x34e
github.com/concourse/concourse/fly/commands/internal/executehelpers.Upload(0xc000210f30, 0xcf94c0, 0xc0003e6cc0, 0x7ffdaeaaba7d, 0x1, 0x0, 0xc0004128e8, 0x5, 0x0, 0x0, ...)
	/tmp/build/8885cc21/concourse/fly/commands/internal/executehelpers/uploads.go:25 +0x2ab
github.com/concourse/concourse/fly/commands/internal/executehelpers.GenerateLocalInputs.func1(0xc000210f30, 0x0, 0xc000492c00)
	/tmp/build/8885cc21/concourse/fly/commands/internal/executehelpers/inputs.go:155 +0xbe
github.com/concourse/concourse/fly/ui/progress.(*Progress).Go.func1(0x8, 0xc225b8)
	/tmp/build/8885cc21/concourse/fly/ui/progress/progress.go:44 +0x57
golang.org/x/sync/errgroup.(*Group).Go.func1(0xc0001e7740, 0xc0001e7860)
	/tmp/build/8885cc21/gopath/pkg/mod/golang.org/x/sync@v0.0.0-20190227155943-e225da77a7e6/errgroup/errgroup.go:57 +0x57
created by golang.org/x/sync/errgroup.(*Group).Go
	/tmp/build/8885cc21/gopath/pkg/mod/golang.org/x/sync@v0.0.0-20190227155943-e225da77a7e6/errgroup/errgroup.go:54 +0x66

goroutine 57 [select]:
github.com/vbauerster/mpb/v4.(*Bar).serve(0xc000210fc0, 0xce7b20, 0xc0003e2700, 0xc0004441e0)
	/tmp/build/8885cc21/gopath/pkg/mod/github.com/vbauerster/mpb/v4@v4.6.1-0.20190319154207-3a6acfe12ac6/bar.go:278 +0x12b
created by github.com/vbauerster/mpb/v4.newBar
	/tmp/build/8885cc21/gopath/pkg/mod/github.com/vbauerster/mpb/v4@v4.6.1-0.20190319154207-3a6acfe12ac6/bar.go:115 +0x52c

goroutine 58 [select]:
net/http.(*persistConn).roundTrip(0xc0000b90e0, 0xc0001abe90, 0x0, 0x0, 0x0)
	/usr/local/go/src/net/http/transport.go:2192 +0x75c
net/http.(*Transport).roundTrip(0xc0000b8fc0, 0xc00015b000, 0xc00015af00, 0xc0002109d8, 0xc000206dd0)
	/usr/local/go/src/net/http/transport.go:481 +0xa1b
net/http.(*Transport).RoundTrip(0xc0000b8fc0, 0xc00015b000, 0xc00015b000, 0x0, 0x10)
	/usr/local/go/src/net/http/roundtrip.go:17 +0x35
golang.org/x/oauth2.(*Transport).RoundTrip(0xc000206db0, 0xc00015af00, 0x0, 0x0, 0x0)
	/tmp/build/8885cc21/gopath/pkg/mod/golang.org/x/oauth2@v0.0.0-20181203162652-d668ce993890/transport.go:56 +0xfc
net/http.send(0xc00015af00, 0xcd88c0, 0xc000206db0, 0x0, 0x0, 0x0, 0xc0002ac1d0, 0x8, 0x1, 0x0)
	/usr/local/go/src/net/http/client.go:250 +0x461
net/http.(*Client).send(0xc000206de0, 0xc00015af00, 0x0, 0x0, 0x0, 0xc0002ac1d0, 0x0, 0x1, 0x7f1254bb48b8)
	/usr/local/go/src/net/http/client.go:174 +0xfb
net/http.(*Client).do(0xc000206de0, 0xc00015af00, 0x0, 0x0, 0x0)
	/usr/local/go/src/net/http/client.go:641 +0x279
net/http.(*Client).Do(...)
	/usr/local/go/src/net/http/client.go:509
github.com/concourse/concourse/go-concourse/concourse/internal.(*connection).send(0xc000206e70, 0xc00015af00, 0x0, 0xc0003e7140, 0x0, 0x0)
	/tmp/build/8885cc21/concourse/go-concourse/concourse/internal/connection.go:101 +0x53
github.com/concourse/concourse/go-concourse/concourse/internal.(*connection).Send(0xc000206e70, 0xbf9ce8, 0xe, 0xc0001abbc0, 0xc0001abc20, 0xc0001abbf0, 0x7f123b77f358, 0xc0001abb30, 0x0, 0xc0003e7140, ...)
	/tmp/build/8885cc21/concourse/go-concourse/concourse/internal/connection.go:84 +0xba
github.com/concourse/concourse/go-concourse/concourse.(*team).CreateArtifact(0xc0003e6cc0, 0x7f123b77f358, 0xc0001abb30, 0xc0004128e8, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/tmp/build/8885cc21/concourse/go-concourse/concourse/artifacts.go:21 +0x34e
github.com/concourse/concourse/fly/commands/internal/executehelpers.Upload(0xc000210fc0, 0xcf94c0, 0xc0003e6cc0, 0x7ffdaeaaba90, 0x1, 0x0, 0xc0004128e8, 0x5, 0x0, 0x0, ...)
	/tmp/build/8885cc21/concourse/fly/commands/internal/executehelpers/uploads.go:25 +0x2ab
github.com/concourse/concourse/fly/commands/internal/executehelpers.GenerateLocalInputs.func1(0xc000210fc0, 0x0, 0xc000492f00)
	/tmp/build/8885cc21/concourse/fly/commands/internal/executehelpers/inputs.go:155 +0xbe
github.com/concourse/concourse/fly/ui/progress.(*Progress).Go.func1(0x8, 0xc225b8)
	/tmp/build/8885cc21/concourse/fly/ui/progress/progress.go:44 +0x57
golang.org/x/sync/errgroup.(*Group).Go.func1(0xc0001e7740, 0xc0001e7a40)
	/tmp/build/8885cc21/gopath/pkg/mod/golang.org/x/sync@v0.0.0-20190227155943-e225da77a7e6/errgroup/errgroup.go:57 +0x57
created by golang.org/x/sync/errgroup.(*Group).Go
	/tmp/build/8885cc21/gopath/pkg/mod/golang.org/x/sync@v0.0.0-20190227155943-e225da77a7e6/errgroup/errgroup.go:54 +0x66

goroutine 59 [runnable]:
syscall.Syscall6(0x106, 0xffffffffffffff9c, 0xc000568040, 0xc00056a038, 0x0, 0x0, 0x0, 0xffffffffffffffff, 0x0, 0x2)
	/usr/local/go/src/syscall/asm_linux_amd64.s:44 +0x5
syscall.fstatat(0xffffffffffffff9c, 0xc000568000, 0x36, 0xc00056a038, 0x0, 0x36, 0x0)
	/usr/local/go/src/syscall/zsyscall_linux_amd64.go:1520 +0xcb
syscall.Stat(...)
	/usr/local/go/src/syscall/syscall_linux_amd64.go:64
os.statNolog(0xc000568000, 0x36, 0xc000568000, 0x36, 0x0, 0xc000409de0)
	/usr/local/go/src/os/stat_unix.go:31 +0x6f
os.Stat(0xc000568000, 0x36, 0x36, 0x1, 0xc000568000, 0x36)
	/usr/local/go/src/os/stat.go:13 +0x4d
os/exec.findExecutable(0xc000568000, 0x36, 0x2, 0xc000568000)
	/usr/local/go/src/os/exec/lp_unix.go:20 +0x39
os/exec.LookPath(0xbf1128, 0x3, 0xc000470ec8, 0xc000470ef0, 0xc000470ef0, 0x4109e8)
	/usr/local/go/src/os/exec/lp_unix.go:53 +0x176
github.com/concourse/go-archive/tarfs.Compress(0xcd8560, 0xc0005982a0, 0x7ffdaeaaba90, 0x1, 0xc0004ca000, 0x19a, 0x200, 0x0, 0x0)
	/tmp/build/8885cc21/gopath/pkg/mod/github.com/concourse/go-archive@v1.0.1/tarfs/compress.go:14 +0x53
github.com/concourse/concourse/fly/commands/internal/executehelpers.Upload.func1(0xc0002ac1b0, 0x7ffdaeaaba90, 0x1, 0xc0004ca000, 0x19a, 0x200)
	/tmp/build/8885cc21/concourse/fly/commands/internal/executehelpers/uploads.go:22 +0xa5
created by github.com/concourse/concourse/fly/commands/internal/executehelpers.Upload
	/tmp/build/8885cc21/concourse/fly/commands/internal/executehelpers/uploads.go:21 +0x20b

goroutine 60 [runnable]:
syscall.Syscall6(0x106, 0xffffffffffffff9c, 0xc00057a030, 0xc00057c038, 0x0, 0x0, 0x0, 0xffffffffffffffff, 0x0, 0x2)
	/usr/local/go/src/syscall/asm_linux_amd64.s:44 +0x5
syscall.fstatat(0xffffffffffffff9c, 0xc00057a000, 0x2e, 0xc00057c038, 0x0, 0x2e, 0x0)
	/usr/local/go/src/syscall/zsyscall_linux_amd64.go:1520 +0xcb
syscall.Stat(...)
	/usr/local/go/src/syscall/syscall_linux_amd64.go:64
os.statNolog(0xc00057a000, 0x2e, 0xc00057a000, 0x2e, 0x0, 0xc000579de0)
	/usr/local/go/src/os/stat_unix.go:31 +0x6f
os.Stat(0xc00057a000, 0x2e, 0x2e, 0x1, 0xc00057a000, 0x2e)
	/usr/local/go/src/os/stat.go:13 +0x4d
os/exec.findExecutable(0xc00057a000, 0x2e, 0x2, 0xc00057a000)
	/usr/local/go/src/os/exec/lp_unix.go:20 +0x39
os/exec.LookPath(0xbf1128, 0x3, 0xc0004716c8, 0xc0004716f0, 0xc0004716f0, 0x4109e8)
	/usr/local/go/src/os/exec/lp_unix.go:53 +0x176
github.com/concourse/go-archive/tarfs.Compress(0xcd8560, 0xc00056e000, 0x7ffdaeaaba7d, 0x1, 0xc00023a000, 0x19a, 0x200, 0x0, 0x0)
	/tmp/build/8885cc21/gopath/pkg/mod/github.com/concourse/go-archive@v1.0.1/tarfs/compress.go:14 +0x53
github.com/concourse/concourse/fly/commands/internal/executehelpers.Upload.func1(0xc0002ac1e8, 0x7ffdaeaaba7d, 0x1, 0xc00023a000, 0x19a, 0x200)
	/tmp/build/8885cc21/concourse/fly/commands/internal/executehelpers/uploads.go:22 +0xa5
created by github.com/concourse/concourse/fly/commands/internal/executehelpers.Upload
	/tmp/build/8885cc21/concourse/fly/commands/internal/executehelpers/uploads.go:21 +0x20b

goroutine 61 [select]:
net.(*Resolver).lookupIPAddr(0x13f9fa0, 0xce7ba0, 0xc0004d4900, 0xbf112e, 0x3, 0xc0004ea500, 0xf, 0x1bb, 0x0, 0x0, ...)
	/usr/local/go/src/net/lookup.go:275 +0x663
net.(*Resolver).internetAddrList(0x13f9fa0, 0xce7ba0, 0xc0004d4900, 0xbf112e, 0x3, 0xc0004ea500, 0x13, 0x0, 0x0, 0x0, ...)
	/usr/local/go/src/net/ipsock.go:280 +0x61f
net.(*Resolver).resolveAddrList(0x13f9fa0, 0xce7ba0, 0xc0004d4900, 0xbf174b, 0x4, 0xbf112e, 0x3, 0xc0004ea500, 0x13, 0x0, ...)
	/usr/local/go/src/net/dial.go:213 +0x508
net.(*Dialer).DialContext(0xc0000852c0, 0xce7b60, 0xc000026180, 0xbf112e, 0x3, 0xc0004ea500, 0x13, 0x0, 0x0, 0x0, ...)
	/usr/local/go/src/net/dial.go:395 +0x202
net.(*Dialer).Dial(...)
	/usr/local/go/src/net/dial.go:340
net/http.(*Transport).dial(0xc0000b8fc0, 0xce7b60, 0xc000026180, 0xbf112e, 0x3, 0xc0004ea500, 0x13, 0x0, 0x0, 0x0, ...)
	/usr/local/go/src/net/http/transport.go:935 +0x7b
net/http.(*Transport).dialConn(0xc0000b8fc0, 0xce7b60, 0xc000026180, 0x0, 0xc000270a00, 0x5, 0xc0004ea500, 0x13, 0x0, 0x3, ...)
	/usr/local/go/src/net/http/transport.go:1259 +0x19d1
net/http.(*Transport).getConn.func4(0xc0000b8fc0, 0xce7b60, 0xc000026180, 0xc000154240, 0xc000291980)
	/usr/local/go/src/net/http/transport.go:1015 +0xa6
created by net/http.(*Transport).getConn
	/usr/local/go/src/net/http/transport.go:1014 +0x455

goroutine 62 [select]:
net.cgoLookupIP(0xce7b20, 0xc0003e2c00, 0xbf112e, 0x3, 0xc0004ea500, 0xf, 0xc0003d12dc, 0x0, 0x105, 0xc0003d12da, ...)
	/usr/local/go/src/net/cgo_unix.go:217 +0x195
net.(*Resolver).lookupIP(0x13f9fa0, 0xce7b20, 0xc0003e2c00, 0xbf112e, 0x3, 0xc0004ea500, 0xf, 0xec22e5b00, 0x0, 0xc000493500, ...)
	/usr/local/go/src/net/lookup_unix.go:96 +0x1a4
net.glob..func1(0xce7b20, 0xc0003e2c00, 0xc0003d69c0, 0xbf112e, 0x3, 0xc0004ea500, 0xf, 0x2, 0x26d, 0xc0003d158d, ...)
	/usr/local/go/src/net/hook.go:23 +0x72
net.(*Resolver).lookupIPAddr.func1(0x0, 0x0, 0x0, 0x0)
	/usr/local/go/src/net/lookup.go:269 +0x116
internal/singleflight.(*Group).doCall(0x13f9fb0, 0xc00057e640, 0xc0004ea520, 0x13, 0xc0003e2c40)
	/usr/local/go/src/internal/singleflight/singleflight.go:95 +0x2e
created by internal/singleflight.(*Group).DoChan
	/usr/local/go/src/internal/singleflight/singleflight.go:88 +0x29d

Version Info

  • Concourse version: 5.4.0
  • Deployment type (BOSH/Docker/binary): BOSH
  • Infrastructure/IaaS: GCP
  • Browser (if applicable): N/A
  • Did this used to work? Absolutely, going back many versions.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 3
  • Comments: 29 (26 by maintainers)

Most upvoted comments

@kcmannem I can confirm that setting export GODEBUG=netdns=go+2 prevents the segfault for me. fly login and fly ws both work fine now. export GODEBUG=netdns=go also does the job. export GODEBUG=netdns=cgo causes the segfault

According to this issue https://github.com/golang/go/issues/16331, the panic can occur when we’re using cgo or an unsafe library. zstd is the only reason we use cgo. I’m tempted to roll fly execute back to tgz. Until we can find a more concrete reason.

fixed by concourse/ci#59

we’ve figured out a way to build fly with netdns=go instead of cgo.

when we try to force the debug flag to use cgo, the output is clear that its been built with netgo and cannot respect the flag.

root@01c6d3cc4753:/concourse/fly# GODEBUG=netdns=cgo+1 ./fly -t ci login -c "https://ci.concourse-ci.org"
logging in to team 'main'

go package net: built with netgo build tag; using Go's DNS resolver
navigate to the following URL in your browser:

  https://ci.concourse-ci.org/login?fly_port=46641

or enter token manually:

We’re gunna test this on a distro that doesn’t have glibc (we built on ubuntu) but something like musl and see if we still error.

Thanks for the workaround. I also confirm that export GODEBUG=netdns=go resolvees the issue

@kcmannem Thank you for providing a workaround, so I don’t need to borrow a colleagues MacBook to check on the workers or execute something 🙂