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

sync/atomic: CompareAndSwapInt64 in 386 #23281

Closed
johnzhd opened this issue Dec 29, 2017 · 1 comment
Closed

sync/atomic: CompareAndSwapInt64 in 386 #23281

johnzhd opened this issue Dec 29, 2017 · 1 comment

Comments

@johnzhd
Copy link

johnzhd commented Dec 29, 2017

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.9.2 windows/amd64

Does this issue reproduce with the latest release?

I'm not sure.

What operating system and processor architecture are you using (go env)?

gox -osarch="windows/386" ./app  

What did you do?

type DStatus int64  
  
// ...  
  
p := (*int64)(&Status)
atomic.CompareAndSwapInt64(p, int64(DStatusSleep), int64(DStatusWaiting))

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

http: panic serving 127.0.0.1:62185: runtime error: invalid
memory address or nil pointer dereference
goroutine 4

What did you expect?

Move this error from running time to compile time.
Find out special actions on 64bit ptr in 386 target, Then warning it and fail.

Golang is great, and it save me lots of time.
Thank you.

@davecheney
Copy link
Contributor

Duplicate of #599

@davecheney davecheney marked this as a duplicate of #599 Dec 29, 2017
@mvdan mvdan closed this as completed Dec 29, 2017
@mikioh mikioh changed the title atomic.CompareAndSwapInt64 in 386 sync/atomic: CompareAndSwapInt64 in 386 Jan 5, 2018
@golang golang locked and limited conversation to collaborators Jan 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants