{"action":"created","comment":{"url":"https://api.github.com/repos/docker/libnetwork/pulls/comments/88076687","pull_request_review_id":8661466,"id":88076687,"diff_hunk":"@@ -427,7 +427,13 @@ func (sb *sandbox) ResolveIP(ip string) string {\n }\n \n func (sb *sandbox) ExecFunc(f func()) error {\n-\treturn sb.osSbox.InvokeFunc(f)\n+\tsb.Lock()\n+\tosSbox := sb.osSbox\n+\tsb.Unlock()\n+\tif osSbox != nil {\n+\t\treturn sb.osSbox.InvokeFunc(f)","path":"sandbox.go","position":9,"original_position":9,"commit_id":"34be085eda0117cc13d03a8c027559eccfbaad7a","original_commit_id":"34be085eda0117cc13d03a8c027559eccfbaad7a","user":{"login":"aboch","id":10080882,"avatar_url":"https://avatars.githubusercontent.com/u/10080882?v=3","gravatar_id":"","url":"https://api.github.com/users/aboch","html_url":"https://github.com/aboch","followers_url":"https://api.github.com/users/aboch/followers","following_url":"https://api.github.com/users/aboch/following{/other_user}","gists_url":"https://api.github.com/users/aboch/gists{/gist_id}","starred_url":"https://api.github.com/users/aboch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aboch/subscriptions","organizations_url":"https://api.github.com/users/aboch/orgs","repos_url":"https://api.github.com/users/aboch/repos","events_url":"https://api.github.com/users/aboch/events{/privacy}","received_events_url":"https://api.github.com/users/aboch/received_events","type":"User","site_admin":false},"body":"You are still accessing `sb.osSbox` outside lock.\r\nThat could have been set to nil before `sb.osSbox.InvokeFunc(f)` gets a chance to run","created_at":"2016-11-15T18:06:59Z","updated_at":"2016-11-15T18:06:59Z","html_url":"https://github.com/docker/libnetwork/pull/1556#discussion_r88076687","pull_request_url":"https://api.github.com/repos/docker/libnetwork/pulls/1556","_links":{"self":{"href":"https://api.github.com/repos/docker/libnetwork/pulls/comments/88076687"},"html":{"href":"https://github.com/docker/libnetwork/pull/1556#discussion_r88076687"},"pull_request":{"href":"https://api.github.com/repos/docker/libnetwork/pulls/1556"}}},"pull_request":{"url":"https://api.github.com/repos/docker/libnetwork/pulls/1556","id":93815920,"html_url":"https://github.com/docker/libnetwork/pull/1556","diff_url":"https://github.com/docker/libnetwork/pull/1556.diff","patch_url":"https://github.com/docker/libnetwork/pull/1556.patch","issue_url":"https://api.github.com/repos/docker/libnetwork/issues/1556","number":1556,"state":"open","locked":false,"title":"Add a nil check before accessing sandbox.osSbox","user":{"login":"sanimej","id":10071849,"avatar_url":"https://avatars.githubusercontent.com/u/10071849?v=3","gravatar_id":"","url":"https://api.github.com/users/sanimej","html_url":"https://github.com/sanimej","followers_url":"https://api.github.com/users/sanimej/followers","following_url":"https://api.github.com/users/sanimej/following{/other_user}","gists_url":"https://api.github.com/users/sanimej/gists{/gist_id}","starred_url":"https://api.github.com/users/sanimej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanimej/subscriptions","organizations_url":"https://api.github.com/users/sanimej/orgs","repos_url":"https://api.github.com/users/sanimej/repos","events_url":"https://api.github.com/users/sanimej/events{/privacy}","received_events_url":"https://api.github.com/users/sanimej/received_events","type":"User","site_admin":false},"body":"Following panic was reported by one of the docker users..\r\n\r\n```\r\nNov 14 18:43:17 docker-demo9-d dockerd[1732]: panic: runtime error: invalid memory address or nil pointer dereference\r\nNov 14 18:43:17 docker-demo9-d dockerd[1732]: [signal 0xb code=0x1 addr=0x58 pc=0x8c1b44]\r\nNov 14 18:43:17 docker-demo9-d dockerd[1732]: goroutine 52749 [running]:\r\nNov 14 18:43:17 docker-demo9-d dockerd[1732]: panic(0x1a9cb40, 0xc82000a080)\r\nNov 14 18:43:17 docker-demo9-d dockerd[1732]: /usr/local/go/src/runtime/panic.go:481 +0x3e6\r\nNov 14 18:43:17 docker-demo9-d dockerd[1732]: github.com/docker/libnetwork.(*sandbox).execFunc(0xc82026c000, 0xc820fae450)\r\nNov 14 18:43:17 docker-demo9-d dockerd[1732]: /root/rpmbuild/BUILD/docker-engine/vendor/src/github.com/docker/libnetwork/sandbox.go:440 +0x44\r\nNov 14 18:43:17 docker-demo9-d dockerd[1732]: github.com/docker/libnetwork.(*resolver).ServeDNS(0xc820427a70, 0x7fd91c0d5120, 0xc820e19810, 0xc820294120)\r\nNov 14 18:43:17 docker-demo9-d dockerd[1732]: /root/rpmbuild/BUILD/docker-engine/vendor/src/github.com/docker/libnetwork/resolver.go:357 +0x665\r\nNov 14 18:43:17 docker-demo9-d dockerd[1732]: github.com/miekg/dns.(*Server).serve(0xc821492820, 0x7fd9218f7a08, 0xc82158a120, 0x7fd91c0d4378, 0xc820427a70, 0xc8210d7200, 0x26, 0x200, 0xc82015e390, 0xc821b862a0, ...)\r\n```\r\n\r\nIts not clear in what can situation sb.osSbox can be nil for a running container. One possibility is the container going down while the query is still being processed. Added a error message which should help in identifying the specific case.\r\n\r\nSigned-off-by: Santhosh Manohar <santhosh@docker.com>","created_at":"2016-11-15T17:55:39Z","updated_at":"2016-11-15T18:06:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a1ba65d9515d13fdec6f46d89f5ea6559c06d5bb","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/docker/libnetwork/pulls/1556/commits","review_comments_url":"https://api.github.com/repos/docker/libnetwork/pulls/1556/comments","review_comment_url":"https://api.github.com/repos/docker/libnetwork/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/libnetwork/issues/1556/comments","statuses_url":"https://api.github.com/repos/docker/libnetwork/statuses/34be085eda0117cc13d03a8c027559eccfbaad7a","head":{"label":"sanimej:nilsb","ref":"nilsb","sha":"34be085eda0117cc13d03a8c027559eccfbaad7a","user":{"login":"sanimej","id":10071849,"avatar_url":"https://avatars.githubusercontent.com/u/10071849?v=3","gravatar_id":"","url":"https://api.github.com/users/sanimej","html_url":"https://github.com/sanimej","followers_url":"https://api.github.com/users/sanimej/followers","following_url":"https://api.github.com/users/sanimej/following{/other_user}","gists_url":"https://api.github.com/users/sanimej/gists{/gist_id}","starred_url":"https://api.github.com/users/sanimej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanimej/subscriptions","organizations_url":"https://api.github.com/users/sanimej/orgs","repos_url":"https://api.github.com/users/sanimej/repos","events_url":"https://api.github.com/users/sanimej/events{/privacy}","received_events_url":"https://api.github.com/users/sanimej/received_events","type":"User","site_admin":false},"repo":{"id":39800598,"name":"libnetwork","full_name":"sanimej/libnetwork","owner":{"login":"sanimej","id":10071849,"avatar_url":"https://avatars.githubusercontent.com/u/10071849?v=3","gravatar_id":"","url":"https://api.github.com/users/sanimej","html_url":"https://github.com/sanimej","followers_url":"https://api.github.com/users/sanimej/followers","following_url":"https://api.github.com/users/sanimej/following{/other_user}","gists_url":"https://api.github.com/users/sanimej/gists{/gist_id}","starred_url":"https://api.github.com/users/sanimej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanimej/subscriptions","organizations_url":"https://api.github.com/users/sanimej/orgs","repos_url":"https://api.github.com/users/sanimej/repos","events_url":"https://api.github.com/users/sanimej/events{/privacy}","received_events_url":"https://api.github.com/users/sanimej/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sanimej/libnetwork","description":"networking for containers","fork":true,"url":"https://api.github.com/repos/sanimej/libnetwork","forks_url":"https://api.github.com/repos/sanimej/libnetwork/forks","keys_url":"https://api.github.com/repos/sanimej/libnetwork/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sanimej/libnetwork/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sanimej/libnetwork/teams","hooks_url":"https://api.github.com/repos/sanimej/libnetwork/hooks","issue_events_url":"https://api.github.com/repos/sanimej/libnetwork/issues/events{/number}","events_url":"https://api.github.com/repos/sanimej/libnetwork/events","assignees_url":"https://api.github.com/repos/sanimej/libnetwork/assignees{/user}","branches_url":"https://api.github.com/repos/sanimej/libnetwork/branches{/branch}","tags_url":"https://api.github.com/repos/sanimej/libnetwork/tags","blobs_url":"https://api.github.com/repos/sanimej/libnetwork/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sanimej/libnetwork/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sanimej/libnetwork/git/refs{/sha}","trees_url":"https://api.github.com/repos/sanimej/libnetwork/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sanimej/libnetwork/statuses/{sha}","languages_url":"https://api.github.com/repos/sanimej/libnetwork/languages","stargazers_url":"https://api.github.com/repos/sanimej/libnetwork/stargazers","contributors_url":"https://api.github.com/repos/sanimej/libnetwork/contributors","subscribers_url":"https://api.github.com/repos/sanimej/libnetwork/subscribers","subscription_url":"https://api.github.com/repos/sanimej/libnetwork/subscription","commits_url":"https://api.github.com/repos/sanimej/libnetwork/commits{/sha}","git_commits_url":"https://api.github.com/repos/sanimej/libnetwork/git/commits{/sha}","comments_url":"https://api.github.com/repos/sanimej/libnetwork/comments{/number}","issue_comment_url":"https://api.github.com/repos/sanimej/libnetwork/issues/comments{/number}","contents_url":"https://api.github.com/repos/sanimej/libnetwork/contents/{+path}","compare_url":"https://api.github.com/repos/sanimej/libnetwork/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sanimej/libnetwork/merges","archive_url":"https://api.github.com/repos/sanimej/libnetwork/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sanimej/libnetwork/downloads","issues_url":"https://api.github.com/repos/sanimej/libnetwork/issues{/number}","pulls_url":"https://api.github.com/repos/sanimej/libnetwork/pulls{/number}","milestones_url":"https://api.github.com/repos/sanimej/libnetwork/milestones{/number}","notifications_url":"https://api.github.com/repos/sanimej/libnetwork/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sanimej/libnetwork/labels{/name}","releases_url":"https://api.github.com/repos/sanimej/libnetwork/releases{/id}","deployments_url":"https://api.github.com/repos/sanimej/libnetwork/deployments","created_at":"2015-07-27T22:17:26Z","updated_at":"2015-07-27T22:17:27Z","pushed_at":"2016-11-15T18:02:43Z","git_url":"git://github.com/sanimej/libnetwork.git","ssh_url":"git@github.com:sanimej/libnetwork.git","clone_url":"https://github.com/sanimej/libnetwork.git","svn_url":"https://github.com/sanimej/libnetwork","homepage":"","size":10243,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"docker:master","ref":"master","sha":"be377dc49fe399d4ad0af957f084436c41a7877b","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":31046054,"name":"libnetwork","full_name":"docker/libnetwork","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/libnetwork","description":"Docker Networking","fork":false,"url":"https://api.github.com/repos/docker/libnetwork","forks_url":"https://api.github.com/repos/docker/libnetwork/forks","keys_url":"https://api.github.com/repos/docker/libnetwork/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/libnetwork/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/libnetwork/teams","hooks_url":"https://api.github.com/repos/docker/libnetwork/hooks","issue_events_url":"https://api.github.com/repos/docker/libnetwork/issues/events{/number}","events_url":"https://api.github.com/repos/docker/libnetwork/events","assignees_url":"https://api.github.com/repos/docker/libnetwork/assignees{/user}","branches_url":"https://api.github.com/repos/docker/libnetwork/branches{/branch}","tags_url":"https://api.github.com/repos/docker/libnetwork/tags","blobs_url":"https://api.github.com/repos/docker/libnetwork/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/libnetwork/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/libnetwork/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/libnetwork/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/libnetwork/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/libnetwork/languages","stargazers_url":"https://api.github.com/repos/docker/libnetwork/stargazers","contributors_url":"https://api.github.com/repos/docker/libnetwork/contributors","subscribers_url":"https://api.github.com/repos/docker/libnetwork/subscribers","subscription_url":"https://api.github.com/repos/docker/libnetwork/subscription","commits_url":"https://api.github.com/repos/docker/libnetwork/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/libnetwork/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/libnetwork/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/libnetwork/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/libnetwork/contents/{+path}","compare_url":"https://api.github.com/repos/docker/libnetwork/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/libnetwork/merges","archive_url":"https://api.github.com/repos/docker/libnetwork/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/libnetwork/downloads","issues_url":"https://api.github.com/repos/docker/libnetwork/issues{/number}","pulls_url":"https://api.github.com/repos/docker/libnetwork/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/libnetwork/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/libnetwork/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/libnetwork/labels{/name}","releases_url":"https://api.github.com/repos/docker/libnetwork/releases{/id}","deployments_url":"https://api.github.com/repos/docker/libnetwork/deployments","created_at":"2015-02-20T01:20:15Z","updated_at":"2016-11-13T21:40:19Z","pushed_at":"2016-11-15T18:02:43Z","git_url":"git://github.com/docker/libnetwork.git","ssh_url":"git@github.com:docker/libnetwork.git","clone_url":"https://github.com/docker/libnetwork.git","svn_url":"https://github.com/docker/libnetwork","homepage":"","size":15212,"stargazers_count":782,"watchers_count":782,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":392,"mirror_url":null,"open_issues_count":245,"forks":392,"open_issues":245,"watchers":782,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/libnetwork/pulls/1556"},"html":{"href":"https://github.com/docker/libnetwork/pull/1556"},"issue":{"href":"https://api.github.com/repos/docker/libnetwork/issues/1556"},"comments":{"href":"https://api.github.com/repos/docker/libnetwork/issues/1556/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/libnetwork/pulls/1556/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/libnetwork/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/libnetwork/pulls/1556/commits"},"statuses":{"href":"https://api.github.com/repos/docker/libnetwork/statuses/34be085eda0117cc13d03a8c027559eccfbaad7a"}}}}
{"actor":{"display_login":"aboch"}}