Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duration Store support int32 #105

Open
binbin0325 opened this issue Apr 1, 2022 · 1 comment
Open

Duration Store support int32 #105

binbin0325 opened this issue Apr 1, 2022 · 1 comment

Comments

@binbin0325
Copy link

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
@prashantv
Copy link
Collaborator

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:
golang/go#36606
golang/go#599

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants