Skip to content

Use of atomic.Load64 against unaligned field causes panic on armv7 #3033

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

Closed
brandond opened this issue Dec 18, 2021 · 3 comments
Closed

Use of atomic.Load64 against unaligned field causes panic on armv7 #3033

brandond opened this issue Dec 18, 2021 · 3 comments

Comments

@brandond
Copy link

The atomic operation at

stats.OOMEvents = atomic.LoadUint64(&cd.oomEvents)

(added by #2829) performs an unaligned load on 32bit systems, or at least armv7l. This results in a panic:

panic: unaligned 64-bit atomic operation

goroutine 13904 [running]:
runtime/internal/atomic.panicUnaligned()
        /usr/local/go/src/runtime/internal/atomic/unaligned.go:8 +0x24
runtime/internal/atomic.Load64(0xfb9a2ec)
        /usr/local/go/src/runtime/internal/atomic/atomic_arm.s:286 +0x14
github.com/rancher/k3s/vendor/github.com/google/cadvisor/manager.(*containerData).updateStats(0xfb9a180)
        /go/src/github.com/rancher/k3s/vendor/github.com/google/cadvisor/manager/container.go:676 +0x438
github.com/rancher/k3s/vendor/github.com/google/cadvisor/manager.(*containerData).housekeepingTick(0xfb9a180, 0x12608b00, 0x5f5e100)
        /go/src/github.com/rancher/k3s/vendor/github.com/google/cadvisor/manager/container.go:587 +0x104
github.com/rancher/k3s/vendor/github.com/google/cadvisor/manager.(*containerData).housekeeping(0xfb9a180)
        /go/src/github.com/rancher/k3s/vendor/github.com/google/cadvisor/manager/container.go:535 +0x3c0
created by github.com/rancher/k3s/vendor/github.com/google/cadvisor/manager.(*containerData).Start
        /go/src/github.com/rancher/k3s/vendor/github.com/google/cadvisor/manager/container.go:122 +0x2c

This same code works fine on arm64 and amd64.

@brandond
Copy link
Author

cc @iwankgb @kragniz

@martadinata666
Copy link

#3029

@brandond
Copy link
Author

Thanks, didn't find that one when searching!

@iwankgb iwankgb closed this as completed Dec 26, 2021
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

3 participants