Error when Ctrl+C'ing "check -chunks": concurrent map iteration and map write

Please describe what you are doing to trigger the bug:

Execute duplicacy check -all -chunks -stats -threads 8, let it run for a while, then press Ctrl+C.

Please describe what you expect to happen (but doesn’t):

Gracefully terminate the application.

Please describe what actually happens (the wrong behaviour):

I get the following error message. Afaik, verified_chunks IS being written.

Verified chunk 6d02fde10b979822805d78ebc4c1832c1924138b66fd48e3f40bb8c461b2f2be (31998/357540), 5.60MB/s 3 days 07:59:00 8.9%
Verified chunk e2543fe21d42429986a57be4942cebcd45617ca403c34cf6cfe339e99b9a7790 (31999/357540), 5.60MB/s 3 days 07:58:55 8.9%
^Cfatal error: concurrent map iteration and map write

goroutine 11 [running]:
runtime.throw(0x137678d, 0x26)
	/usr/local/go/src/runtime/panic.go:1117 +0x72 fp=0xc034bdeac0 sp=0xc034bdea90 pc=0x437f32
runtime.mapiternext(0xc0007256e0)
	/usr/local/go/src/runtime/map.go:858 +0x54c fp=0xc034bdeb40 sp=0xc034bdeac0 pc=0x410cac
reflect.mapiternext(0xc0007256e0)
	/usr/local/go/src/runtime/map.go:1346 +0x2b fp=0xc034bdeb58 sp=0xc034bdeb40 pc=0x46b58b
reflect.Value.MapKeys(0x1195a20, 0xc0005d0060, 0x15, 0x0, 0x13322a0, 0xc034bdec40)
	/usr/local/go/src/reflect/value.go:1227 +0x10c fp=0xc034bdebe8 sp=0xc034bdeb58 pc=0x4a732c
encoding/json.mapEncoder.encode(0x139f6a8, 0xc004964100, 0x1195a20, 0xc0005d0060, 0x15, 0x1190100)
	/usr/local/go/src/encoding/json/encode.go:797 +0x13c fp=0xc034bded90 sp=0xc034bdebe8 pc=0x52737c
encoding/json.mapEncoder.encode-fm(0xc004964100, 0x1195a20, 0xc0005d0060, 0x15, 0x100)
	/usr/local/go/src/encoding/json/encode.go:779 +0x6d fp=0xc034bdedd0 sp=0xc034bded90 pc=0x53392d
encoding/json.(*encodeState).reflectValue(0xc004964100, 0x1195a20, 0xc0005d0060, 0x15, 0xc0005b0100)
	/usr/local/go/src/encoding/json/encode.go:360 +0x82 fp=0xc034bdee08 sp=0xc034bdedd0 pc=0x524662
encoding/json.(*encodeState).marshal(0xc004964100, 0x1195a20, 0xc0005d0060, 0x100, 0x0, 0x0)
	/usr/local/go/src/encoding/json/encode.go:332 +0xf9 fp=0xc034bdee68 sp=0xc034bdee08 pc=0x524259
encoding/json.Marshal(0x1195a20, 0xc0005d0060, 0x170e, 0x2, 0x0, 0x100000000000000, 0x0)
	/usr/local/go/src/encoding/json/encode.go:161 +0x52 fp=0xc034bdeee0 sp=0xc034bdee68 pc=0x5236d2
github.com/gilbertchen/duplicacy/src.(*SnapshotManager).CheckSnapshots.func2()
	/Users/gchen/zincbox/duplicacy/src/duplicacy_snapshotmanager.go:1024 +0x9e fp=0xc034bdefa0 sp=0xc034bdeee0 pc=0x104dc7e
main.main.func2(0xc0000b9740)
	/Users/gchen/zincbox/duplicacy/duplicacy/duplicacy_main.go:2231 +0x3b fp=0xc034bdefd8 sp=0xc034bdefa0 pc=0x1069d5b
runtime.goexit()
	/usr/local/go/src/runtime/asm_amd64.s:1371 +0x1 fp=0xc034bdefe0 sp=0xc034bdefd8 pc=0x471c81
created by main.main
	/Users/gchen/zincbox/duplicacy/duplicacy/duplicacy_main.go:2229 +0x6b10

goroutine 1 [chan send]:
github.com/gilbertchen/duplicacy/src.(*SnapshotManager).CheckSnapshots(0xc000726000, 0xc0057d0088, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1000001, 0x8, ...)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_snapshotmanager.go:1105 +0x24f0
main.checkSnapshots(0xc0004c65a0)
	/Users/gchen/zincbox/duplicacy/duplicacy/duplicacy_main.go:988 +0x885
github.com/gilbertchen/cli.Command.Run(0x13493c0, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x136bb39, 0x20, 0x0, ...)
	/Users/gchen/zincbox/go/pkg/mod/github.com/gilbertchen/cli@v1.2.1-0.20160223210219-1de0a1836ce9/command.go:160 +0x784
github.com/gilbertchen/cli.(*App).Run(0xc0004c6360, 0xc000030090, 0x9, 0x9, 0x0, 0x0)
	/Users/gchen/zincbox/go/pkg/mod/github.com/gilbertchen/cli@v1.2.1-0.20160223210219-1de0a1836ce9/app.go:179 +0x6a8
main.main()
	/Users/gchen/zincbox/duplicacy/duplicacy/duplicacy_main.go:2236 +0x6b45

goroutine 6 [select]:
go.opencensus.io/stats/view.(*worker).start(0xc000106dc0)
	/Users/gchen/zincbox/go/pkg/mod/go.opencensus.io@v0.22.3/stats/view/worker.go:154 +0xcd
created by go.opencensus.io/stats/view.init.0
	/Users/gchen/zincbox/go/pkg/mod/go.opencensus.io@v0.22.3/stats/view/worker.go:32 +0x57

goroutine 7 [IO wait, 499 minutes]:
internal/poll.runtime_pollWait(0x7f52c764c7d8, 0x72, 0x1000)
	/usr/local/go/src/runtime/netpoll.go:227 +0x55
internal/poll.(*pollDesc).wait(0xc000162918, 0x72, 0x0, 0x10, 0xc0003e4c20)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:87 +0x45
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).ReadMsg(0xc000162900, 0xc00019cd10, 0x10, 0x10, 0xc0003e4c20, 0x1000, 0x1000, 0x0, 0x0, 0x0, ...)
	/usr/local/go/src/internal/poll/fd_unix.go:249 +0x252
net.(*netFD).readMsg(0xc000162900, 0xc00019cd10, 0x10, 0x10, 0xc0003e4c20, 0x1000, 0x1000, 0xeb00000008000103, 0x1, 0xc00012b320, ...)
	/usr/local/go/src/net/fd_posix.go:67 +0x90
net.(*UnixConn).readMsg(0xc00000e6b0, 0xc00019cd10, 0x10, 0x10, 0xc0003e4c20, 0x1000, 0x1000, 0xc000302878, 0xc0005d1020, 0x1c7cca8, ...)
	/usr/local/go/src/net/unixsock_posix.go:115 +0x91
net.(*UnixConn).ReadMsgUnix(0xc00000e6b0, 0xc00019cd10, 0x10, 0x10, 0xc0003e4c20, 0x1000, 0x1000, 0xc00000d110, 0xc0000adc88, 0x40db1b, ...)
	/usr/local/go/src/net/unixsock.go:143 +0x9d
github.com/godbus/dbus.(*oobReader).Read(0xc0003e4c00, 0xc00019cd10, 0x10, 0x10, 0xc0000adcb8, 0x40e278, 0x1020)
	/Users/gchen/zincbox/go/pkg/mod/github.com/godbus/dbus@v4.1.0+incompatible/transport_unix.go:21 +0x8d
io.ReadAtLeast(0x1532420, 0xc0003e4c00, 0xc00019cd10, 0x10, 0x10, 0x10, 0xc0000add00, 0x469600, 0xc000000180)
	/usr/local/go/src/io/io.go:328 +0x87
io.ReadFull(...)
	/usr/local/go/src/io/io.go:347
github.com/godbus/dbus.(*unixTransport).ReadMessage(0xc000458500, 0xc0004be3c0, 0x7, 0xc0004c4488)
	/Users/gchen/zincbox/go/pkg/mod/github.com/godbus/dbus@v4.1.0+incompatible/transport_unix.go:85 +0x12e
github.com/godbus/dbus.(*Conn).inWorker(0xc000164200)
	/Users/gchen/zincbox/go/pkg/mod/github.com/godbus/dbus@v4.1.0+incompatible/conn.go:285 +0x57
created by github.com/godbus/dbus.(*Conn).Auth
	/Users/gchen/zincbox/go/pkg/mod/github.com/godbus/dbus@v4.1.0+incompatible/auth.go:118 +0x667

goroutine 8 [chan receive, 499 minutes]:
github.com/godbus/dbus.(*Conn).outWorker(0xc000164200)
	/Users/gchen/zincbox/go/pkg/mod/github.com/godbus/dbus@v4.1.0+incompatible/conn.go:427 +0x55
created by github.com/godbus/dbus.(*Conn).Auth
	/Users/gchen/zincbox/go/pkg/mod/github.com/godbus/dbus@v4.1.0+incompatible/auth.go:119 +0x68c

goroutine 10 [syscall]:
os/signal.signal_recv(0x153fce0)
	/usr/local/go/src/runtime/sigqueue.go:168 +0xa5
os/signal.loop()
	/usr/local/go/src/os/signal/signal_unix.go:23 +0x25
created by os/signal.Notify.func1.1
	/usr/local/go/src/os/signal/signal.go:151 +0x45

goroutine 67 [select]:
github.com/gilbertchen/duplicacy/src.CreateChunkOperator.func1(0xc000124280, 0x0)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:90 +0x171
created by github.com/gilbertchen/duplicacy/src.CreateChunkOperator
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:87 +0x1ba

goroutine 68 [chan receive]:
github.com/pkg/sftp.(*File).WriteTo(0xc006cbff50, 0x1532260, 0xc000105140, 0x7f52c7350068, 0xc006cbff50, 0xc0002b1301)
	/Users/gchen/zincbox/go/pkg/mod/github.com/pkg/sftp@v1.11.0/client.go:1006 +0x2cd
io.copyBuffer(0x1532260, 0xc000105140, 0x1532600, 0xc006cbff50, 0x0, 0x0, 0x0, 0x50, 0x1, 0xc0002b1430)
	/usr/local/go/src/io/io.go:405 +0x3ac
io.Copy(...)
	/usr/local/go/src/io/io.go:382
github.com/gilbertchen/duplicacy/src.RateLimitedCopy(0x1532260, 0xc000105140, 0x1532600, 0xc006cbff50, 0x0, 0x0, 0x454d14, 0x0)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_utils.go:143 +0x256
github.com/gilbertchen/duplicacy/src.(*SFTPStorage).DownloadFile.func1(0x0, 0x0)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_sftpstorage.go:275 +0x1a5
github.com/gilbertchen/duplicacy/src.(*SFTPStorage).retry(0xc0005fc120, 0xc0002b1600, 0x0, 0x48)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_sftpstorage.go:138 +0x63
github.com/gilbertchen/duplicacy/src.(*SFTPStorage).DownloadFile(0xc0005fc120, 0x1, 0xc0062f8280, 0x48, 0xc000105140, 0xc0062f8280, 0x48)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_sftpstorage.go:267 +0x7e
github.com/gilbertchen/duplicacy/src.(*ChunkOperator).DownloadChunk(0xc000124280, 0x1, 0x0, 0xc01c264340, 0x40, 0xc00584d940, 0x20, 0x7d04, 0x0, 0x0, ...)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:404 +0x239
github.com/gilbertchen/duplicacy/src.(*ChunkOperator).Run(0xc000124280, 0x1, 0x0, 0xc01c264340, 0x40, 0xc00584d940, 0x20, 0x7d04, 0x0, 0x0, ...)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:184 +0x1665
github.com/gilbertchen/duplicacy/src.CreateChunkOperator.func1(0xc000124280, 0x1)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:92 +0xde
created by github.com/gilbertchen/duplicacy/src.CreateChunkOperator
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:87 +0x1ba

goroutine 69 [chan receive]:
github.com/pkg/sftp.(*clientConn).sendPacket(0xc00061c750, 0x153f4c0, 0xc0000a0540, 0xc0000a0540, 0x1532260, 0xc0000b9920, 0x1532600, 0xc0062bffb0, 0x0)
	/Users/gchen/zincbox/go/pkg/mod/github.com/pkg/sftp@v1.11.0/conn.go:109 +0xaf
github.com/pkg/sftp.(*Client).close(0xc00061c750, 0xc0060311b0, 0x10, 0x0, 0x0)
	/Users/gchen/zincbox/go/pkg/mod/github.com/pkg/sftp@v1.11.0/client.go:531 +0xaa
github.com/pkg/sftp.(*File).Close(0xc0062bffb0, 0xc0000b9920, 0x1532600)
	/Users/gchen/zincbox/go/pkg/mod/github.com/pkg/sftp@v1.11.0/client.go:824 +0x45
github.com/gilbertchen/duplicacy/src.(*SFTPStorage).DownloadFile.func1(0x0, 0x0)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_sftpstorage.go:278 +0x20e
github.com/gilbertchen/duplicacy/src.(*SFTPStorage).retry(0xc0005fc120, 0xc000193600, 0x0, 0x48)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_sftpstorage.go:138 +0x63
github.com/gilbertchen/duplicacy/src.(*SFTPStorage).DownloadFile(0xc0005fc120, 0x2, 0xc00901b360, 0x48, 0xc0000b9920, 0xc00901b360, 0x48)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_sftpstorage.go:267 +0x7e
github.com/gilbertchen/duplicacy/src.(*ChunkOperator).DownloadChunk(0xc000124280, 0x2, 0x0, 0xc012bdb6c0, 0x40, 0xc00c0f3600, 0x20, 0x7d00, 0x0, 0x0, ...)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:404 +0x239
github.com/gilbertchen/duplicacy/src.(*ChunkOperator).Run(0xc000124280, 0x2, 0x0, 0xc012bdb6c0, 0x40, 0xc00c0f3600, 0x20, 0x7d00, 0x0, 0x0, ...)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:184 +0x1665
github.com/gilbertchen/duplicacy/src.CreateChunkOperator.func1(0xc000124280, 0x2)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:92 +0xde
created by github.com/gilbertchen/duplicacy/src.CreateChunkOperator
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:87 +0x1ba

goroutine 70 [chan receive]:
github.com/pkg/sftp.(*File).WriteTo(0xc00693d5c0, 0x1532260, 0xc0001bc5a0, 0x7f52c7350068, 0xc00693d5c0, 0xc036023301)
	/Users/gchen/zincbox/go/pkg/mod/github.com/pkg/sftp@v1.11.0/client.go:1006 +0x2cd
io.copyBuffer(0x1532260, 0xc0001bc5a0, 0x1532600, 0xc00693d5c0, 0x0, 0x0, 0x0, 0x50, 0x1, 0xc036023430)
	/usr/local/go/src/io/io.go:405 +0x3ac
io.Copy(...)
	/usr/local/go/src/io/io.go:382
github.com/gilbertchen/duplicacy/src.RateLimitedCopy(0x1532260, 0xc0001bc5a0, 0x1532600, 0xc00693d5c0, 0x0, 0x0, 0x454d14, 0x0)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_utils.go:143 +0x256
github.com/gilbertchen/duplicacy/src.(*SFTPStorage).DownloadFile.func1(0x0, 0x0)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_sftpstorage.go:275 +0x1a5
github.com/gilbertchen/duplicacy/src.(*SFTPStorage).retry(0xc0005fc120, 0xc036023600, 0x0, 0x48)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_sftpstorage.go:138 +0x63
github.com/gilbertchen/duplicacy/src.(*SFTPStorage).DownloadFile(0xc0005fc120, 0x3, 0xc00611e000, 0x48, 0xc0001bc5a0, 0xc00611e000, 0x48)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_sftpstorage.go:267 +0x7e
github.com/gilbertchen/duplicacy/src.(*ChunkOperator).DownloadChunk(0xc000124280, 0x3, 0x0, 0xc0129d7240, 0x40, 0xc00c5a2be0, 0x20, 0x7d01, 0x0, 0x0, ...)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:404 +0x239
github.com/gilbertchen/duplicacy/src.(*ChunkOperator).Run(0xc000124280, 0x3, 0x0, 0xc0129d7240, 0x40, 0xc00c5a2be0, 0x20, 0x7d01, 0x0, 0x0, ...)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:184 +0x1665
github.com/gilbertchen/duplicacy/src.CreateChunkOperator.func1(0xc000124280, 0x3)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:92 +0xde
created by github.com/gilbertchen/duplicacy/src.CreateChunkOperator
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:87 +0x1ba

goroutine 71 [chan receive]:
github.com/pkg/sftp.(*File).WriteTo(0xc00c46e300, 0x1532260, 0xc0006fc060, 0x7f52c7350068, 0xc00c46e300, 0xc000303301)
	/Users/gchen/zincbox/go/pkg/mod/github.com/pkg/sftp@v1.11.0/client.go:1006 +0x2cd
io.copyBuffer(0x1532260, 0xc0006fc060, 0x1532600, 0xc00c46e300, 0x0, 0x0, 0x0, 0x50, 0x1, 0xc000303430)
	/usr/local/go/src/io/io.go:405 +0x3ac
io.Copy(...)
	/usr/local/go/src/io/io.go:382
github.com/gilbertchen/duplicacy/src.RateLimitedCopy(0x1532260, 0xc0006fc060, 0x1532600, 0xc00c46e300, 0x0, 0x0, 0x454d14, 0x0)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_utils.go:143 +0x256
github.com/gilbertchen/duplicacy/src.(*SFTPStorage).DownloadFile.func1(0x0, 0x0)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_sftpstorage.go:275 +0x1a5
github.com/gilbertchen/duplicacy/src.(*SFTPStorage).retry(0xc0005fc120, 0xc000303600, 0x0, 0x48)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_sftpstorage.go:138 +0x63
github.com/gilbertchen/duplicacy/src.(*SFTPStorage).DownloadFile(0xc0005fc120, 0x4, 0xc0060660a0, 0x48, 0xc0006fc060, 0xc0060660a0, 0x48)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_sftpstorage.go:267 +0x7e
github.com/gilbertchen/duplicacy/src.(*ChunkOperator).DownloadChunk(0xc000124280, 0x4, 0x0, 0xc012db5ec0, 0x40, 0xc001d70e20, 0x20, 0x7d02, 0x0, 0x0, ...)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:404 +0x239
github.com/gilbertchen/duplicacy/src.(*ChunkOperator).Run(0xc000124280, 0x4, 0x0, 0xc012db5ec0, 0x40, 0xc001d70e20, 0x20, 0x7d02, 0x0, 0x0, ...)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:184 +0x1665
github.com/gilbertchen/duplicacy/src.CreateChunkOperator.func1(0xc000124280, 0x4)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:92 +0xde
created by github.com/gilbertchen/duplicacy/src.CreateChunkOperator
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:87 +0x1ba

goroutine 72 [chan receive]:
github.com/pkg/sftp.(*File).WriteTo(0xc00c46f3e0, 0x1532260, 0xc000630000, 0x7f52c7350068, 0xc00c46f3e0, 0xc000383301)
	/Users/gchen/zincbox/go/pkg/mod/github.com/pkg/sftp@v1.11.0/client.go:1006 +0x2cd
io.copyBuffer(0x1532260, 0xc000630000, 0x1532600, 0xc00c46f3e0, 0x0, 0x0, 0x0, 0x50, 0x1, 0xc000383430)
	/usr/local/go/src/io/io.go:405 +0x3ac
io.Copy(...)
	/usr/local/go/src/io/io.go:382
github.com/gilbertchen/duplicacy/src.RateLimitedCopy(0x1532260, 0xc000630000, 0x1532600, 0xc00c46f3e0, 0x0, 0x0, 0x454d14, 0x0)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_utils.go:143 +0x256
github.com/gilbertchen/duplicacy/src.(*SFTPStorage).DownloadFile.func1(0x0, 0x0)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_sftpstorage.go:275 +0x1a5
github.com/gilbertchen/duplicacy/src.(*SFTPStorage).retry(0xc0005fc120, 0xc000383600, 0x0, 0x48)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_sftpstorage.go:138 +0x63
github.com/gilbertchen/duplicacy/src.(*SFTPStorage).DownloadFile(0xc0005fc120, 0x5, 0xc0062f8d20, 0x48, 0xc000630000, 0xc0062f8d20, 0x48)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_sftpstorage.go:267 +0x7e
github.com/gilbertchen/duplicacy/src.(*ChunkOperator).DownloadChunk(0xc000124280, 0x5, 0x0, 0xc0126f12c0, 0x40, 0xc00632d7c0, 0x20, 0x7d06, 0x0, 0x0, ...)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:404 +0x239
github.com/gilbertchen/duplicacy/src.(*ChunkOperator).Run(0xc000124280, 0x5, 0x0, 0xc0126f12c0, 0x40, 0xc00632d7c0, 0x20, 0x7d06, 0x0, 0x0, ...)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:184 +0x1665
github.com/gilbertchen/duplicacy/src.CreateChunkOperator.func1(0xc000124280, 0x5)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:92 +0xde
created by github.com/gilbertchen/duplicacy/src.CreateChunkOperator
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:87 +0x1ba

goroutine 73 [chan receive]:
github.com/pkg/sftp.(*File).WriteTo(0xc00693d860, 0x1532260, 0xc00019a8a0, 0x7f52c7350068, 0xc00693d860, 0xc03fdcb301)
	/Users/gchen/zincbox/go/pkg/mod/github.com/pkg/sftp@v1.11.0/client.go:1006 +0x2cd
io.copyBuffer(0x1532260, 0xc00019a8a0, 0x1532600, 0xc00693d860, 0x0, 0x0, 0x0, 0x50, 0x1, 0xc03fdcb430)
	/usr/local/go/src/io/io.go:405 +0x3ac
io.Copy(...)
	/usr/local/go/src/io/io.go:382
github.com/gilbertchen/duplicacy/src.RateLimitedCopy(0x1532260, 0xc00019a8a0, 0x1532600, 0xc00693d860, 0x0, 0x0, 0x454d14, 0x0)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_utils.go:143 +0x256
github.com/gilbertchen/duplicacy/src.(*SFTPStorage).DownloadFile.func1(0x0, 0x0)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_sftpstorage.go:275 +0x1a5
github.com/gilbertchen/duplicacy/src.(*SFTPStorage).retry(0xc0005fc120, 0xc03fdcb600, 0x0, 0x48)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_sftpstorage.go:138 +0x63
github.com/gilbertchen/duplicacy/src.(*SFTPStorage).DownloadFile(0xc0005fc120, 0x6, 0xc000039540, 0x48, 0xc00019a8a0, 0xc000039540, 0x48)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_sftpstorage.go:267 +0x7e
github.com/gilbertchen/duplicacy/src.(*ChunkOperator).DownloadChunk(0xc000124280, 0x6, 0x0, 0xc013a3bb40, 0x40, 0xc00600fc40, 0x20, 0x7d05, 0x0, 0x0, ...)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:404 +0x239
github.com/gilbertchen/duplicacy/src.(*ChunkOperator).Run(0xc000124280, 0x6, 0x0, 0xc013a3bb40, 0x40, 0xc00600fc40, 0x20, 0x7d05, 0x0, 0x0, ...)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:184 +0x1665
github.com/gilbertchen/duplicacy/src.CreateChunkOperator.func1(0xc000124280, 0x6)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:92 +0xde
created by github.com/gilbertchen/duplicacy/src.CreateChunkOperator
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:87 +0x1ba

goroutine 74 [chan receive]:
github.com/pkg/sftp.(*File).WriteTo(0xc00c46e330, 0x1532260, 0xc000105020, 0x7f52c7350068, 0xc00c46e330, 0xc0001e1301)
	/Users/gchen/zincbox/go/pkg/mod/github.com/pkg/sftp@v1.11.0/client.go:1006 +0x2cd
io.copyBuffer(0x1532260, 0xc000105020, 0x1532600, 0xc00c46e330, 0x0, 0x0, 0x0, 0x50, 0x1, 0xc0001e1430)
	/usr/local/go/src/io/io.go:405 +0x3ac
io.Copy(...)
	/usr/local/go/src/io/io.go:382
github.com/gilbertchen/duplicacy/src.RateLimitedCopy(0x1532260, 0xc000105020, 0x1532600, 0xc00c46e330, 0x0, 0x0, 0x454d14, 0x0)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_utils.go:143 +0x256
github.com/gilbertchen/duplicacy/src.(*SFTPStorage).DownloadFile.func1(0x0, 0x0)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_sftpstorage.go:275 +0x1a5
github.com/gilbertchen/duplicacy/src.(*SFTPStorage).retry(0xc0005fc120, 0xc0001e1600, 0x0, 0x48)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_sftpstorage.go:138 +0x63
github.com/gilbertchen/duplicacy/src.(*SFTPStorage).DownloadFile(0xc0005fc120, 0x7, 0xc0062f8050, 0x48, 0xc000105020, 0xc0062f8050, 0x48)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_sftpstorage.go:267 +0x7e
github.com/gilbertchen/duplicacy/src.(*ChunkOperator).DownloadChunk(0xc000124280, 0x7, 0x0, 0xc01105c740, 0x40, 0xc007e136c0, 0x20, 0x7d03, 0x0, 0x0, ...)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:404 +0x239
github.com/gilbertchen/duplicacy/src.(*ChunkOperator).Run(0xc000124280, 0x7, 0x0, 0xc01105c740, 0x40, 0xc007e136c0, 0x20, 0x7d03, 0x0, 0x0, ...)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:184 +0x1665
github.com/gilbertchen/duplicacy/src.CreateChunkOperator.func1(0xc000124280, 0x7)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:92 +0xde
created by github.com/gilbertchen/duplicacy/src.CreateChunkOperator
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:87 +0x1ba

goroutine 36 [chan receive]:
github.com/gilbertchen/duplicacy/src.(*ChunkOperator).Download(0xc000124280, 0xc007e136c0, 0x20, 0x7d03, 0x0, 0xc034be1f08)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:152 +0x1e9
github.com/gilbertchen/duplicacy/src.(*SnapshotManager).CheckSnapshots.func3(0xc0000d60a0, 0xc00537e030, 0xc000726000, 0xc0076e2258, 0xc00537e070, 0xc13f9438b3e7b5f7, 0x17f0afdf593, 0x1c4db40, 0xc0005ce020, 0xc00537e020, ...)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_snapshotmanager.go:1080 +0xe5
created by github.com/gilbertchen/duplicacy/src.(*SnapshotManager).CheckSnapshots
	/Users/gchen/zincbox/duplicacy/src/duplicacy_snapshotmanager.go:1070 +0x248b

goroutine 37 [chan receive]:
github.com/gilbertchen/duplicacy/src.(*ChunkOperator).Download(0xc000124280, 0xc00c0f3600, 0x20, 0x7d00, 0x0, 0xc00035df08)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:152 +0x1e9
github.com/gilbertchen/duplicacy/src.(*SnapshotManager).CheckSnapshots.func3(0xc0000d60a0, 0xc00537e030, 0xc000726000, 0xc0076e2258, 0xc00537e070, 0xc13f9438b3e7b5f7, 0x17f0afdf593, 0x1c4db40, 0xc0005ce020, 0xc00537e020, ...)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_snapshotmanager.go:1080 +0xe5
created by github.com/gilbertchen/duplicacy/src.(*SnapshotManager).CheckSnapshots
	/Users/gchen/zincbox/duplicacy/src/duplicacy_snapshotmanager.go:1070 +0x248b

goroutine 38 [chan receive]:
github.com/gilbertchen/duplicacy/src.(*ChunkOperator).Download(0xc000124280, 0xc00600fc40, 0x20, 0x7d05, 0x0, 0xc034bdef08)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:152 +0x1e9
github.com/gilbertchen/duplicacy/src.(*SnapshotManager).CheckSnapshots.func3(0xc0000d60a0, 0xc00537e030, 0xc000726000, 0xc0076e2258, 0xc00537e070, 0xc13f9438b3e7b5f7, 0x17f0afdf593, 0x1c4db40, 0xc0005ce020, 0xc00537e020, ...)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_snapshotmanager.go:1080 +0xe5
created by github.com/gilbertchen/duplicacy/src.(*SnapshotManager).CheckSnapshots
	/Users/gchen/zincbox/duplicacy/src/duplicacy_snapshotmanager.go:1070 +0x248b

goroutine 39 [chan receive]:
github.com/gilbertchen/duplicacy/src.(*ChunkOperator).Download(0xc000124280, 0xc001d70e20, 0x20, 0x7d02, 0x0, 0xc00010af08)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:152 +0x1e9
github.com/gilbertchen/duplicacy/src.(*SnapshotManager).CheckSnapshots.func3(0xc0000d60a0, 0xc00537e030, 0xc000726000, 0xc0076e2258, 0xc00537e070, 0xc13f9438b3e7b5f7, 0x17f0afdf593, 0x1c4db40, 0xc0005ce020, 0xc00537e020, ...)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_snapshotmanager.go:1080 +0xe5
created by github.com/gilbertchen/duplicacy/src.(*SnapshotManager).CheckSnapshots
	/Users/gchen/zincbox/duplicacy/src/duplicacy_snapshotmanager.go:1070 +0x248b

goroutine 40 [runnable]:
strconv.(*decimal).Shift(0xc00070f470, 0xffffffffffffffcf)
	/usr/local/go/src/strconv/decimal.go:315 +0xcc
strconv.bigFtoa(0xc000112208, 0x1, 0x44, 0x1, 0x66, 0x11e66ca1d11db7, 0x3, 0x1bc4020, 0x0, 0x0, ...)
	/usr/local/go/src/strconv/ftoa.go:164 +0xbd
strconv.genericFtoa(0xc000112208, 0x1, 0x44, 0x4021e66ca1d11db7, 0xc0000d6166, 0x1, 0x40, 0xc00070fc28, 0x2, 0x2)
	/usr/local/go/src/strconv/ftoa.go:155 +0x43c
strconv.AppendFloat(...)
	/usr/local/go/src/strconv/ftoa.go:54
fmt.(*fmt).fmtFloat(0xc0001121e0, 0x4021e66ca1d11db7, 0x40, 0x66, 0x6)
	/usr/local/go/src/fmt/format.go:496 +0x9d
fmt.(*pp).fmtFloat(0xc0001121a0, 0x4021e66ca1d11db7, 0x40, 0xc000000066)
	/usr/local/go/src/fmt/print.go:408 +0x73
fmt.(*pp).printArg(0xc0001121a0, 0x1119200, 0xc006e37698, 0x66)
	/usr/local/go/src/fmt/print.go:666 +0x351
fmt.(*pp).doPrintf(0xc0001121a0, 0x137caea, 0x2a, 0xc00070ff08, 0x6, 0x6)
	/usr/local/go/src/fmt/print.go:1122 +0x3fc
fmt.Sprintf(0x137caea, 0x2a, 0xc00070ff08, 0x6, 0x6, 0x1c32aa0, 0xc0006c0d80)
	/usr/local/go/src/fmt/print.go:219 +0x66
github.com/gilbertchen/duplicacy/src.logf(0x0, 0x135505f, 0xf, 0x137caea, 0x2a, 0xc00070ff08, 0x6, 0x6)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_log.go:137 +0x87
github.com/gilbertchen/duplicacy/src.LOG_INFO(...)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_log.go:99
github.com/gilbertchen/duplicacy/src.(*SnapshotManager).CheckSnapshots.func3(0xc0000d60a0, 0xc00537e030, 0xc000726000, 0xc0076e2258, 0xc00537e070, 0xc13f9438b3e7b5f7, 0x17f0afdf593, 0x1c4db40, 0xc0005ce020, 0xc00537e020, ...)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_snapshotmanager.go:1096 +0x5c6
created by github.com/gilbertchen/duplicacy/src.(*SnapshotManager).CheckSnapshots
	/Users/gchen/zincbox/duplicacy/src/duplicacy_snapshotmanager.go:1070 +0x248b

goroutine 41 [chan receive]:
github.com/gilbertchen/duplicacy/src.(*ChunkOperator).Download(0xc000124280, 0xc00632d7c0, 0x20, 0x7d06, 0x0, 0xc034bdff08)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:152 +0x1e9
github.com/gilbertchen/duplicacy/src.(*SnapshotManager).CheckSnapshots.func3(0xc0000d60a0, 0xc00537e030, 0xc000726000, 0xc0076e2258, 0xc00537e070, 0xc13f9438b3e7b5f7, 0x17f0afdf593, 0x1c4db40, 0xc0005ce020, 0xc00537e020, ...)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_snapshotmanager.go:1080 +0xe5
created by github.com/gilbertchen/duplicacy/src.(*SnapshotManager).CheckSnapshots
	/Users/gchen/zincbox/duplicacy/src/duplicacy_snapshotmanager.go:1070 +0x248b

goroutine 42 [chan receive]:
github.com/gilbertchen/duplicacy/src.(*ChunkOperator).Download(0xc000124280, 0xc00584d940, 0x20, 0x7d04, 0x0, 0xc000096f08)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:152 +0x1e9
github.com/gilbertchen/duplicacy/src.(*SnapshotManager).CheckSnapshots.func3(0xc0000d60a0, 0xc00537e030, 0xc000726000, 0xc0076e2258, 0xc00537e070, 0xc13f9438b3e7b5f7, 0x17f0afdf593, 0x1c4db40, 0xc0005ce020, 0xc00537e020, ...)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_snapshotmanager.go:1080 +0xe5
created by github.com/gilbertchen/duplicacy/src.(*SnapshotManager).CheckSnapshots
	/Users/gchen/zincbox/duplicacy/src/duplicacy_snapshotmanager.go:1070 +0x248b

goroutine 43 [chan receive]:
github.com/gilbertchen/duplicacy/src.(*ChunkOperator).Download(0xc000124280, 0xc00c5a2be0, 0x20, 0x7d01, 0x0, 0xc034be2f08)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:152 +0x1e9
github.com/gilbertchen/duplicacy/src.(*SnapshotManager).CheckSnapshots.func3(0xc0000d60a0, 0xc00537e030, 0xc000726000, 0xc0076e2258, 0xc00537e070, 0xc13f9438b3e7b5f7, 0x17f0afdf593, 0x1c4db40, 0xc0005ce020, 0xc00537e020, ...)
	/Users/gchen/zincbox/duplicacy/src/duplicacy_snapshotmanager.go:1080 +0xe5
created by github.com/gilbertchen/duplicacy/src.(*SnapshotManager).CheckSnapshots
	/Users/gchen/zincbox/duplicacy/src/duplicacy_snapshotmanager.go:1070 +0x248b

goroutine 171 [IO wait]:
internal/poll.runtime_pollWait(0x7f52c764c098, 0x72, 0xffffffffffffffff)
	/usr/local/go/src/runtime/netpoll.go:227 +0x55
internal/poll.(*pollDesc).wait(0xc0000bbc98, 0x72, 0x6d00, 0x70d0, 0xffffffffffffffff)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:87 +0x45
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Read(0xc0000bbc80, 0xc0202d6f6b, 0x6d50, 0x70d0, 0x0, 0x0, 0x0)
	/usr/local/go/src/internal/poll/fd_unix.go:166 +0x1d5
net.(*netFD).Read(0xc0000bbc80, 0xc0202d6f6b, 0x6d50, 0x70d0, 0x58c, 0x0, 0x0)
	/usr/local/go/src/net/fd_posix.go:55 +0x4f
net.(*conn).Read(0xc0005ce0d0, 0xc0202d6f6b, 0x6d50, 0x70d0, 0x0, 0x0, 0x0)
	/usr/local/go/src/net/net.go:183 +0x91
bufio.(*Reader).Read(0xc0006fd440, 0xc0202d6f6b, 0x6d50, 0x70d0, 0x58c, 0x0, 0x0)
	/usr/local/go/src/bufio/bufio.go:213 +0x142
io.ReadAtLeast(0x1531c00, 0xc0006fd440, 0xc0202d6000, 0x7cbb, 0x803b, 0x7cbb, 0x0, 0x0, 0x0)
	/usr/local/go/src/io/io.go:328 +0x87
io.ReadFull(...)
	/usr/local/go/src/io/io.go:347
golang.org/x/crypto/ssh.(*streamPacketCipher).readCipherPacket(0xc0000ba100, 0xc000b6d866, 0x1531c00, 0xc0006fd440, 0xc0202d6000, 0x386, 0x803b, 0x0, 0xc00010be78)
	/Users/gchen/zincbox/go/pkg/mod/golang.org/x/crypto@v0.0.0-20220131195533-30dcbda58838/ssh/cipher.go:198 +0x1d3
golang.org/x/crypto/ssh.(*connectionState).readPacket(0xc004976120, 0xc0006fd440, 0x405cc5, 0xc0006fd560, 0xc0001bc7e0, 0xc00010bfb0, 0xc00010bf20)
	/Users/gchen/zincbox/go/pkg/mod/golang.org/x/crypto@v0.0.0-20220131195533-30dcbda58838/ssh/transport.go:130 +0x68
golang.org/x/crypto/ssh.(*transport).readPacket(0xc004976120, 0xc0048f2800, 0xc0006fd5b8, 0x386, 0x0, 0x0)
	/Users/gchen/zincbox/go/pkg/mod/golang.org/x/crypto@v0.0.0-20220131195533-30dcbda58838/ssh/transport.go:114 +0x3b
golang.org/x/crypto/ssh.(*handshakeTransport).readOnePacket(0xc0003c6000, 0xc00010bf00, 0xc0048f2800, 0x386, 0x386, 0x0, 0x0)
	/Users/gchen/zincbox/go/pkg/mod/golang.org/x/crypto@v0.0.0-20220131195533-30dcbda58838/ssh/handshake.go:374 +0x50
golang.org/x/crypto/ssh.(*handshakeTransport).readLoop(0xc0003c6000)
	/Users/gchen/zincbox/go/pkg/mod/golang.org/x/crypto@v0.0.0-20220131195533-30dcbda58838/ssh/handshake.go:197 +0x4d
created by golang.org/x/crypto/ssh.newClientTransport
	/Users/gchen/zincbox/go/pkg/mod/golang.org/x/crypto@v0.0.0-20220131195533-30dcbda58838/ssh/handshake.go:134 +0x185

[cut because of character limit]

Also, I have no idea what the hex values in the error message mean, please inform me if this is something sensitive :wink:

1 Like

What CLI version are you running? This should be fixed in 3.2.0: Duplicacy CLI 3.2.3 release

You’re right, I’m using 3.1.0. Sorry for bothering you :confused: