This bug does not appear (at least with the same test code) on the development version
(go version devel +93ad232384f8 Fri Apr 11 10:11:21 2014 -0700 linux/amd64) and may
therefore be already fixed.
The combination of go 1.2, the race detector, a map of pointers and a function returning
two values somehow results in a nil dereference on linux/x86_64.
What does 'go version' print?
go version go1.2.1 linux/amd64
What steps reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. Compile http://play.golang.org/p/0fIDCUE2m2c with "-race"
2. Run it
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x400c52]
goroutine 1 [running]:
What should have happened instead?
Either uncommenting the seemingly nop read from the map or compiling without
"-race" makes the segfault not happen.
The text was updated successfully, but these errors were encountered:
This appears to be fixed at tip.
odessa(~/src) % go run -race rr.go
odessa(~/src) % go version
go version devel +8e553855d1a3 Thu Apr 10 21:46:00 2014 -0700 + darwin/amd64
As it is very unlikely that there will be a 1.2.2 release, I'm making this issue fixed
for Go 1.3