{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/comments/170935416","pull_request_review_id":99699023,"id":170935416,"diff_hunk":"@@ -1200,6 +1200,20 @@ inline void DoLogForFailFastException(LPCWSTR pszMessage, PEXCEPTION_POINTERS pE\n         {\n             PrintToStdErrA(\"\\n\");\n             LogCallstackForLogWorker();\n+            EXCEPTIONREF refException = (EXCEPTIONREF)(pThread->LastThrownObject());\n+\n+            if (refException != NULL) {","path":"src/vm/eepolicy.cpp","position":15,"original_position":15,"commit_id":"37e34d38d3267f4bd18381b779a0a9caa02d77cf","original_commit_id":"37e34d38d3267f4bd18381b779a0a9caa02d77cf","user":{"login":"jkotas","id":6668460,"avatar_url":"https://avatars2.githubusercontent.com/u/6668460?v=4","gravatar_id":"","url":"https://api.github.com/users/jkotas","html_url":"https://github.com/jkotas","followers_url":"https://api.github.com/users/jkotas/followers","following_url":"https://api.github.com/users/jkotas/following{/other_user}","gists_url":"https://api.github.com/users/jkotas/gists{/gist_id}","starred_url":"https://api.github.com/users/jkotas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkotas/subscriptions","organizations_url":"https://api.github.com/users/jkotas/orgs","repos_url":"https://api.github.com/users/jkotas/repos","events_url":"https://api.github.com/users/jkotas/events{/privacy}","received_events_url":"https://api.github.com/users/jkotas/received_events","type":"User","site_admin":false},"body":"This is operating on object references without protecting them.","created_at":"2018-02-27T14:18:12Z","updated_at":"2018-02-27T14:18:12Z","html_url":"https://github.com/dotnet/coreclr/pull/16622#discussion_r170935416","pull_request_url":"https://api.github.com/repos/dotnet/coreclr/pulls/16622","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/comments/170935416"},"html":{"href":"https://github.com/dotnet/coreclr/pull/16622#discussion_r170935416"},"pull_request":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/16622"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/16622","id":171645383,"html_url":"https://github.com/dotnet/coreclr/pull/16622","diff_url":"https://github.com/dotnet/coreclr/pull/16622.diff","patch_url":"https://github.com/dotnet/coreclr/pull/16622.patch","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/16622","number":16622,"state":"open","locked":false,"title":"Log inner exceptions for Environment.Failfast ","user":{"login":"sywhang","id":30421794,"avatar_url":"https://avatars0.githubusercontent.com/u/30421794?v=4","gravatar_id":"","url":"https://api.github.com/users/sywhang","html_url":"https://github.com/sywhang","followers_url":"https://api.github.com/users/sywhang/followers","following_url":"https://api.github.com/users/sywhang/following{/other_user}","gists_url":"https://api.github.com/users/sywhang/gists{/gist_id}","starred_url":"https://api.github.com/users/sywhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sywhang/subscriptions","organizations_url":"https://api.github.com/users/sywhang/orgs","repos_url":"https://api.github.com/users/sywhang/repos","events_url":"https://api.github.com/users/sywhang/events{/privacy}","received_events_url":"https://api.github.com/users/sywhang/received_events","type":"User","site_admin":false},"body":"Fixes issue #15203\r\n\r\nEnable logging inner exception on calls to ```Environment.FailFast(bool, ex)```\r\n\r\nPasted below is an example inner exception log produced with this fix for this program: \r\n```\r\nFailFast:\r\nOops\r\n\r\n   at System.Environment.FailFast(System.String, System.Exception)\r\n   at Internal.Runtime.Augments.EnvironmentAugments.FailFast(System.String, System.Exception)\r\n   at System.Environment.FailFast(System.String, System.Exception)\r\n   at Program.Main()\r\n\r\nInner exception details:\r\nSystem.ArgumentException: my ae ---> System.NullReferenceException: my nre\r\n   at Program.D()\r\n   at Program.C()\r\n   at Program.B()\r\n   --- End of inner exception stack trace ---\r\n   at Program.B()\r\n   at Program.A()\r\n   at Program.Main()\r\n```\r\n\r\nHere is the program used to produce the log above.\r\n```\r\nclass Program\r\n{\r\n    static void Main()\r\n    {\r\n        try\r\n        {\r\n            A();\r\n        }\r\n        catch(Exception ex)\r\n        {\r\n            Environment.FailFast(\"Oops\", ex);\r\n        }\r\n    }\r\n\r\n    static void A()\r\n    {\r\n        B();\r\n    }\r\n\r\n    static void B()\r\n    {\r\n        try\r\n        {\r\n            C();\r\n        }\r\n        catch (Exception ex)\r\n        {\r\n            throw new ArgumentException(\"my ae\", ex);\r\n        }\r\n    }\r\n\r\n    static void C()\r\n    {\r\n        D();\r\n    }\r\n\r\n    static void D()\r\n    {\r\n        throw new NullReferenceException(\"my nre\");\r\n    }\r\n}\r\n\r\n```\r\n\r\nI will follow up with another PR to address the duplicate ```System.Environment.FailFast(System.String, System.Exception)``` appearing in the FailFast exception stack trace, but this PR addresses the more important problem of inner exception details getting dropped from the log.","created_at":"2018-02-27T12:15:55Z","updated_at":"2018-02-27T14:18:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f9d65ce84f4e3ff5d47c23d47f69dd3691d75511","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/coreclr/pulls/16622/commits","review_comments_url":"https://api.github.com/repos/dotnet/coreclr/pulls/16622/comments","review_comment_url":"https://api.github.com/repos/dotnet/coreclr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/16622/comments","statuses_url":"https://api.github.com/repos/dotnet/coreclr/statuses/37e34d38d3267f4bd18381b779a0a9caa02d77cf","head":{"label":"sywhang:failfast-inner-exceptions","ref":"failfast-inner-exceptions","sha":"37e34d38d3267f4bd18381b779a0a9caa02d77cf","user":{"login":"sywhang","id":30421794,"avatar_url":"https://avatars0.githubusercontent.com/u/30421794?v=4","gravatar_id":"","url":"https://api.github.com/users/sywhang","html_url":"https://github.com/sywhang","followers_url":"https://api.github.com/users/sywhang/followers","following_url":"https://api.github.com/users/sywhang/following{/other_user}","gists_url":"https://api.github.com/users/sywhang/gists{/gist_id}","starred_url":"https://api.github.com/users/sywhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sywhang/subscriptions","organizations_url":"https://api.github.com/users/sywhang/orgs","repos_url":"https://api.github.com/users/sywhang/repos","events_url":"https://api.github.com/users/sywhang/events{/privacy}","received_events_url":"https://api.github.com/users/sywhang/received_events","type":"User","site_admin":false},"repo":{"id":98243814,"name":"coreclr","full_name":"sywhang/coreclr","owner":{"login":"sywhang","id":30421794,"avatar_url":"https://avatars0.githubusercontent.com/u/30421794?v=4","gravatar_id":"","url":"https://api.github.com/users/sywhang","html_url":"https://github.com/sywhang","followers_url":"https://api.github.com/users/sywhang/followers","following_url":"https://api.github.com/users/sywhang/following{/other_user}","gists_url":"https://api.github.com/users/sywhang/gists{/gist_id}","starred_url":"https://api.github.com/users/sywhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sywhang/subscriptions","organizations_url":"https://api.github.com/users/sywhang/orgs","repos_url":"https://api.github.com/users/sywhang/repos","events_url":"https://api.github.com/users/sywhang/events{/privacy}","received_events_url":"https://api.github.com/users/sywhang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sywhang/coreclr","description":"This repo contains the .NET Core runtime, called CoreCLR, and the base library, called mscorlib. It includes the garbage collector, JIT compiler, base .NET data types and many low-level classes. We welcome contributions.","fork":true,"url":"https://api.github.com/repos/sywhang/coreclr","forks_url":"https://api.github.com/repos/sywhang/coreclr/forks","keys_url":"https://api.github.com/repos/sywhang/coreclr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sywhang/coreclr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sywhang/coreclr/teams","hooks_url":"https://api.github.com/repos/sywhang/coreclr/hooks","issue_events_url":"https://api.github.com/repos/sywhang/coreclr/issues/events{/number}","events_url":"https://api.github.com/repos/sywhang/coreclr/events","assignees_url":"https://api.github.com/repos/sywhang/coreclr/assignees{/user}","branches_url":"https://api.github.com/repos/sywhang/coreclr/branches{/branch}","tags_url":"https://api.github.com/repos/sywhang/coreclr/tags","blobs_url":"https://api.github.com/repos/sywhang/coreclr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sywhang/coreclr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sywhang/coreclr/git/refs{/sha}","trees_url":"https://api.github.com/repos/sywhang/coreclr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sywhang/coreclr/statuses/{sha}","languages_url":"https://api.github.com/repos/sywhang/coreclr/languages","stargazers_url":"https://api.github.com/repos/sywhang/coreclr/stargazers","contributors_url":"https://api.github.com/repos/sywhang/coreclr/contributors","subscribers_url":"https://api.github.com/repos/sywhang/coreclr/subscribers","subscription_url":"https://api.github.com/repos/sywhang/coreclr/subscription","commits_url":"https://api.github.com/repos/sywhang/coreclr/commits{/sha}","git_commits_url":"https://api.github.com/repos/sywhang/coreclr/git/commits{/sha}","comments_url":"https://api.github.com/repos/sywhang/coreclr/comments{/number}","issue_comment_url":"https://api.github.com/repos/sywhang/coreclr/issues/comments{/number}","contents_url":"https://api.github.com/repos/sywhang/coreclr/contents/{+path}","compare_url":"https://api.github.com/repos/sywhang/coreclr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sywhang/coreclr/merges","archive_url":"https://api.github.com/repos/sywhang/coreclr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sywhang/coreclr/downloads","issues_url":"https://api.github.com/repos/sywhang/coreclr/issues{/number}","pulls_url":"https://api.github.com/repos/sywhang/coreclr/pulls{/number}","milestones_url":"https://api.github.com/repos/sywhang/coreclr/milestones{/number}","notifications_url":"https://api.github.com/repos/sywhang/coreclr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sywhang/coreclr/labels{/name}","releases_url":"https://api.github.com/repos/sywhang/coreclr/releases{/id}","deployments_url":"https://api.github.com/repos/sywhang/coreclr/deployments","created_at":"2017-07-24T23:37:12Z","updated_at":"2017-07-24T23:38:22Z","pushed_at":"2018-02-27T12:21:51Z","git_url":"git://github.com/sywhang/coreclr.git","ssh_url":"git@github.com:sywhang/coreclr.git","clone_url":"https://github.com/sywhang/coreclr.git","svn_url":"https://github.com/sywhang/coreclr","homepage":"https://github.com/dotnet/core","size":208194,"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":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"f761b8ee2adaf0bee0badcde5a3f22df518a31e9","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":30092893,"name":"coreclr","full_name":"dotnet/coreclr","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/coreclr","description":"This repo contains the .NET Core runtime, called CoreCLR, and the base library, called System.Private.Corelib (or mscorlib). It includes the garbage collector, JIT compiler, base .NET data types and many low-level classes. We welcome contributions.","fork":false,"url":"https://api.github.com/repos/dotnet/coreclr","forks_url":"https://api.github.com/repos/dotnet/coreclr/forks","keys_url":"https://api.github.com/repos/dotnet/coreclr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/coreclr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/coreclr/teams","hooks_url":"https://api.github.com/repos/dotnet/coreclr/hooks","issue_events_url":"https://api.github.com/repos/dotnet/coreclr/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/coreclr/events","assignees_url":"https://api.github.com/repos/dotnet/coreclr/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/coreclr/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/coreclr/tags","blobs_url":"https://api.github.com/repos/dotnet/coreclr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/coreclr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/coreclr/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/coreclr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/coreclr/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/coreclr/languages","stargazers_url":"https://api.github.com/repos/dotnet/coreclr/stargazers","contributors_url":"https://api.github.com/repos/dotnet/coreclr/contributors","subscribers_url":"https://api.github.com/repos/dotnet/coreclr/subscribers","subscription_url":"https://api.github.com/repos/dotnet/coreclr/subscription","commits_url":"https://api.github.com/repos/dotnet/coreclr/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/coreclr/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/coreclr/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/coreclr/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/coreclr/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/coreclr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/coreclr/merges","archive_url":"https://api.github.com/repos/dotnet/coreclr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/coreclr/downloads","issues_url":"https://api.github.com/repos/dotnet/coreclr/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/coreclr/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/coreclr/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/coreclr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/coreclr/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/coreclr/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/coreclr/deployments","created_at":"2015-01-30T22:10:02Z","updated_at":"2018-02-27T02:27:56Z","pushed_at":"2018-02-27T12:15:56Z","git_url":"git://github.com/dotnet/coreclr.git","ssh_url":"git@github.com:dotnet/coreclr.git","clone_url":"https://github.com/dotnet/coreclr.git","svn_url":"https://github.com/dotnet/coreclr","homepage":"https://github.com/dotnet/core","size":208687,"stargazers_count":8981,"watchers_count":8981,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2256,"mirror_url":null,"archived":false,"open_issues_count":1572,"license":null,"forks":2256,"open_issues":1572,"watchers":8981,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/16622"},"html":{"href":"https://github.com/dotnet/coreclr/pull/16622"},"issue":{"href":"https://api.github.com/repos/dotnet/coreclr/issues/16622"},"comments":{"href":"https://api.github.com/repos/dotnet/coreclr/issues/16622/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/16622/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/16622/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/coreclr/statuses/37e34d38d3267f4bd18381b779a0a9caa02d77cf"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"jkotas"}}