{"action":"created","issue":{"url":"https://api.github.com/repos/MicrosoftDocs/cpp-docs/issues/219","repository_url":"https://api.github.com/repos/MicrosoftDocs/cpp-docs","labels_url":"https://api.github.com/repos/MicrosoftDocs/cpp-docs/issues/219/labels{/name}","comments_url":"https://api.github.com/repos/MicrosoftDocs/cpp-docs/issues/219/comments","events_url":"https://api.github.com/repos/MicrosoftDocs/cpp-docs/issues/219/events","html_url":"https://github.com/MicrosoftDocs/cpp-docs/issues/219","id":319166428,"number":219,"title":"The documentation of abort/_set_abort_behavior should mention legacy behavior","user":{"login":"Donpedro13","id":2521782,"avatar_url":"https://avatars1.githubusercontent.com/u/2521782?v=4","gravatar_id":"","url":"https://api.github.com/users/Donpedro13","html_url":"https://github.com/Donpedro13","followers_url":"https://api.github.com/users/Donpedro13/followers","following_url":"https://api.github.com/users/Donpedro13/following{/other_user}","gists_url":"https://api.github.com/users/Donpedro13/gists{/gist_id}","starred_url":"https://api.github.com/users/Donpedro13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Donpedro13/subscriptions","organizations_url":"https://api.github.com/users/Donpedro13/orgs","repos_url":"https://api.github.com/users/Donpedro13/repos","events_url":"https://api.github.com/users/Donpedro13/events{/privacy}","received_events_url":"https://api.github.com/users/Donpedro13/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-05-01T10:30:45Z","updated_at":"2018-05-03T17:28:27Z","closed_at":null,"author_association":"NONE","body":"In some circumstances, the Universal CRT's `abort` will use the Win32 function `ExitProcess` to end the current process. Due to implementation details, this will call back some global destructors, which clearly violates the C++ standard. For details, see the [bug report](https://developercommunity.visualstudio.com/content/problem/236146/stdabort-erroneously-calls-back-global-destructors.html) I've filed about this phenomenon. In this bug report, I was told by Steve Wishnousky (@stwish-msft) that this is legacy behavior required because of compatibility reasons.\r\n\r\nI think this should definitely be mentioned in the documentation page of both [`abort`](https://github.com/MicrosoftDocs/cpp-docs/blob/master/docs/c-runtime-library/reference/abort.md) and [`_set_abort_behavior`](https://github.com/MicrosoftDocs/cpp-docs/blob/master/docs/c-runtime-library/reference/set-abort-behavior.md)."},"comment":{"url":"https://api.github.com/repos/MicrosoftDocs/cpp-docs/issues/comments/386373385","html_url":"https://github.com/MicrosoftDocs/cpp-docs/issues/219#issuecomment-386373385","issue_url":"https://api.github.com/repos/MicrosoftDocs/cpp-docs/issues/219","id":386373385,"user":{"login":"tlemo","id":13824553,"avatar_url":"https://avatars2.githubusercontent.com/u/13824553?v=4","gravatar_id":"","url":"https://api.github.com/users/tlemo","html_url":"https://github.com/tlemo","followers_url":"https://api.github.com/users/tlemo/followers","following_url":"https://api.github.com/users/tlemo/following{/other_user}","gists_url":"https://api.github.com/users/tlemo/gists{/gist_id}","starred_url":"https://api.github.com/users/tlemo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tlemo/subscriptions","organizations_url":"https://api.github.com/users/tlemo/orgs","repos_url":"https://api.github.com/users/tlemo/repos","events_url":"https://api.github.com/users/tlemo/events{/privacy}","received_events_url":"https://api.github.com/users/tlemo/received_events","type":"User","site_admin":false},"created_at":"2018-05-03T17:28:27Z","updated_at":"2018-05-03T17:28:27Z","author_association":"NONE","body":">\n> The intent of abort is clear: to terminate the program without any cleanup\n\n\n+1. There's a both pragmatic and conceptual need for a standard, portable\nfail-fast primitive.\n\nDebating the finer points for where/how the DLLs fit into the overall\npicture sounds like an interesting topic but it's a red herring regarding\nabort(). Preserving broken behavior for back compat reasons is\nunderstandable (up to a point) but it doesn't change the fact that that\nit's it's a bug.\n\nI'd urge the CRT team to take a closer look at this. Quoting from the\noriginal bug report:\n\nwe found a large amount of code is dependent on the CRT calling\n> ExitProcess, primarily because it allows threads in other DLLs to continue\n> to run.\n\n\nNo, you don't want to allow other threads to run in a corrupted process\nstate.\n\n\nOn Wed, May 2, 2018 at 8:23 AM Donpedro13 <notifications@github.com> wrote:\n\n> I think it's wiser to approach this from a practical standpoint (instead\n> of playing the \"the concept of a DLL is an implementation detail, so we can\n> do whatever we want\" card, if you don't mind me being a bit sassy 😈).\n>\n> The intent of abort is clear: to terminate the program without any\n> cleanup. The original case that made me file the bug report provides a\n> perfect practical example:\n>\n>    - The OpenGL driver of a major graphics vendor encountered an\n>    unrecoverable internal error\n>    - Because of this, they wanted to tear down the process, and they\n>    called abort to do so\n>    - But due to this compatibility quirk, global destructors in DLLs ran\n>    - One of the destructors ended up calling into the OpenGL driver\n>    - This call crashed inside the driver, because it was in a corrupt\n>    state (that's why it called abort earlier in the first place)\n>\n> —\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/MicrosoftDocs/cpp-docs/issues/219#issuecomment-386016668>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/ANLyKSabrVA6TqniYmo1TQIPiggVJ5P1ks5tuc9hgaJpZM4Tty5v>\n> .\n>\n"}}
{"actor":{"display_login":"tlemo"}}