aerospike / aerospike-client-go

Aerospike Client Go
Apache License 2.0
430 stars 199 forks source link

panic: unaligned 64-bit atomic operation in Cluster.tend (on 32bit) #401

Closed ncabatoff closed 1 year ago

ncabatoff commented 1 year ago

In the Vault repo we run nightly tests with 32bit builds (GOARCH=386), and last night observed this panic in our TestAerospikeBackend:

panic: unaligned 64-bit atomic operation

goroutine 28 [running]:
runtime/internal/atomic.panicUnaligned()
    /home/runner/actions-runner/_work/_tool/go/1.20.3/x64/src/runtime/internal/atomic/unaligned.go:8 +0x2d
runtime/internal/atomic.Load64(0x90f0694)
    /home/runner/actions-runner/_work/_tool/go/1.20.3/x64/src/runtime/internal/atomic/atomic_386.s:225 +0x10
github.com/aerospike/aerospike-client-go/v5/internal/atomic.(*Int).Get(...)
    /home/runner/go/pkg/mod/github.com/aerospike/aerospike-client-go/v5@v5.6.0/internal/atomic/int.go:53
github.com/aerospike/aerospike-client-go/v5.(*Node).verifyPeersGeneration(0x90f0600, 0x9404020, 0x9097e30)
    /home/runner/go/pkg/mod/github.com/aerospike/aerospike-client-go/v5@v5.6.0/node.go:305 +0x113
github.com/aerospike/aerospike-client-go/v5.(*Node).Refresh(0x90f0600, 0x9097e30)
    /home/runner/go/pkg/mod/github.com/aerospike/aerospike-client-go/v5@v5.6.0/node.go:145 +0x22b
github.com/aerospike/aerospike-client-go/v5.(*Cluster).tend.func1(0x90f0600)
    /home/runner/go/pkg/mod/github.com/aerospike/aerospike-client-go/v5@v5.6.0/cluster.go:261 +0x68
created by github.com/aerospike/aerospike-client-go/v5.(*Cluster).tend
    /home/runner/go/pkg/mod/github.com/aerospike/aerospike-client-go/v5@v5.6.0/cluster.go:259 +0x29c

Technically the failure was in the vault-enterprise repo, but I don't believe there's anything specific to it, we just don't run these nightly 32-bit tests on the OSS repo.

Our go.mod has

github.com/aerospike/aerospike-client-go/v5 v5.6.0
khaf commented 1 year ago

Thanks for your report, appreciate it. Unfortunately we don't really support 32bit architectures due to the way client returns its results (which is set as int in the bad old days, but should have been int64. Since everyone uses .(int) to cast interfaces in Go, changing that would break way too much user code). Is vault used on 32bit extensively with Aerospike?

ncabatoff commented 1 year ago

Hi @khaf, sorry I missed your reply.

Is vault used on 32bit extensively with Aerospike?

I have no way of knowing. My assumption is that vault isn't used on 32-bit much at all, with Aerospike or otherwise, but that's a guess. Maybe I should have the nightly 32bit tests skip Aerospike, and we should flag it as unsupported for 32-bit archs in our docs.

khaf commented 1 year ago

Hi @ncabatoff , thank you for following up. Yes I believe marking it as unsupported and disabling the tests for 32bit would be the better course of action for now.

ncabatoff commented 1 year ago

Hi @ncabatoff , thank you for following up. Yes I believe marking it as unsupported and disabling the tests for 32bit would be the better course of action for now.

I've done so. I'll close this issue now, since you don't support 32-bit. Thanks!