<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/121385>121385</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Bug report crash dump when processing arguments for custom attributes in plugin
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
rsashka
</td>
</tr>
</table>
<pre>
> PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
**This behavior is similar to that of clang versions 19 and 18.**
```
Stack dump:
0. Program arguments: clang++ -c -g -fplugin=./TooManyParams.so -Xclang -add-plugin -Xclang TooManyParams -fplugin-arg-TooManyParams-ddddddd -MMD -MP -MF build/Debug/CLang-Linux/your_source_file.o.d -o build/Debug/CLang-Linux/your_source_file.o your_source_file.cpp
1. <eof> parser at end of file
2. Per-file LLVM IR generation
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0 libLLVM.so.19.1 0x00007fa3dab83e06 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 54
1 libLLVM.so.19.1 0x00007fa3dab81ab0 llvm::sys::RunSignalHandlers() + 80
2 libLLVM.so.19.1 0x00007fa3dab83264 llvm::sys::CleanupOnSignal(unsigned long) + 244
3 libLLVM.so.19.1 0x00007fa3daad19d0
4 libpthread.so.0 0x00007fa3e5b8e420
5 libclang-cpp.so.19.1 0x00007fa3e2a5223a clang::Stmt::getBeginLoc() const + 58
6 libclang-cpp.so.19.1 0x00007fa3e3a45f6d clang::CodeGen::CodeGenModule::EmitAnnotationArgs(clang::AnnotateAttr const*) + 381
7 libclang-cpp.so.19.1 0x00007fa3e3a46258 clang::CodeGen::CodeGenModule::EmitAnnotateAttr(llvm::GlobalValue*, clang::AnnotateAttr const*, clang::SourceLocation) + 232
8 libclang-cpp.so.19.1 0x00007fa3e3a45a5e clang::CodeGen::CodeGenModule::AddGlobalAnnotations(clang::ValueDecl const*, llvm::GlobalValue*) + 254
9 libclang-cpp.so.19.1 0x00007fa3e3a3abc8 clang::CodeGen::CodeGenModule::EmitGlobalAnnotations() + 120
10 libclang-cpp.so.19.1 0x00007fa3e3a37b3c clang::CodeGen::CodeGenModule::Release() + 1644
11 libclang-cpp.so.19.1 0x00007fa3e3ae5d8b
12 libclang-cpp.so.19.1 0x00007fa3e3a1a9c8 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 184
13 libclang-cpp.so.19.1 0x00007fa3e4549bdc clang::MultiplexConsumer::HandleTranslationUnit(clang::ASTContext&) + 44
14 libclang-cpp.so.19.1 0x00007fa3e2467e69 clang::ParseAST(clang::Sema&, bool, bool) + 665
15 libclang-cpp.so.19.1 0x00007fa3e450eb85 clang::FrontendAction::Execute() + 85
16 libclang-cpp.so.19.1 0x00007fa3e4484274 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 964
17 libclang-cpp.so.19.1 0x00007fa3e458ac7e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 702
18 clang++ 0x000056241456f6e0 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 5376
19 clang++ 0x000056241456c9e5
20 libclang-cpp.so.19.1 0x00007fa3e41239d9
21 libLLVM.so.19.1 0x00007fa3daad1768 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) + 136
22 libclang-cpp.so.19.1 0x00007fa3e412337d clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const + 365
23 libclang-cpp.so.19.1 0x00007fa3e40e99d9 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const + 921
24 libclang-cpp.so.19.1 0x00007fa3e40e9c4e clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const + 142
25 libclang-cpp.so.19.1 0x00007fa3e410672b clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) + 331
26 clang++ 0x000056241456c45f clang_main(int, char**, llvm::ToolContext const&) + 6623
27 clang++ 0x0000562414579706 main + 102
28 libc.so.6 0x00007fa3d97c4083 __libc_start_main + 243
29 clang++ 0x000056241456a72e _start + 46
clang++: error: clang frontend command failed with exit code 139 (use -v to see invocation)
Ubuntu clang version 19.1.6 (++20241217110052+657e03f8625c-1~exp1~20241217110110.73)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-19/bin
clang++: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++: note: diagnostic msg: /tmp/your_source_file-338540.cpp
clang++: note: diagnostic msg: /tmp/your_source_file-338540.sh
clang++: note: diagnostic msg:
********************
```
File: your_source_file.cpp
```cpp
[[memsafe("sss")]] void my_function(int a, int b, int c, int d) {
// Function implementation
}
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy8WEtv4zgS_jXMpWBDot6HHBQn7u6Bsx0kntnHxaCkssxtiRRIyuPsYX77gpScWHlMnN7BGgIsUUXWV6-PVDGteS0QL0l0RaLrC9abnVSXSjO9-8EuClk9XpLgBu5WN_nDDei-aLkBBkVfg8JOKgNGws6YTpMgJ3RJ6LLmZtcX81K2hC6bZn_8m3VK_htLQ-iSa92jJnQJTFTARdn0FYLZIZSK6R0UrPxhFCuR0AV0CjslS9QaK9CyV8Owncm0liVnBitQvQBdKt6ZOfFye1F7rXdcQ4E7tudSAdegecsbpixss2MG5BbKhoka9qg0l0KDn7m1_XQ-LDEuF3vj5eUPhpU_oOrbzhrt5d6ceNmdkrViLTBV9y0KYx0yLE3oFaFXMCthVsNs2zV9zQUJrueELtdS3jLxeMcUa_VcS5j9Y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