{"action":"created","comment":{"url":"https://api.github.com/repos/google/protobuf/pulls/comments/77217814","id":77217814,"diff_hunk":"@@ -165,7 +165,10 @@ DefaultValueObjectWriter* DefaultValueObjectWriter::RenderBytes(\n   if (current_ == NULL) {\n     ow_->RenderBytes(name, value);\n   } else {\n-    RenderDataPiece(name, DataPiece(value, false, true));\n+    // Since StringPiece is essentially a pointer, takes a copy of \"value\" to\n+    // avoid ownership issues.\n+    string_values_.push_back(new string(value.ToString()));\n+    RenderDataPiece(name, DataPiece(*string_values_.back(), false, true));","path":"src/google/protobuf/util/internal/default_value_objectwriter.cc","position":8,"original_position":8,"commit_id":"df6088a7e82b3615054d0ec6af3ff3e3e793d6cd","original_commit_id":"df6088a7e82b3615054d0ec6af3ff3e3e793d6cd","user":{"login":"xfxyjwf","id":8551050,"avatar_url":"https://avatars.githubusercontent.com/u/8551050?v=3","gravatar_id":"","url":"https://api.github.com/users/xfxyjwf","html_url":"https://github.com/xfxyjwf","followers_url":"https://api.github.com/users/xfxyjwf/followers","following_url":"https://api.github.com/users/xfxyjwf/following{/other_user}","gists_url":"https://api.github.com/users/xfxyjwf/gists{/gist_id}","starred_url":"https://api.github.com/users/xfxyjwf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xfxyjwf/subscriptions","organizations_url":"https://api.github.com/users/xfxyjwf/orgs","repos_url":"https://api.github.com/users/xfxyjwf/repos","events_url":"https://api.github.com/users/xfxyjwf/events{/privacy}","received_events_url":"https://api.github.com/users/xfxyjwf/received_events","type":"User","site_admin":false},"body":"Does RenderDataPiece cache the StringPiece value somewhere? I thought RenderDataPiece will write directly to output and won't have ownership issues even when the StringPiece is a temporary.","created_at":"2016-09-01T17:30:37Z","updated_at":"2016-09-01T17:30:37Z","html_url":"https://github.com/google/protobuf/pull/2045#discussion_r77217814","pull_request_url":"https://api.github.com/repos/google/protobuf/pulls/2045","_links":{"self":{"href":"https://api.github.com/repos/google/protobuf/pulls/comments/77217814"},"html":{"href":"https://github.com/google/protobuf/pull/2045#discussion_r77217814"},"pull_request":{"href":"https://api.github.com/repos/google/protobuf/pulls/2045"}}},"pull_request":{"url":"https://api.github.com/repos/google/protobuf/pulls/2045","id":83557594,"html_url":"https://github.com/google/protobuf/pull/2045","diff_url":"https://github.com/google/protobuf/pull/2045.diff","patch_url":"https://github.com/google/protobuf/pull/2045.patch","issue_url":"https://api.github.com/repos/google/protobuf/issues/2045","number":2045,"state":"open","locked":false,"title":"fix #1342 cause by ownership issues","user":{"login":"mike07026","id":16629623,"avatar_url":"https://avatars.githubusercontent.com/u/16629623?v=3","gravatar_id":"","url":"https://api.github.com/users/mike07026","html_url":"https://github.com/mike07026","followers_url":"https://api.github.com/users/mike07026/followers","following_url":"https://api.github.com/users/mike07026/following{/other_user}","gists_url":"https://api.github.com/users/mike07026/gists{/gist_id}","starred_url":"https://api.github.com/users/mike07026/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mike07026/subscriptions","organizations_url":"https://api.github.com/users/mike07026/orgs","repos_url":"https://api.github.com/users/mike07026/repos","events_url":"https://api.github.com/users/mike07026/events{/privacy}","received_events_url":"https://api.github.com/users/mike07026/received_events","type":"User","site_admin":false},"body":"#1342 it caused by \"StringPiece value\" ownership issues,  we can fix it like RenderString implement.","created_at":"2016-09-01T01:41:48Z","updated_at":"2016-09-01T17:30:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ec022e125ba6e2200ff28a9882c219400397736d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/google/protobuf/pulls/2045/commits","review_comments_url":"https://api.github.com/repos/google/protobuf/pulls/2045/comments","review_comment_url":"https://api.github.com/repos/google/protobuf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/protobuf/issues/2045/comments","statuses_url":"https://api.github.com/repos/google/protobuf/statuses/df6088a7e82b3615054d0ec6af3ff3e3e793d6cd","head":{"label":"mike07026:master","ref":"master","sha":"df6088a7e82b3615054d0ec6af3ff3e3e793d6cd","user":{"login":"mike07026","id":16629623,"avatar_url":"https://avatars.githubusercontent.com/u/16629623?v=3","gravatar_id":"","url":"https://api.github.com/users/mike07026","html_url":"https://github.com/mike07026","followers_url":"https://api.github.com/users/mike07026/followers","following_url":"https://api.github.com/users/mike07026/following{/other_user}","gists_url":"https://api.github.com/users/mike07026/gists{/gist_id}","starred_url":"https://api.github.com/users/mike07026/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mike07026/subscriptions","organizations_url":"https://api.github.com/users/mike07026/orgs","repos_url":"https://api.github.com/users/mike07026/repos","events_url":"https://api.github.com/users/mike07026/events{/privacy}","received_events_url":"https://api.github.com/users/mike07026/received_events","type":"User","site_admin":false},"repo":{"id":67084791,"name":"protobuf","full_name":"mike07026/protobuf","owner":{"login":"mike07026","id":16629623,"avatar_url":"https://avatars.githubusercontent.com/u/16629623?v=3","gravatar_id":"","url":"https://api.github.com/users/mike07026","html_url":"https://github.com/mike07026","followers_url":"https://api.github.com/users/mike07026/followers","following_url":"https://api.github.com/users/mike07026/following{/other_user}","gists_url":"https://api.github.com/users/mike07026/gists{/gist_id}","starred_url":"https://api.github.com/users/mike07026/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mike07026/subscriptions","organizations_url":"https://api.github.com/users/mike07026/orgs","repos_url":"https://api.github.com/users/mike07026/repos","events_url":"https://api.github.com/users/mike07026/events{/privacy}","received_events_url":"https://api.github.com/users/mike07026/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mike07026/protobuf","description":"Protocol Buffers - Google's data interchange format","fork":true,"url":"https://api.github.com/repos/mike07026/protobuf","forks_url":"https://api.github.com/repos/mike07026/protobuf/forks","keys_url":"https://api.github.com/repos/mike07026/protobuf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mike07026/protobuf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mike07026/protobuf/teams","hooks_url":"https://api.github.com/repos/mike07026/protobuf/hooks","issue_events_url":"https://api.github.com/repos/mike07026/protobuf/issues/events{/number}","events_url":"https://api.github.com/repos/mike07026/protobuf/events","assignees_url":"https://api.github.com/repos/mike07026/protobuf/assignees{/user}","branches_url":"https://api.github.com/repos/mike07026/protobuf/branches{/branch}","tags_url":"https://api.github.com/repos/mike07026/protobuf/tags","blobs_url":"https://api.github.com/repos/mike07026/protobuf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mike07026/protobuf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mike07026/protobuf/git/refs{/sha}","trees_url":"https://api.github.com/repos/mike07026/protobuf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mike07026/protobuf/statuses/{sha}","languages_url":"https://api.github.com/repos/mike07026/protobuf/languages","stargazers_url":"https://api.github.com/repos/mike07026/protobuf/stargazers","contributors_url":"https://api.github.com/repos/mike07026/protobuf/contributors","subscribers_url":"https://api.github.com/repos/mike07026/protobuf/subscribers","subscription_url":"https://api.github.com/repos/mike07026/protobuf/subscription","commits_url":"https://api.github.com/repos/mike07026/protobuf/commits{/sha}","git_commits_url":"https://api.github.com/repos/mike07026/protobuf/git/commits{/sha}","comments_url":"https://api.github.com/repos/mike07026/protobuf/comments{/number}","issue_comment_url":"https://api.github.com/repos/mike07026/protobuf/issues/comments{/number}","contents_url":"https://api.github.com/repos/mike07026/protobuf/contents/{+path}","compare_url":"https://api.github.com/repos/mike07026/protobuf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mike07026/protobuf/merges","archive_url":"https://api.github.com/repos/mike07026/protobuf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mike07026/protobuf/downloads","issues_url":"https://api.github.com/repos/mike07026/protobuf/issues{/number}","pulls_url":"https://api.github.com/repos/mike07026/protobuf/pulls{/number}","milestones_url":"https://api.github.com/repos/mike07026/protobuf/milestones{/number}","notifications_url":"https://api.github.com/repos/mike07026/protobuf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mike07026/protobuf/labels{/name}","releases_url":"https://api.github.com/repos/mike07026/protobuf/releases{/id}","deployments_url":"https://api.github.com/repos/mike07026/protobuf/deployments","created_at":"2016-09-01T00:48:03Z","updated_at":"2016-09-01T00:48:15Z","pushed_at":"2016-09-01T12:08:45Z","git_url":"git://github.com/mike07026/protobuf.git","ssh_url":"git@github.com:mike07026/protobuf.git","clone_url":"https://github.com/mike07026/protobuf.git","svn_url":"https://github.com/mike07026/protobuf","homepage":"https://developers.google.com/protocol-buffers/","size":34750,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"b9649765f8e5c85523c138ac990a7523a54bfdbe","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":23357588,"name":"protobuf","full_name":"google/protobuf","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/protobuf","description":"Protocol Buffers - Google's data interchange format","fork":false,"url":"https://api.github.com/repos/google/protobuf","forks_url":"https://api.github.com/repos/google/protobuf/forks","keys_url":"https://api.github.com/repos/google/protobuf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/protobuf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/protobuf/teams","hooks_url":"https://api.github.com/repos/google/protobuf/hooks","issue_events_url":"https://api.github.com/repos/google/protobuf/issues/events{/number}","events_url":"https://api.github.com/repos/google/protobuf/events","assignees_url":"https://api.github.com/repos/google/protobuf/assignees{/user}","branches_url":"https://api.github.com/repos/google/protobuf/branches{/branch}","tags_url":"https://api.github.com/repos/google/protobuf/tags","blobs_url":"https://api.github.com/repos/google/protobuf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/protobuf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/protobuf/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/protobuf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/protobuf/statuses/{sha}","languages_url":"https://api.github.com/repos/google/protobuf/languages","stargazers_url":"https://api.github.com/repos/google/protobuf/stargazers","contributors_url":"https://api.github.com/repos/google/protobuf/contributors","subscribers_url":"https://api.github.com/repos/google/protobuf/subscribers","subscription_url":"https://api.github.com/repos/google/protobuf/subscription","commits_url":"https://api.github.com/repos/google/protobuf/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/protobuf/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/protobuf/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/protobuf/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/protobuf/contents/{+path}","compare_url":"https://api.github.com/repos/google/protobuf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/protobuf/merges","archive_url":"https://api.github.com/repos/google/protobuf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/protobuf/downloads","issues_url":"https://api.github.com/repos/google/protobuf/issues{/number}","pulls_url":"https://api.github.com/repos/google/protobuf/pulls{/number}","milestones_url":"https://api.github.com/repos/google/protobuf/milestones{/number}","notifications_url":"https://api.github.com/repos/google/protobuf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/protobuf/labels{/name}","releases_url":"https://api.github.com/repos/google/protobuf/releases{/id}","deployments_url":"https://api.github.com/repos/google/protobuf/deployments","created_at":"2014-08-26T15:52:15Z","updated_at":"2016-09-01T17:11:37Z","pushed_at":"2016-09-01T16:50:29Z","git_url":"git://github.com/google/protobuf.git","ssh_url":"git@github.com:google/protobuf.git","clone_url":"https://github.com/google/protobuf.git","svn_url":"https://github.com/google/protobuf","homepage":"https://developers.google.com/protocol-buffers/","size":62771,"stargazers_count":11617,"watchers_count":11617,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3446,"mirror_url":null,"open_issues_count":500,"forks":3446,"open_issues":500,"watchers":11617,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/protobuf/pulls/2045"},"html":{"href":"https://github.com/google/protobuf/pull/2045"},"issue":{"href":"https://api.github.com/repos/google/protobuf/issues/2045"},"comments":{"href":"https://api.github.com/repos/google/protobuf/issues/2045/comments"},"review_comments":{"href":"https://api.github.com/repos/google/protobuf/pulls/2045/comments"},"review_comment":{"href":"https://api.github.com/repos/google/protobuf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/protobuf/pulls/2045/commits"},"statuses":{"href":"https://api.github.com/repos/google/protobuf/statuses/df6088a7e82b3615054d0ec6af3ff3e3e793d6cd"}}}}
{"actor":{"display_login":"xfxyjwf"}}