Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call abort() in terribly broken states #3906

Merged
merged 8 commits into from Aug 1, 2023

Conversation

AlexGuteniev
Copy link
Contributor

Towards #3888

The following cases do not require terminate(), changed to abort():

  • _Ref_count_base in <memory> for /crl:pure. That was pure call surrogate. Pure CLR can't handle pure calls
  • _Execute_once in excptptr.cpp. It doesn't fail if callback doesn't fail (and the sync object isn't broken)
  • Handle closure in filesystem.cpp. Fail with broken or already closed handles. Catch that with debugger / app verifier, otherwise abort().
  • SRW lock infinite wait. Never fails, except maybe for a broken lock.

Deliberately omitted ppltask.cpp - not sure about that. Looks like that's the last odd terminate(), other terminate()s look legit

@AlexGuteniev AlexGuteniev requested a review from a team as a code owner July 26, 2023 19:57
@github-actions github-actions bot added this to Initial Review in Code Reviews Jul 26, 2023
@StephanTLavavej StephanTLavavej added the enhancement Something can be improved label Jul 26, 2023
@AlexGuteniev
Copy link
Contributor Author

Deliberately omitted ppltask.cpp - not sure about that. Looks like that's the last odd terminate(), other terminate()s look legit

This one seem to be mandated by exception from parallel algorithm requirement and so it is odd that there's an attempt to fastfail before termitate.

stl/inc/memory Outdated Show resolved Hide resolved
@StephanTLavavej StephanTLavavej removed their assignment Jul 26, 2023
@StephanTLavavej StephanTLavavej moved this from Initial Review to Final Review in Code Reviews Jul 26, 2023
* Qualify all calls to "pretty" names in `excptrptr.cpp`, `filesystem.cpp`, `primitives.hpp`, and `iosptrs.cpp`
* Don't qualify calls to "pretty" names in `mutex.cpp` and `stacktrace.cpp`
stl/src/excptptr.cpp Show resolved Hide resolved
stl/src/mutex.cpp Outdated Show resolved Hide resolved
stl/src/stacktrace.cpp Outdated Show resolved Hide resolved
This reverts commit 327c5f6.

This is too much change for this tiny PR. I'll make the files consistent in a followup.
* Don't qualify only the call to `abort` in `mutex.cpp`.
* Don't call `_CSTD abort` in `stacktrace.cpp` when all other such calls are `std::`-qualified
@StephanTLavavej StephanTLavavej removed their assignment Jul 27, 2023
@StephanTLavavej StephanTLavavej moved this from Final Review to Ready To Merge in Code Reviews Jul 27, 2023
@StephanTLavavej StephanTLavavej self-assigned this Jul 31, 2023
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit 2c2cac5 into microsoft:main Aug 1, 2023
35 checks passed
Code Reviews automation moved this from Ready To Merge to Done Aug 1, 2023
@StephanTLavavej
Copy link
Member

🚨 💥 ☠️

@AlexGuteniev AlexGuteniev deleted the panic branch August 2, 2023 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something can be improved
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants