-
Notifications
You must be signed in to change notification settings - Fork 68
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
A compatibility bug on ARM V7 #17
Comments
Can you try with go 1.17?
…On Wed, 29 Dec 2021 at 5:41 pm zhaoxin ***@***.***> wrote:
*Describe the bug*
Run time.Sleep(ws.backoff.Duration()) \\ ws.backoff != nil in arm v7 get
a runtime error:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x11e34]
goroutine 51 [running]:
runtime/internal/atomic.goXadd64(0x3db8bcc, 0x1, 0x0, 0x3ea8000, 0x3e9a5e8)
/usr/local/go/src/runtime/internal/atomic/atomic_arm.go:103 +0x1cgithub.com/jpillora/backoff.(*Backoff).Duration(0x3db8bcc, 0xf20220, 0x1cbc5c8)
***@***.***/backoff.go:30 +0x30
*Environment:*
Infrastructure: on raspberry pi (arm32v7)
version: github.com/jpillora/backoff v1.0.0
go version: 1.13
*Analyze:*
The details of what operating system (specifically that it was 32bit) were
key here to figuring this one out!
Note, this has to be defined first to make sure it is aligned properly for
32bit ARM OS
From https://golang.org/pkg/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.
—
Reply to this email directly, view it on GitHub
<#17>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAE2X42OAYS24EZQZDIFFSTUTKUQNANCNFSM5K5MJMSQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
In go1.17.5, this problem still exists. |
"@jpillora Our team is using Here is the panic stack trace:
I must mention that we have previously encountered this issue in our own code, and we resolved it by using an appropriate atomic operation for 32-bit processors: This fork has already made this change. |
https://pkg.go.dev/sync/atomic#pkg-note-BUG says:
|
Describe the bug
Run
time.Sleep(ws.backoff.Duration()) \\ ws.backoff != nil
in arm v7 get a runtime error:Environment:
Analyze:
The text was updated successfully, but these errors were encountered: