You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
run this http://play.golang.org/p/0dDl9sr7_R on windows/386
What is the expected output?
didn't panic
What do you see instead?
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x4171ac]
goroutine 1 [running]:
sync/atomic.AddUint64()
C:/Go/src/pkg/sync/atomic/asm_386.s:69 +0xc
main.main()
C:/Users/Syndtr/testatom/main.go:15 +0x45
goroutine 2 [runnable]:
exit status 2
Which compiler are you using (5g, 6g, 8g, gccgo)?
8g
Which operating system are you using?
windows
Which version are you using? (run 'go version')
go version devel +d58997478ec6 Mon Apr 08 00:09:35 2013 -0700 windows/386
This only happen if struct contains unsafe.Pointer field.
The text was updated successfully, but these errors were encountered:
The caller of 64-bit atomic operation must make sure the
pointer address is aligned to 8-byte boundary.
http://play.golang.org/p/fRMRT2Jzsh
Quote BUGS section of docs for sync/atomic:
BUGS
On x86-32, the 64-bit functions use instructions unavailable before the
Pentium MMX. On both ARM and x86-32, it is the caller's responsibility to
arrange for 64-bit alignment of 64-bit words accessed atomically. The
first word in a global variable or in an allocated struct or slice can be
relied upon to be 64-bit aligned.
The text was updated successfully, but these errors were encountered: