llvm / llvm/llvm-project

Calling `__abnormal_termination` terminates clang abnormally

Open
#213,060 6 comments 2 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.