atomic icon indicating copy to clipboard operation
atomic copied to clipboard

Duration Store support int32

Open binbin0325 opened this issue 2 years ago • 1 comments

panic using the uatomic.Duration Store on a 32-bit system

panic: unaligned 64-bit atomic operation

goroutine 132 [running]:
runtime/internal/atomic.panicUnaligned()
        /home/ubuntu/BMI-HI3521A/go/src/runtime/internal/atomic/unaligned.go:8 +0x24
runtime/internal/atomic.Store64(0x45720ac, 0x3b9aca00)
        /home/ubuntu/BMI-HI3521A/go/src/runtime/internal/atomic/atomic_arm.s:301 +0x14
go.uber.org/atomic.(*Int64).Store(...)
        /StreamPlugins/gopath/pkg/mod/go.uber.org/[email protected]/int64.go:75
go.uber.org/atomic.(*Duration).Store(...)
        /StreamPlugins/gopath/pkg/mod/go.uber.org/[email protected]/duration.go:55

binbin0325 avatar Apr 01 '22 06:04 binbin0325

There's a note on bugs on the stdlib atomic package (which this package wraps): https://pkg.go.dev/sync/atomic#pkg-note-BUG

On ARM, 386, and 32-bit MIPS, it is the caller's responsibility to arrange for 64-bit alignment of 64-bit words accessed atomically. The first word in a variable or in an allocated struct, array, or slice can be relied upon to be 64-bit aligned.

Related issues: https://github.com/golang/go/issues/36606 https://github.com/golang/go/issues/599

prashantv avatar Apr 21 '22 03:04 prashantv