{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/12099","labels_url":"https://api.github.com/repos/golang/go/issues/12099/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/12099/comments","events_url":"https://api.github.com/repos/golang/go/issues/12099/events","html_url":"https://github.com/golang/go/issues/12099","id":100152734,"number":12099,"title":"net/http: must not copy tls.Config","user":{"login":"rsc","id":104030,"avatar_url":"https://avatars.githubusercontent.com/u/104030?v=3","gravatar_id":"","url":"https://api.github.com/users/rsc","html_url":"https://github.com/rsc","followers_url":"https://api.github.com/users/rsc/followers","following_url":"https://api.github.com/users/rsc/following{/other_user}","gists_url":"https://api.github.com/users/rsc/gists{/gist_id}","starred_url":"https://api.github.com/users/rsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsc/subscriptions","organizations_url":"https://api.github.com/users/rsc/orgs","repos_url":"https://api.github.com/users/rsc/repos","events_url":"https://api.github.com/users/rsc/events{/privacy}","received_events_url":"https://api.github.com/users/rsc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"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},"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/1","html_url":"https://github.com/golang/go/milestones/Go1.5","labels_url":"https://api.github.com/repos/golang/go/milestones/1/labels","id":905105,"number":1,"title":"Go1.5","description":"","creator":{"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},"open_issues":4,"closed_issues":1155,"state":"open","created_at":"2014-12-16T02:26:41Z","updated_at":"2015-08-16T00:29:59Z","due_on":"2015-07-31T04:00:00Z","closed_at":null},"comments":7,"created_at":"2015-08-10T19:48:21Z","updated_at":"2015-08-16T02:00:19Z","closed_at":null,"body":"net/http/transport says:\n\n\t\tcfg := t.TLSClientConfig\n\t\tif cfg == nil || cfg.ServerName == \"\" {\n\t\t\thost := cm.tlsHost()\n\t\t\tif cfg == nil {\n\t\t\t\tcfg = &tls.Config{ServerName: host}\n\t\t\t} else {\n\t\t\t\tclone := *cfg // shallow clone\n\t\t\t\tclone.ServerName = host\n\t\t\t\tcfg = &clone\n\t\t\t}\n\t\t}\n\nBut that line `clone := *cfg` is copying the entire tls.Config, including the sync.Once. That's not okay.\n\nIn particular if you arrange things right, you can get the copy to be going on at about the same time something else is calling cfg.serverInitOnce.Do, and then the write during the mutex races with the read from the copy, causing the race detector to report a race (and it is a real race, too; the copy will never be unlocked and will cause a deadlock).\n\nReported by a race detector run in a larger Google program.\n\nNeed to fix for Go 1.5."},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/131476722","html_url":"https://github.com/golang/go/issues/12099#issuecomment-131476722","issue_url":"https://api.github.com/repos/golang/go/issues/12099","id":131476722,"user":{"login":"gopherbot","id":8566911,"avatar_url":"https://avatars.githubusercontent.com/u/8566911?v=3","gravatar_id":"","url":"https://api.github.com/users/gopherbot","html_url":"https://github.com/gopherbot","followers_url":"https://api.github.com/users/gopherbot/followers","following_url":"https://api.github.com/users/gopherbot/following{/other_user}","gists_url":"https://api.github.com/users/gopherbot/gists{/gist_id}","starred_url":"https://api.github.com/users/gopherbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gopherbot/subscriptions","organizations_url":"https://api.github.com/users/gopherbot/orgs","repos_url":"https://api.github.com/users/gopherbot/repos","events_url":"https://api.github.com/users/gopherbot/events{/privacy}","received_events_url":"https://api.github.com/users/gopherbot/received_events","type":"User","site_admin":false},"created_at":"2015-08-16T02:00:19Z","updated_at":"2015-08-16T02:00:19Z","body":"CL https://golang.org/cl/13646 mentions this issue."}}