{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/175203959","pull_request_review_id":104705257,"id":175203959,"diff_hunk":"@@ -14,14 +14,14 @@ namespace Microsoft.CodeAnalysis.CSharp\n {\n     internal class CSharpDeclarationComputer : DeclarationComputer\n     {\n-        public static void ComputeDeclarationsInSpan(SemanticModel model, TextSpan span, bool getSymbol, List<DeclarationInfo> builder, CancellationToken cancellationToken)\n+        public static void ComputeDeclarationsInSpan(SemanticModel model, TextSpan span, bool getSymbol, ImmutableArray<DeclarationInfo>.Builder builder, CancellationToken cancellationToken)","path":"src/Compilers/CSharp/CSharpAnalyzerDriver/CSharpDeclarationComputer.cs","position":null,"original_position":5,"commit_id":"f7a7565be66bcfc9b8f9aa7af3ba93d445acdbf9","original_commit_id":"0b6152b98d65be5eb18c0e3297aedd0650beca2d","user":{"login":"heejaechang","id":1333179,"avatar_url":"https://avatars3.githubusercontent.com/u/1333179?v=4","gravatar_id":"","url":"https://api.github.com/users/heejaechang","html_url":"https://github.com/heejaechang","followers_url":"https://api.github.com/users/heejaechang/followers","following_url":"https://api.github.com/users/heejaechang/following{/other_user}","gists_url":"https://api.github.com/users/heejaechang/gists{/gist_id}","starred_url":"https://api.github.com/users/heejaechang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heejaechang/subscriptions","organizations_url":"https://api.github.com/users/heejaechang/orgs","repos_url":"https://api.github.com/users/heejaechang/repos","events_url":"https://api.github.com/users/heejaechang/events{/privacy}","received_events_url":"https://api.github.com/users/heejaechang/received_events","type":"User","site_admin":false},"body":"hmmm.. so for people who has even less screen size, they can argue line  should be wrapped in even smaller length?\r\n\r\nlike I said, split view or github providing better scrolling or inline diff providing wrapped line or github not restricting width of code, seems all better solution than wrapping the line in code.\r\n\r\nfor me, the argument is strange since argument is based on something that is not fixed. such as current UI of a tool or screen size. and requires change in code.\r\n\r\nso, if someone buy a new laptop or UI change, one should go and re-arrange all code?","created_at":"2018-03-16T20:19:11Z","updated_at":"2018-03-16T20:19:11Z","html_url":"https://github.com/dotnet/roslyn/pull/25496#discussion_r175203959","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/25496","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/175203959"},"html":{"href":"https://github.com/dotnet/roslyn/pull/25496#discussion_r175203959"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/25496"}},"in_reply_to_id":174900517},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/25496","id":175296322,"html_url":"https://github.com/dotnet/roslyn/pull/25496","diff_url":"https://github.com/dotnet/roslyn/pull/25496.diff","patch_url":"https://github.com/dotnet/roslyn/pull/25496.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/25496","number":25496,"state":"open","locked":false,"title":"Fix race condition in analyzer driver where multiple threads attempti…","user":{"login":"mavasani","id":10605811,"avatar_url":"https://avatars2.githubusercontent.com/u/10605811?v=4","gravatar_id":"","url":"https://api.github.com/users/mavasani","html_url":"https://github.com/mavasani","followers_url":"https://api.github.com/users/mavasani/followers","following_url":"https://api.github.com/users/mavasani/following{/other_user}","gists_url":"https://api.github.com/users/mavasani/gists{/gist_id}","starred_url":"https://api.github.com/users/mavasani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mavasani/subscriptions","organizations_url":"https://api.github.com/users/mavasani/orgs","repos_url":"https://api.github.com/users/mavasani/repos","events_url":"https://api.github.com/users/mavasani/events{/privacy}","received_events_url":"https://api.github.com/users/mavasani/received_events","type":"User","site_admin":false},"body":"…ng to analyze the same declaration do not race on freeing the pooled declaration analysis data instance, causing the other threads to unexpectedly fault.\r\n\r\nWe now pool only the declaration analysis data builder, and the declaration analysis data instance exposed to the driver is immutable, hence avoiding this race.\r\n\r\nFixes VSO [575529](https://devdiv.visualstudio.com/DevDiv/_workitems/edit/575529).\r\n\r\n<details><summary>Ask Mode template</summary>\r\n\r\n<!-- This template is not always required. If you aren't sure about whether it's needed or want help filling out the sections,\r\nsubmit the pull request and then ask us for help. :) -->\r\n\r\n### Customer scenario\r\n\r\nThis is race condition in the core analyzer driver where:\r\n1. Multiple threads start attempting to analyze a particular source declaration\r\n2. Thread 1 computes, caches and holds onto an instance of declaration analysis data needed to trigger analyzer callbacks, but gets context switched before it actually makes the analyzer callbacks.\r\n3. Thread 2 gets this declaration analysis data instance from the cache and executes analysis callbacks.\r\n4. Thread 2 executes cleanup, and if all analyzers have finished getting callbacks for the declaration, frees the declaration analysis data instance.\r\n5. Thread 1 gets context and tries to operate on the freed declaration analysis data instance and faults.\r\n\r\nAll the watson dumps show that this race is most likely to happen when we are analyzing large method bodies and attempting to compute `GetOperation` on the Thread 1 at step 2. above, which is likely to cause a context switch.\r\n\r\n### Bugs this fixes\r\n\r\nVSO [575529](https://devdiv.visualstudio.com/DevDiv/_workitems/edit/575529)\r\n\r\n### Workarounds, if any\r\n\r\nNone\r\n\r\n### Risk\r\n\r\nMedium to High - this fix touches one of the core parts of the analyzer driver that analyzes each symbol declaration and makes syntax node, code block and operation analyzer callbacks for nodes and executable code within declarations. Fix will address the NRE from the Watson, but given the part of code that is being changed, we can potentially introduce other functional regressions.\r\n\r\n### Performance impact\r\n\r\nLow or Medium - As mentioned above, we are touching core parts of the analyzer driver, so we should keep an eye out for any performance regressions.\r\n\r\n### Is this a regression from a previous update?\r\n\r\nThe race has existed since the initial analyzer driver implementation, where we tuned the driver to cache and/or pool more data for IDE scenarios. The dumps indicate that the race is likely if the time for computation of entities on which to make analyzer callbacks is larger, which seems to be the case for operation analyzers executing on large method bodies.\r\n\r\n### Root cause analysis\r\n\r\nRace condition that was never seen before or did not have enough watson hits.\r\n\r\n### How was the bug found?\r\n\r\nWatson hits.\r\n\r\n### Test documentation updated?\r\n\r\nN/A\r\n\r\n</details>\r\n","created_at":"2018-03-15T15:53:32Z","updated_at":"2018-03-16T20:19:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7fb50ab4e82851c35949de095e90acecd9504a47","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jinujoseph","id":12449387,"avatar_url":"https://avatars3.githubusercontent.com/u/12449387?v=4","gravatar_id":"","url":"https://api.github.com/users/jinujoseph","html_url":"https://github.com/jinujoseph","followers_url":"https://api.github.com/users/jinujoseph/followers","following_url":"https://api.github.com/users/jinujoseph/following{/other_user}","gists_url":"https://api.github.com/users/jinujoseph/gists{/gist_id}","starred_url":"https://api.github.com/users/jinujoseph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jinujoseph/subscriptions","organizations_url":"https://api.github.com/users/jinujoseph/orgs","repos_url":"https://api.github.com/users/jinujoseph/repos","events_url":"https://api.github.com/users/jinujoseph/events{/privacy}","received_events_url":"https://api.github.com/users/jinujoseph/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":166381314,"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-Analyzers","name":"Area-Analyzers","color":"5319e7","default":false},{"id":166673288,"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-Compilers","name":"Area-Compilers","color":"5319e7","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/25496/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/25496/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/25496/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/f7a7565be66bcfc9b8f9aa7af3ba93d445acdbf9","head":{"label":"mavasani:RaceConditionFix","ref":"RaceConditionFix","sha":"f7a7565be66bcfc9b8f9aa7af3ba93d445acdbf9","user":{"login":"mavasani","id":10605811,"avatar_url":"https://avatars2.githubusercontent.com/u/10605811?v=4","gravatar_id":"","url":"https://api.github.com/users/mavasani","html_url":"https://github.com/mavasani","followers_url":"https://api.github.com/users/mavasani/followers","following_url":"https://api.github.com/users/mavasani/following{/other_user}","gists_url":"https://api.github.com/users/mavasani/gists{/gist_id}","starred_url":"https://api.github.com/users/mavasani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mavasani/subscriptions","organizations_url":"https://api.github.com/users/mavasani/orgs","repos_url":"https://api.github.com/users/mavasani/repos","events_url":"https://api.github.com/users/mavasani/events{/privacy}","received_events_url":"https://api.github.com/users/mavasani/received_events","type":"User","site_admin":false},"repo":{"id":30584055,"name":"roslyn","full_name":"mavasani/roslyn","owner":{"login":"mavasani","id":10605811,"avatar_url":"https://avatars2.githubusercontent.com/u/10605811?v=4","gravatar_id":"","url":"https://api.github.com/users/mavasani","html_url":"https://github.com/mavasani","followers_url":"https://api.github.com/users/mavasani/followers","following_url":"https://api.github.com/users/mavasani/following{/other_user}","gists_url":"https://api.github.com/users/mavasani/gists{/gist_id}","starred_url":"https://api.github.com/users/mavasani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mavasani/subscriptions","organizations_url":"https://api.github.com/users/mavasani/orgs","repos_url":"https://api.github.com/users/mavasani/repos","events_url":"https://api.github.com/users/mavasani/events{/privacy}","received_events_url":"https://api.github.com/users/mavasani/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mavasani/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":true,"url":"https://api.github.com/repos/mavasani/roslyn","forks_url":"https://api.github.com/repos/mavasani/roslyn/forks","keys_url":"https://api.github.com/repos/mavasani/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mavasani/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mavasani/roslyn/teams","hooks_url":"https://api.github.com/repos/mavasani/roslyn/hooks","issue_events_url":"https://api.github.com/repos/mavasani/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/mavasani/roslyn/events","assignees_url":"https://api.github.com/repos/mavasani/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/mavasani/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/mavasani/roslyn/tags","blobs_url":"https://api.github.com/repos/mavasani/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mavasani/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mavasani/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/mavasani/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mavasani/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/mavasani/roslyn/languages","stargazers_url":"https://api.github.com/repos/mavasani/roslyn/stargazers","contributors_url":"https://api.github.com/repos/mavasani/roslyn/contributors","subscribers_url":"https://api.github.com/repos/mavasani/roslyn/subscribers","subscription_url":"https://api.github.com/repos/mavasani/roslyn/subscription","commits_url":"https://api.github.com/repos/mavasani/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/mavasani/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/mavasani/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/mavasani/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/mavasani/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/mavasani/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mavasani/roslyn/merges","archive_url":"https://api.github.com/repos/mavasani/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mavasani/roslyn/downloads","issues_url":"https://api.github.com/repos/mavasani/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/mavasani/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/mavasani/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/mavasani/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mavasani/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/mavasani/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/mavasani/roslyn/deployments","created_at":"2015-02-10T09:12:41Z","updated_at":"2016-02-05T19:05:21Z","pushed_at":"2018-03-16T19:32:17Z","git_url":"git://github.com/mavasani/roslyn.git","ssh_url":"git@github.com:mavasani/roslyn.git","clone_url":"https://github.com/mavasani/roslyn.git","svn_url":"https://github.com/mavasani/roslyn","homepage":"","size":278359,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:dev15.7.x","ref":"dev15.7.x","sha":"7dcb04db22b548079ed8ac6e8dc05ef2cde5bbe7","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":29078997,"name":"roslyn","full_name":"dotnet/roslyn","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":false,"url":"https://api.github.com/repos/dotnet/roslyn","forks_url":"https://api.github.com/repos/dotnet/roslyn/forks","keys_url":"https://api.github.com/repos/dotnet/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/roslyn/teams","hooks_url":"https://api.github.com/repos/dotnet/roslyn/hooks","issue_events_url":"https://api.github.com/repos/dotnet/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/roslyn/events","assignees_url":"https://api.github.com/repos/dotnet/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/roslyn/tags","blobs_url":"https://api.github.com/repos/dotnet/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/roslyn/languages","stargazers_url":"https://api.github.com/repos/dotnet/roslyn/stargazers","contributors_url":"https://api.github.com/repos/dotnet/roslyn/contributors","subscribers_url":"https://api.github.com/repos/dotnet/roslyn/subscribers","subscription_url":"https://api.github.com/repos/dotnet/roslyn/subscription","commits_url":"https://api.github.com/repos/dotnet/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/roslyn/merges","archive_url":"https://api.github.com/repos/dotnet/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/roslyn/downloads","issues_url":"https://api.github.com/repos/dotnet/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/roslyn/deployments","created_at":"2015-01-11T02:39:03Z","updated_at":"2018-03-16T17:33:17Z","pushed_at":"2018-03-16T20:04:37Z","git_url":"git://github.com/dotnet/roslyn.git","ssh_url":"git@github.com:dotnet/roslyn.git","clone_url":"https://github.com/dotnet/roslyn.git","svn_url":"https://github.com/dotnet/roslyn","homepage":"","size":309860,"stargazers_count":8995,"watchers_count":8995,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2162,"mirror_url":null,"archived":false,"open_issues_count":4587,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":2162,"open_issues":4587,"watchers":8995,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/25496"},"html":{"href":"https://github.com/dotnet/roslyn/pull/25496"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/25496"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/25496/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/25496/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/25496/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/f7a7565be66bcfc9b8f9aa7af3ba93d445acdbf9"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"heejaechang"}}