<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/143336>143336</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[ASAN] "-fsanitize=address" flag halting the executable
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
saksham-joshi
</td>
</tr>
</table>
<pre>
## Code:
```cpp
// CPP VERSION = c++17
#include <exception>
#include <iostream>
struct FileNameNotProvidedToCompiler : public std::exception {
inline virtual const char* what() const noexcept override {
return "getting the file name";
}
};
int main() {
try {
throw FileNameNotProvidedToCompiler();
} catch (const FileNameNotProvidedToCompiler& excep) {
std::cerr << excep.what() << std::endl;
}
std::cerr << "\n >>>> Done <<<<";
}
````
## Issue:
- The above code is being compiled with this command:
```bash
clang++ experi.cpp -o experi.exe -Wall -std=c++17 -fsanitize=address
```
- There are no compilation errors.
- But after executing the executable (i.e. experi.exe), the output is nothing.
- **Neither the ASAN displayed any problem nor the ```std::cerr```**.
- After removing the flag "-fsanitize=address",
```bash
clang++ experi.cpp -o experi.exe -Wall -std=c++17
```
the code compiles with no issues and the executable ran with no problem.
- I ran the same code in online compilers, and it ran with no issues.
- I also used onlinegdb.com's extra compiler flags feature where I placed "-fsanitize=address" as a compiler flag and it ran smoothly. (NOTE: onlinegdb.com uses GCC for C/C++).
## My specs:
- OS: Windows 11 24H2
- Processor: i5 10th gen (x64 arch)
- RAM: 8 GB DDR4
- Clang-version: 20.1.6
> ## Please fix this issue and if I am lacking some knowledge, please teach me. Thank You in Advance🩵.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJysVk-P4rgT_TTmUiIKNn8PHEIY5teH6WnNtH6jPRq7IJ527Mh2gN5Pv7Id6KF3tveyKBKKXX716tVzAfdeHQ3imsw2ZLYd8T401q09f_ENb8c_rW_UaG_l65pQRiiD2kokrCJlReZlfkTXxVe6I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