{"action":"created","comment":{"url":"https://api.github.com/repos/grpc/grpc/pulls/comments/36697010","id":36697010,"diff_hunk":"@@ -61,6 +62,7 @@ std::shared_ptr<Credentials> WrapCredentials(grpc_credentials* creds) {\n }  // namespace\n \n std::shared_ptr<Credentials> GoogleDefaultCredentials() {\n+  GrpcLibrary init;  // To call grpc_init().","path":"src/cpp/client/secure_credentials.cc","position":12,"original_position":12,"commit_id":"e71a6b094ba62a40e2c6fb8f5781c8accf07548a","original_commit_id":"e71a6b094ba62a40e2c6fb8f5781c8accf07548a","user":{"login":"jboeuf","id":6262765,"avatar_url":"https://avatars.githubusercontent.com/u/6262765?v=3","gravatar_id":"","url":"https://api.github.com/users/jboeuf","html_url":"https://github.com/jboeuf","followers_url":"https://api.github.com/users/jboeuf/followers","following_url":"https://api.github.com/users/jboeuf/following{/other_user}","gists_url":"https://api.github.com/users/jboeuf/gists{/gist_id}","starred_url":"https://api.github.com/users/jboeuf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jboeuf/subscriptions","organizations_url":"https://api.github.com/users/jboeuf/orgs","repos_url":"https://api.github.com/users/jboeuf/repos","events_url":"https://api.github.com/users/jboeuf/events{/privacy}","received_events_url":"https://api.github.com/users/jboeuf/received_events","type":"User","site_admin":false},"body":"oh I see. you're right because C callers have to already call `grpc_init` explicitly. Sorry about that. \r\nNow I agree with you that every entry point in the Cpp layer where this is not called should be fixed.  ","created_at":"2015-08-10T23:27:12Z","updated_at":"2015-08-10T23:27:12Z","html_url":"https://github.com/grpc/grpc/pull/2879#discussion_r36697010","pull_request_url":"https://api.github.com/repos/grpc/grpc/pulls/2879","_links":{"self":{"href":"https://api.github.com/repos/grpc/grpc/pulls/comments/36697010"},"html":{"href":"https://github.com/grpc/grpc/pull/2879#discussion_r36697010"},"pull_request":{"href":"https://api.github.com/repos/grpc/grpc/pulls/2879"}}},"pull_request":{"url":"https://api.github.com/repos/grpc/grpc/pulls/2879","id":42075853,"html_url":"https://github.com/grpc/grpc/pull/2879","diff_url":"https://github.com/grpc/grpc/pull/2879.diff","patch_url":"https://github.com/grpc/grpc/pull/2879.patch","issue_url":"https://api.github.com/repos/grpc/grpc/issues/2879","number":2879,"state":"open","locked":false,"title":"call grpc_init for GoogleDefaultCredentials","user":{"login":"yang-g","id":10122250,"avatar_url":"https://avatars.githubusercontent.com/u/10122250?v=3","gravatar_id":"","url":"https://api.github.com/users/yang-g","html_url":"https://github.com/yang-g","followers_url":"https://api.github.com/users/yang-g/followers","following_url":"https://api.github.com/users/yang-g/following{/other_user}","gists_url":"https://api.github.com/users/yang-g/gists{/gist_id}","starred_url":"https://api.github.com/users/yang-g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yang-g/subscriptions","organizations_url":"https://api.github.com/users/yang-g/orgs","repos_url":"https://api.github.com/users/yang-g/repos","events_url":"https://api.github.com/users/yang-g/events{/privacy}","received_events_url":"https://api.github.com/users/yang-g/received_events","type":"User","site_admin":false},"body":"The grpc_google_default_credentials_create call assumes grpc_init has been called, or it will crash if hit the gce detection part. Our C++ wrapper call grpc_init when a Credentials object is created and thus is too late.\r\n\r\nI think default credentials is the only one with the problems as all others have trivial create() calls. ","created_at":"2015-08-10T22:57:10Z","updated_at":"2015-08-10T23:27:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c4a51ce853b7dac95d72f9a9244837c16339f536","assignee":{"login":"jboeuf","id":6262765,"avatar_url":"https://avatars.githubusercontent.com/u/6262765?v=3","gravatar_id":"","url":"https://api.github.com/users/jboeuf","html_url":"https://github.com/jboeuf","followers_url":"https://api.github.com/users/jboeuf/followers","following_url":"https://api.github.com/users/jboeuf/following{/other_user}","gists_url":"https://api.github.com/users/jboeuf/gists{/gist_id}","starred_url":"https://api.github.com/users/jboeuf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jboeuf/subscriptions","organizations_url":"https://api.github.com/users/jboeuf/orgs","repos_url":"https://api.github.com/users/jboeuf/repos","events_url":"https://api.github.com/users/jboeuf/events{/privacy}","received_events_url":"https://api.github.com/users/jboeuf/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/grpc/grpc/milestones/25","html_url":"https://github.com/grpc/grpc/milestones/Beta","labels_url":"https://api.github.com/repos/grpc/grpc/milestones/25/labels","id":1134869,"number":25,"title":"Beta","description":"","creator":{"login":"ctiller","id":10120821,"avatar_url":"https://avatars.githubusercontent.com/u/10120821?v=3","gravatar_id":"","url":"https://api.github.com/users/ctiller","html_url":"https://github.com/ctiller","followers_url":"https://api.github.com/users/ctiller/followers","following_url":"https://api.github.com/users/ctiller/following{/other_user}","gists_url":"https://api.github.com/users/ctiller/gists{/gist_id}","starred_url":"https://api.github.com/users/ctiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctiller/subscriptions","organizations_url":"https://api.github.com/users/ctiller/orgs","repos_url":"https://api.github.com/users/ctiller/repos","events_url":"https://api.github.com/users/ctiller/events{/privacy}","received_events_url":"https://api.github.com/users/ctiller/received_events","type":"User","site_admin":false},"open_issues":163,"closed_issues":294,"state":"open","created_at":"2015-05-26T22:29:20Z","updated_at":"2015-08-10T22:57:10Z","due_on":"2015-08-29T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/grpc/grpc/pulls/2879/commits","review_comments_url":"https://api.github.com/repos/grpc/grpc/pulls/2879/comments","review_comment_url":"https://api.github.com/repos/grpc/grpc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/grpc/grpc/issues/2879/comments","statuses_url":"https://api.github.com/repos/grpc/grpc/statuses/e71a6b094ba62a40e2c6fb8f5781c8accf07548a","head":{"label":"yang-g:call_grpc_init_first","ref":"call_grpc_init_first","sha":"e71a6b094ba62a40e2c6fb8f5781c8accf07548a","user":{"login":"yang-g","id":10122250,"avatar_url":"https://avatars.githubusercontent.com/u/10122250?v=3","gravatar_id":"","url":"https://api.github.com/users/yang-g","html_url":"https://github.com/yang-g","followers_url":"https://api.github.com/users/yang-g/followers","following_url":"https://api.github.com/users/yang-g/following{/other_user}","gists_url":"https://api.github.com/users/yang-g/gists{/gist_id}","starred_url":"https://api.github.com/users/yang-g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yang-g/subscriptions","organizations_url":"https://api.github.com/users/yang-g/orgs","repos_url":"https://api.github.com/users/yang-g/repos","events_url":"https://api.github.com/users/yang-g/events{/privacy}","received_events_url":"https://api.github.com/users/yang-g/received_events","type":"User","site_admin":false},"repo":{"id":31379035,"name":"grpc","full_name":"yang-g/grpc","owner":{"login":"yang-g","id":10122250,"avatar_url":"https://avatars.githubusercontent.com/u/10122250?v=3","gravatar_id":"","url":"https://api.github.com/users/yang-g","html_url":"https://github.com/yang-g","followers_url":"https://api.github.com/users/yang-g/followers","following_url":"https://api.github.com/users/yang-g/following{/other_user}","gists_url":"https://api.github.com/users/yang-g/gists{/gist_id}","starred_url":"https://api.github.com/users/yang-g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yang-g/subscriptions","organizations_url":"https://api.github.com/users/yang-g/orgs","repos_url":"https://api.github.com/users/yang-g/repos","events_url":"https://api.github.com/users/yang-g/events{/privacy}","received_events_url":"https://api.github.com/users/yang-g/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yang-g/grpc","description":"The C based gRPC (C++, Node.js, Python, Ruby, Objective-C, PHP, C#)","fork":true,"url":"https://api.github.com/repos/yang-g/grpc","forks_url":"https://api.github.com/repos/yang-g/grpc/forks","keys_url":"https://api.github.com/repos/yang-g/grpc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yang-g/grpc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yang-g/grpc/teams","hooks_url":"https://api.github.com/repos/yang-g/grpc/hooks","issue_events_url":"https://api.github.com/repos/yang-g/grpc/issues/events{/number}","events_url":"https://api.github.com/repos/yang-g/grpc/events","assignees_url":"https://api.github.com/repos/yang-g/grpc/assignees{/user}","branches_url":"https://api.github.com/repos/yang-g/grpc/branches{/branch}","tags_url":"https://api.github.com/repos/yang-g/grpc/tags","blobs_url":"https://api.github.com/repos/yang-g/grpc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yang-g/grpc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yang-g/grpc/git/refs{/sha}","trees_url":"https://api.github.com/repos/yang-g/grpc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yang-g/grpc/statuses/{sha}","languages_url":"https://api.github.com/repos/yang-g/grpc/languages","stargazers_url":"https://api.github.com/repos/yang-g/grpc/stargazers","contributors_url":"https://api.github.com/repos/yang-g/grpc/contributors","subscribers_url":"https://api.github.com/repos/yang-g/grpc/subscribers","subscription_url":"https://api.github.com/repos/yang-g/grpc/subscription","commits_url":"https://api.github.com/repos/yang-g/grpc/commits{/sha}","git_commits_url":"https://api.github.com/repos/yang-g/grpc/git/commits{/sha}","comments_url":"https://api.github.com/repos/yang-g/grpc/comments{/number}","issue_comment_url":"https://api.github.com/repos/yang-g/grpc/issues/comments{/number}","contents_url":"https://api.github.com/repos/yang-g/grpc/contents/{+path}","compare_url":"https://api.github.com/repos/yang-g/grpc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yang-g/grpc/merges","archive_url":"https://api.github.com/repos/yang-g/grpc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yang-g/grpc/downloads","issues_url":"https://api.github.com/repos/yang-g/grpc/issues{/number}","pulls_url":"https://api.github.com/repos/yang-g/grpc/pulls{/number}","milestones_url":"https://api.github.com/repos/yang-g/grpc/milestones{/number}","notifications_url":"https://api.github.com/repos/yang-g/grpc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yang-g/grpc/labels{/name}","releases_url":"https://api.github.com/repos/yang-g/grpc/releases{/id}","created_at":"2015-02-26T17:23:56Z","updated_at":"2015-05-07T17:43:42Z","pushed_at":"2015-08-10T22:48:44Z","git_url":"git://github.com/yang-g/grpc.git","ssh_url":"git@github.com:yang-g/grpc.git","clone_url":"https://github.com/yang-g/grpc.git","svn_url":"https://github.com/yang-g/grpc","homepage":"","size":42725,"stargazers_count":1,"watchers_count":1,"language":"C","has_issues":false,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"grpc:master","ref":"master","sha":"488598aa49693e30a951805782f26c5cf2a4f8b8","user":{"login":"grpc","id":7802525,"avatar_url":"https://avatars.githubusercontent.com/u/7802525?v=3","gravatar_id":"","url":"https://api.github.com/users/grpc","html_url":"https://github.com/grpc","followers_url":"https://api.github.com/users/grpc/followers","following_url":"https://api.github.com/users/grpc/following{/other_user}","gists_url":"https://api.github.com/users/grpc/gists{/gist_id}","starred_url":"https://api.github.com/users/grpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grpc/subscriptions","organizations_url":"https://api.github.com/users/grpc/orgs","repos_url":"https://api.github.com/users/grpc/repos","events_url":"https://api.github.com/users/grpc/events{/privacy}","received_events_url":"https://api.github.com/users/grpc/received_events","type":"Organization","site_admin":false},"repo":{"id":27729880,"name":"grpc","full_name":"grpc/grpc","owner":{"login":"grpc","id":7802525,"avatar_url":"https://avatars.githubusercontent.com/u/7802525?v=3","gravatar_id":"","url":"https://api.github.com/users/grpc","html_url":"https://github.com/grpc","followers_url":"https://api.github.com/users/grpc/followers","following_url":"https://api.github.com/users/grpc/following{/other_user}","gists_url":"https://api.github.com/users/grpc/gists{/gist_id}","starred_url":"https://api.github.com/users/grpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grpc/subscriptions","organizations_url":"https://api.github.com/users/grpc/orgs","repos_url":"https://api.github.com/users/grpc/repos","events_url":"https://api.github.com/users/grpc/events{/privacy}","received_events_url":"https://api.github.com/users/grpc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/grpc/grpc","description":"The C based gRPC (C++, Node.js, Python, Ruby, Objective-C, PHP, C#)","fork":false,"url":"https://api.github.com/repos/grpc/grpc","forks_url":"https://api.github.com/repos/grpc/grpc/forks","keys_url":"https://api.github.com/repos/grpc/grpc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grpc/grpc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grpc/grpc/teams","hooks_url":"https://api.github.com/repos/grpc/grpc/hooks","issue_events_url":"https://api.github.com/repos/grpc/grpc/issues/events{/number}","events_url":"https://api.github.com/repos/grpc/grpc/events","assignees_url":"https://api.github.com/repos/grpc/grpc/assignees{/user}","branches_url":"https://api.github.com/repos/grpc/grpc/branches{/branch}","tags_url":"https://api.github.com/repos/grpc/grpc/tags","blobs_url":"https://api.github.com/repos/grpc/grpc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grpc/grpc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grpc/grpc/git/refs{/sha}","trees_url":"https://api.github.com/repos/grpc/grpc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grpc/grpc/statuses/{sha}","languages_url":"https://api.github.com/repos/grpc/grpc/languages","stargazers_url":"https://api.github.com/repos/grpc/grpc/stargazers","contributors_url":"https://api.github.com/repos/grpc/grpc/contributors","subscribers_url":"https://api.github.com/repos/grpc/grpc/subscribers","subscription_url":"https://api.github.com/repos/grpc/grpc/subscription","commits_url":"https://api.github.com/repos/grpc/grpc/commits{/sha}","git_commits_url":"https://api.github.com/repos/grpc/grpc/git/commits{/sha}","comments_url":"https://api.github.com/repos/grpc/grpc/comments{/number}","issue_comment_url":"https://api.github.com/repos/grpc/grpc/issues/comments{/number}","contents_url":"https://api.github.com/repos/grpc/grpc/contents/{+path}","compare_url":"https://api.github.com/repos/grpc/grpc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grpc/grpc/merges","archive_url":"https://api.github.com/repos/grpc/grpc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grpc/grpc/downloads","issues_url":"https://api.github.com/repos/grpc/grpc/issues{/number}","pulls_url":"https://api.github.com/repos/grpc/grpc/pulls{/number}","milestones_url":"https://api.github.com/repos/grpc/grpc/milestones{/number}","notifications_url":"https://api.github.com/repos/grpc/grpc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grpc/grpc/labels{/name}","releases_url":"https://api.github.com/repos/grpc/grpc/releases{/id}","created_at":"2014-12-08T18:58:53Z","updated_at":"2015-08-10T10:21:59Z","pushed_at":"2015-08-10T22:57:19Z","git_url":"git://github.com/grpc/grpc.git","ssh_url":"git@github.com:grpc/grpc.git","clone_url":"https://github.com/grpc/grpc.git","svn_url":"https://github.com/grpc/grpc","homepage":"","size":155985,"stargazers_count":3002,"watchers_count":3002,"language":"C","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":444,"mirror_url":null,"open_issues_count":409,"forks":444,"open_issues":409,"watchers":3002,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/grpc/grpc/pulls/2879"},"html":{"href":"https://github.com/grpc/grpc/pull/2879"},"issue":{"href":"https://api.github.com/repos/grpc/grpc/issues/2879"},"comments":{"href":"https://api.github.com/repos/grpc/grpc/issues/2879/comments"},"review_comments":{"href":"https://api.github.com/repos/grpc/grpc/pulls/2879/comments"},"review_comment":{"href":"https://api.github.com/repos/grpc/grpc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/grpc/grpc/pulls/2879/commits"},"statuses":{"href":"https://api.github.com/repos/grpc/grpc/statuses/e71a6b094ba62a40e2c6fb8f5781c8accf07548a"}}}}