{"action":"opened","issue":{"url":"https://api.github.com/repos/golang/go/issues/17976","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/17976/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/17976/comments","events_url":"https://api.github.com/repos/golang/go/issues/17976/events","html_url":"https://github.com/golang/go/issues/17976","id":190299947,"number":17976,"title":"Possible allocation issue on multiprocessor machines","user":{"login":"lummie","id":10104816,"avatar_url":"https://avatars.githubusercontent.com/u/10104816?v=3","gravatar_id":"","url":"https://api.github.com/users/lummie","html_url":"https://github.com/lummie","followers_url":"https://api.github.com/users/lummie/followers","following_url":"https://api.github.com/users/lummie/following{/other_user}","gists_url":"https://api.github.com/users/lummie/gists{/gist_id}","starred_url":"https://api.github.com/users/lummie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lummie/subscriptions","organizations_url":"https://api.github.com/users/lummie/orgs","repos_url":"https://api.github.com/users/lummie/repos","events_url":"https://api.github.com/users/lummie/events{/privacy}","received_events_url":"https://api.github.com/users/lummie/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-18T11:42:47Z","updated_at":"2016-11-18T11:42:47Z","closed_at":null,"body":"### What version of Go are you using (`go version`)?\r\ngo version go1.7.3 linux/amd64\r\n\r\n### What operating system and processor architecture are you using (`go env`)?\r\nlinux/amd64\r\n32 cpu - Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz \r\n\r\n### What did you do?\r\nhttps://play.golang.org/p/jcpEGvgWFm\r\n\r\nI have a Message structure that I am sending and receiving from a channel. the first go routine asks for Messages from a sync.pool, ensures the Values and Fields properties are empty and sends the message to a channel. When all the messages have been sent the channel is closed\r\n\r\nThe receiver uses range to take a message of the channel, alters the Fields and Values and then gives the message back to the pool.\r\n\r\nEventually a message from the pool is re-used and has Fields and Values set.  These are then reset back to zero length map and array but sometimes this fails and the length of fields is > 0 causing the panic.\r\n\r\nNote : this does not seem to exhibit the issue on the playground, however ti is fairly consistent on an SMP machine, certainly on my 16 core HT machine.\r\n\r\n### What did you expect to see?\r\nI do not expect a panic to occur, the Fields and Values should be zero length\r\n\r\n### What did you see instead?\r\npanic: Fields greater than zero\r\ngoroutine 4 [running]:\r\npanic(0x459e40, 0xc42000a190)\r\n\t/usr/local/go/src/runtime/panic.go:500 +0x1a1\r\nmain.main.func1(0xc420092060)\r\n\t/home/I049472/godev/src/matt/epic/examples/test/test2.go:37 +0x1b4\r\ncreated by main.main\r\n\t/home/I049472/godev/src/matt/epic/examples/test/test2.go:42 +0x8a\r\nexit status 2\r\n\r\n\r\nInterestingly if I remove the modification of the Values array, which is obviously not even checked in the panic, then the issue does not arise.\r\nhttps://play.golang.org/p/xwrJicCgYA\r\n\r\n\r\n"}}
{"actor":{"display_login":"lummie"}}