{"action":"created","issue":{"url":"https://api.github.com/repos/stampzilla/gozwave/issues/9","repository_url":"https://api.github.com/repos/stampzilla/gozwave","labels_url":"https://api.github.com/repos/stampzilla/gozwave/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/stampzilla/gozwave/issues/9/comments","events_url":"https://api.github.com/repos/stampzilla/gozwave/issues/9/events","html_url":"https://github.com/stampzilla/gozwave/issues/9","id":197404335,"number":9,"title":"data race crash","user":{"login":"bradfitz","id":2621,"avatar_url":"https://avatars.githubusercontent.com/u/2621?v=3","gravatar_id":"","url":"https://api.github.com/users/bradfitz","html_url":"https://github.com/bradfitz","followers_url":"https://api.github.com/users/bradfitz/followers","following_url":"https://api.github.com/users/bradfitz/following{/other_user}","gists_url":"https://api.github.com/users/bradfitz/gists{/gist_id}","starred_url":"https://api.github.com/users/bradfitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradfitz/subscriptions","organizations_url":"https://api.github.com/users/bradfitz/orgs","repos_url":"https://api.github.com/users/bradfitz/repos","events_url":"https://api.github.com/users/bradfitz/events{/privacy}","received_events_url":"https://api.github.com/users/bradfitz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-23T17:29:24Z","updated_at":"2016-12-26T10:20:08Z","closed_at":null,"body":"In Go 1.8, the runtime has improved always-on data race detection for maps (see https://beta.golang.org/doc/go1.8#mapiter).\r\n\r\nIt caught this bug, which crashes the whole program instead of letting memory be silently corrupted:\r\n\r\n```\r\nroot@raspberrypi:/home/pi# ./zwave-example -port=/dev/ttyUSB0\r\n[GIN-debug] [WARNING] Running in \"debug\" mode. Switch to \"release\" mode in production.\r\n - using env:   export GIN_MODE=release\r\n - using code:  gin.SetMode(gin.ReleaseMode)\r\n\r\n[GIN-debug] GET    /nodes                    --> main.nodes.func1 (3 handlers)\r\n[GIN-debug] GET    /nodes/:id/:action        --> main.control.func1 (3 handlers)\r\n[GIN-debug] Environment variable PORT is undefined. Using port :8080 by default\r\n[GIN-debug] Listening and serving HTTP on :8080\r\nINFO[0000] Sending: 01030002fe\r\nINFO[0000] Recived: 06\r\nINFO[0000] Recived: 0125010205001defffffffffff0700000000000000000000000000000000000000000000030100\r\nWARN[0000] Started identification on node 15\r\nWARN[0000] Started identification on node 6\r\nEvent: events.NodeDiscoverd{Address:4, FuncGetNodeProtocolInfo:functions.FuncGetNodeProtocolInfo{Listening:false, Routing:false, Beaming:false, Version:0x0, Flirs:false, Security:false, MaxBaud:0, Basic:0x0, Generic:0x0, Specific:0x0, data:[]uint8(nil)}}\r\nfatal error: concurrent map read and map write\r\n\r\ngoroutine 1 [running]:\r\nruntime.throw(0x508ac3, 0x21)\r\n        /home/bradfitz/go/src/runtime/panic.go:596 +0x70 fp=0x10a31edc sp=0x10a31ed0\r\nruntime.mapaccess1_fast32(0x4a2dd8, 0x10aeda20, 0x4, 0x0)\r\n        /home/bradfitz/go/src/runtime/hashmap_fast.go:21 +0x19c fp=0x10a31eec sp=0x10a31edc\r\ngithub.com/stampzilla/gozwave/nodes.List.Get(0x10aeda20, 0x10a17130, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4, 0x0)\r\n        /home/bradfitz/src/github.com/stampzilla/gozwave/nodes/list.go:50 +0x9c fp=0x10a31f08 sp=0x10a31eec\r\nmain.main()\r\n        /home/bradfitz/src/github.com/stampzilla/gozwave/zwave-example/example.go:38 +0x3b4 fp=0x10a31fbc sp=0x10a31f08\r\nruntime.main()\r\n        /home/bradfitz/go/src/runtime/proc.go:185 +0x1e4 fp=0x10a31fe4 sp=0x10a31fbc\r\nruntime.goexit()\r\n        /home/bradfitz/go/src/runtime/asm_arm.s:1017 +0x4 fp=0x10a31fe4 sp=0x10a31fe4\r\n```"},"comment":{"url":"https://api.github.com/repos/stampzilla/gozwave/issues/comments/269196684","html_url":"https://github.com/stampzilla/gozwave/issues/9#issuecomment-269196684","issue_url":"https://api.github.com/repos/stampzilla/gozwave/issues/9","id":269196684,"user":{"login":"stamp","id":1146381,"avatar_url":"https://avatars.githubusercontent.com/u/1146381?v=3","gravatar_id":"","url":"https://api.github.com/users/stamp","html_url":"https://github.com/stamp","followers_url":"https://api.github.com/users/stamp/followers","following_url":"https://api.github.com/users/stamp/following{/other_user}","gists_url":"https://api.github.com/users/stamp/gists{/gist_id}","starred_url":"https://api.github.com/users/stamp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stamp/subscriptions","organizations_url":"https://api.github.com/users/stamp/orgs","repos_url":"https://api.github.com/users/stamp/repos","events_url":"https://api.github.com/users/stamp/events{/privacy}","received_events_url":"https://api.github.com/users/stamp/received_events","type":"User","site_admin":false},"created_at":"2016-12-26T10:20:08Z","updated_at":"2016-12-26T10:20:08Z","body":"Its possible that I added to many. The problem is that there are many gorutines that uses the same map. Most of then are created by the Identify() method in nodes/nodes.go\r\n\r\nIf you checkout the d021d0e538a32e34d92d893fe58ac310d67e7983 commit an run the example with go run -race *.go you will see a lot of race conditions"}}
{"actor":{"display_login":"stamp"}}