panic: unaligned 64-bit atomic operation when using go1.22 in alpine
vamshiaruru opened this issue · comments
Hi everyone, since go1.22 was released recently, I tried upgrading to it. But I am facing the following error:
panic: unaligned 64-bit atomic operation
-> runtime/internal/atomic.panicUnaligned
-> /usr/local/go/src/runtime/internal/atomic/unaligned.go:8
runtime/internal/atomic.Xadd64
/usr/local/go/src/runtime/internal/atomic/atomic_386.s:125 +0x11
github.com/redis/rueidis.(*lru).Flight
/go/pkg/mod/github.com/redis/rueidis@v1.0.21/lru.go:124
github.com/redis/rueidis.(*pipe).DoCache
/go/pkg/mod/github.com/redis/rueidis@v1.0.21/pipe.go:1085
github.com/redis/rueidis.(*mux).DoCache
/go/pkg/mod/github.com/redis/rueidis@v1.0.21/mux.go:273
github.com/redis/rueidis.(*singleClient).DoCache
I am facing this issue only in alpine 3.19. My dockerfile is this
FROM golang:1.22-alpine3.19 as builder
RUN apk add git
RUN mkdir /code
WORKDIR /code
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY ./ ./
RUN go build -pgo=auto -o api cmd/api/*.go
FROM alpine:3.19 AS production
RUN wget -q -t3 'https://packages.doppler.com/public/cli/rsa.8004D9FF50437357.key' -O /etc/apk/keys/cli@doppler-8004D9FF50437357.rsa.pub && echo 'https://packages.doppler.com/public/cli/alpine/any-version/main' | tee -a /etc/apk/repositories && apk add doppler
RUN apk add --update --no-cache ca-certificates git tzdata
RUN mkdir /code
WORKDIR /code
COPY --from=builder /code .
CMD ["sh", "-c", "doppler run -- ./api"]
I am not sure if it is a bug with rueidis, or with go1.22. TIA for help!
Hi @vamshiaruru,
That was a bug fixed in rueidis 1.0.22 and I would suggest you to upgrade to the latest version.
Thank you @rueian ! Upgrading fixed it. I will close the issue :)