Calling `__abnormal_termination` terminates clang abnormally
Open
clang:codegen
clang:frontend
confirmed
crash-on-invalid
extension:microsoft
generated by fuzzer
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
the following code crashes
```cpp
void a() { _abnormal_termination(); }
```
https://compiler-explorer.com/z/5YTdre7z3
The issue is that `_abnormal_termination` is only designed to be called from a `finally` block but this requirement is not enforced
Bug initially found by @ojhunt
Contributor guide
Research direction
Start with the minimal C++ reproducer calling _abnormal_termination() outside a finally block and compare the behavior shown in the linked Compiler Explorer example. Trace how clang handles this entry point and identify where the requirement for a finally block is or is not checked. Done means the reproducer no longer crashes clang abnormally.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100