`check` crashed

Please describe what you are doing to trigger the bug:

Duplicacy CLI version 3.2.3 (254953) on x64 Linux.

$ duplicacy check -tabular -chunks -threads 2 -persist -id test

Default storage is local disk.

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

Check finishes and reports any damaged chunks.

Please describe what actually happens (the wrong behaviour):

Verified chunk ad0e587508c24aaa36e36130b3e2df3827f3eb3d120cd86238807dd79f2cc54d (33037/146056), 43.90MB/s 03:31:58 22.6%
Failed to decrypt the chunk 492ee84cd5e7e37c4f19a32d3eb71cf80a3219660d3a52777022038882497bb5: cipher: message authentication failed; retrying
Failed to decrypt the chunk 492ee84cd5e7e37c4f19a32d3eb71cf80a3219660d3a52777022038882497bb5: cipher: message authentication failed; retrying
Failed to decrypt the chunk 492ee84cd5e7e37c4f19a32d3eb71cf80a3219660d3a52777022038882497bb5: cipher: message authentication failed; retrying
Failed to decrypt the chunk 492ee84cd5e7e37c4f19a32d3eb71cf80a3219660d3a52777022038882497bb5: cipher: message authentication failed
Verified chunk 492ee84cd5e7e37c4f19a32d3eb71cf80a3219660d3a52777022038882497bb5 (33038/146056), 43.90MB/s 03:31:58 22.6%
Verified chunk f75d6985fe4638a00a21d7d64844d5dbb9ac083137a9075c143619a945cad909 (33039/146056), 43.90MB/s 03:31:58 22.6%
Verified chunk d8330f8c90f478e38583564c83a83f5f4d867291ec16124a0c5d96b95cf97fca (33040/146056), 43.90MB/s 03:31:58 22.6%
Verified chunk 4ea52a8e64f4239ef33e66b15eda1b46cc2dc234e02d698acbe6c0fc443e596d (33041/146056), 43.90MB/s 03:31:57 22.6%
The chunk eaffd7e72f124a507cb600a66d8acf2835be76bb4969dc840af16046b973803a has a hash id of 4ea52a8e64f4239ef33e66b15eda1b46cc2dc234e02d698acbe6c0fc443e596d; retrying
Verified chunk 61a7dd3746efe608c0343da38a7ebefe7a3d01d9f5ddc0bd33fb81e29ee1839f (33042/146056), 43.90MB/s 03:31:57 22.6%
runtime error: invalid memory address or nil pointer dereference
goroutine 22 [running]:
runtime/debug.Stack()
        /usr/local/go/src/runtime/debug/stack.go:24 +0x65
runtime/debug.PrintStack()
        /usr/local/go/src/runtime/debug/stack.go:16 +0x19
github.com/gilbertchen/duplicacy/src.CatchLogException()
        /Users/gchen/zincbox/duplicacy/src/duplicacy_log.go:233 +0xad
panic({0x10fc040, 0x1c93710})
        /usr/local/go/src/runtime/panic.go:884 +0x212
github.com/gilbertchen/duplicacy/src.(*Chunk).GetID(0xc00050c5a0)
        /Users/gchen/zincbox/duplicacy/src/duplicacy_chunk.go:171 +0x3a
github.com/gilbertchen/duplicacy/src.(*ChunkOperator).DownloadChunk(0xc0000001e0, 0x0?, {0x0, {0xc000589b00, 0x40}, {0xc001d247e0, 0x20}, 0x8110, {0x0, 0x0}, ...})
        /Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:435 +0xa16
github.com/gilbertchen/duplicacy/src.(*ChunkOperator).Run(0xc0000001e0?, 0x0?, {0x0, {0xc000589b00, 0x40}, {0xc001d247e0, 0x20}, 0x8110, {0x0, 0x0}, ...})
        /Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:184 +0x1098
github.com/gilbertchen/duplicacy/src.CreateChunkOperator.func1(0x0?)
        /Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:92 +0xe5
created by github.com/gilbertchen/duplicacy/src.CreateChunkOperator
        /Users/gchen/zincbox/duplicacy/src/duplicacy_chunkoperator.go:87 +0x20c
Added 33042 chunks to the list of verified chunks

What’s strange is that chunk 492ee84cd5e7e37c4f19a32d3eb71cf80a3219660d3a52777022038882497bb5 failed to decrypt first, but after retrying it became verified. How come? Local disk storage is btrfs RAID1 and it didn’t report any I/O errors. dmesg does not report any hard disk error either.

Which storage backed is this? A failed download followed by a successful one can be caused by some issue with the storage server. However, in this case an invalid pointer happened right after the download, which indicated memory corruption was more likely.

Memory corruption is highly unlikely since this check crashed on a rather recent 14th-gen Dell PowerEdge server with ECC memory.

Unless the corrupted chunk causes the nil pointer?