{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/16357","repository_url":"https://api.github.com/repos/dotnet/roslyn","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/16357/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/16357/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/16357/events","html_url":"https://github.com/dotnet/roslyn/pull/16357","id":199672080,"number":16357,"title":"Have VisualStudioDocumentNavigationService perform bounds checks","user":{"login":"dpoeschl","id":235241,"avatar_url":"https://avatars.githubusercontent.com/u/235241?v=3","gravatar_id":"","url":"https://api.github.com/users/dpoeschl","html_url":"https://github.com/dpoeschl","followers_url":"https://api.github.com/users/dpoeschl/followers","following_url":"https://api.github.com/users/dpoeschl/following{/other_user}","gists_url":"https://api.github.com/users/dpoeschl/gists{/gist_id}","starred_url":"https://api.github.com/users/dpoeschl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpoeschl/subscriptions","organizations_url":"https://api.github.com/users/dpoeschl/orgs","repos_url":"https://api.github.com/users/dpoeschl/repos","events_url":"https://api.github.com/users/dpoeschl/events{/privacy}","received_events_url":"https://api.github.com/users/dpoeschl/received_events","type":"User","site_admin":false},"labels":[{"id":166377917,"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-IDE","name":"Area-IDE","color":"5319e7","default":false},{"id":197452922,"url":"https://api.github.com/repos/dotnet/roslyn/labels/cla-already-signed","name":"cla-already-signed","color":"009800","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/dotnet/roslyn/milestones/25","html_url":"https://github.com/dotnet/roslyn/milestone/25","labels_url":"https://api.github.com/repos/dotnet/roslyn/milestones/25/labels","id":2090736,"number":25,"title":"2.0 (RC.3)","description":"","creator":{"login":"jaredpar","id":146967,"avatar_url":"https://avatars.githubusercontent.com/u/146967?v=3","gravatar_id":"","url":"https://api.github.com/users/jaredpar","html_url":"https://github.com/jaredpar","followers_url":"https://api.github.com/users/jaredpar/followers","following_url":"https://api.github.com/users/jaredpar/following{/other_user}","gists_url":"https://api.github.com/users/jaredpar/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredpar/subscriptions","organizations_url":"https://api.github.com/users/jaredpar/orgs","repos_url":"https://api.github.com/users/jaredpar/repos","events_url":"https://api.github.com/users/jaredpar/events{/privacy}","received_events_url":"https://api.github.com/users/jaredpar/received_events","type":"User","site_admin":false},"open_issues":140,"closed_issues":195,"state":"open","created_at":"2016-10-24T21:54:30Z","updated_at":"2017-01-09T22:09:56Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2017-01-09T21:51:15Z","updated_at":"2017-01-09T22:23:49Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/16357","html_url":"https://github.com/dotnet/roslyn/pull/16357","diff_url":"https://github.com/dotnet/roslyn/pull/16357.diff","patch_url":"https://github.com/dotnet/roslyn/pull/16357.patch"},"body":"Fixes #7660\r\nFixes internal bugs 112211, 136895, 224318, 235409\r\n\r\nWe have a number of bugs (listed above) that show features trying to\r\nnavigate to positions that are not within the bounds of the documents in\r\nwhich they are navigating. I have not been able to figure out the common\r\nroot cause of this problem, but they all flow through the\r\nVisualStudioDocumentNavigationService, so adding bounds checks there\r\nshould alleviate the symptoms (reported as crashes, hangs, and error\r\ndialogs).\r\n\r\nAsk Mode (TODO)\r\n============\r\n\r\n**Customer scenario**: The customer tries to navigate using the Navigation Bar or initiate a rename in a Razor file, and they are sometimes met with a crash, a hang, or an error dialog. The total hit count from the Watson is currently 6686. It is unclear why this only happens occasionally, and we have not been able to reproduce the failure locally.\r\n\r\n**Bugs this fixes:** \r\n\r\n#7660\r\nhttps://devdiv.visualstudio.com/DevDiv/_workitems?id=112211\r\nhttps://devdiv.visualstudio.com/DevDiv/_workitems?id=136895\r\nhttps://devdiv.visualstudio.com/DevDiv/_workitems?id=224318\r\nhttps://devdiv.visualstudio.com/DevDiv/_workitems?id=235409\r\n\r\n**Workarounds, if any**: None. The product crashes, hangs, or shows an error dialog.\r\n\r\n**Risk**: Fairly low. We now return false instead of true for CanNavigateTo* for ContainedDocuments if their navigation target is outside the bounds of the document, which will cause rename to give a \"You cannot rename this element\" dialog instead of an \"ArgumentOutOfRange\" dialog. For the actual TryNavigateTo* methods, we are just adjusting the requested bounds to be within the bounds of the Document's length. In the worst case that I can imagine, we will navigate to the end of the document instead of some non-existent (and crashing) location that was requested of us.\r\n\r\n**Performance impact**: Low perf impact, it's just a few math operations and one allocation, and it's only done on infrequent user-initiated actions.\r\n\r\n**Is this a regression from a previous update?** No\r\n\r\n**Root cause analysis:** We do not understand the root cause at this time. However, this change should address the symptoms being reported by customers (and Watson).\r\n\r\n**How was the bug found?** Watson and customer reports"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/271427018","html_url":"https://github.com/dotnet/roslyn/pull/16357#issuecomment-271427018","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/16357","id":271427018,"user":{"login":"dpoeschl","id":235241,"avatar_url":"https://avatars.githubusercontent.com/u/235241?v=3","gravatar_id":"","url":"https://api.github.com/users/dpoeschl","html_url":"https://github.com/dpoeschl","followers_url":"https://api.github.com/users/dpoeschl/followers","following_url":"https://api.github.com/users/dpoeschl/following{/other_user}","gists_url":"https://api.github.com/users/dpoeschl/gists{/gist_id}","starred_url":"https://api.github.com/users/dpoeschl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpoeschl/subscriptions","organizations_url":"https://api.github.com/users/dpoeschl/orgs","repos_url":"https://api.github.com/users/dpoeschl/repos","events_url":"https://api.github.com/users/dpoeschl/events{/privacy}","received_events_url":"https://api.github.com/users/dpoeschl/received_events","type":"User","site_admin":false},"created_at":"2017-01-09T22:23:49Z","updated_at":"2017-01-09T22:23:49Z","body":"Tagging for review @dotnet/roslyn-ide @jasonmalinowski (discussed offline) @heejaechang (made a similar change for the TodoCommentIncrementalAnalyzer)"}}
{"actor":{"display_login":"dpoeschl"}}