<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=http://email.email.llvm.org/c/eJylVFtvmzAU_jXwcgQCkwTywEOypFW0rovWdnuMHHMI3gxGtmmXfz_bkDadpu1hkRXsc7985xxldS53QFsw6sy7ExgJauiACWofL9w0QIEN2sgWeqo19GI48S4GrzNopxIkmyBZBYtkPLoZCRs8cnqx9IxKc9lBmsVJnEYBWdtDEpKmJF0keZYkS0sockYJYUdKahqlQb7Fn737XATTZZbMlnFW_OZyfPJOGyoEVlArGy7tDTTG9DrIVgG5scdSYiGe21iqk6OMRvz_pzNg25vzlB9wDVRDLYWQL97Ae4cfxgQmKsl4x8RQIQSEOAfW-N4WC_V02Y9Fayx7VBkL19EWdU8ZglfK1tcR4U-DqnMWrTMCd3dfPx1Wj49fduunx-3h23b1EVxc2WrUdbc3V3f8qKg677pajtac0C2aNwnPIkVAlhDkk2OwP4VmcG7ztfe4v3u63d0fVvvd4ev2y8Pu831APrig2nPkCxaNBXOZWYbXmQQPDzbY-1svP18H84115_yvBy4qVNbIYr---M837rxWwN7_1OERS0xR3aAGCyfT4NQkV0_e9YOBmgv8U8f825x7rLCGZ8kr8PmvLDIs9greGftw9_d9sHQwqC2zuIHa8acQr4rmZKpXPUepve1FdW3vqrzJP1N9adCisHuWPyye_wbFy7iNtYk-pxDZT-2G9dKbbNOet65ZEw61hIgBaMUsPl1uMYNIXr_lb07CqsyqZbakIR1MI1XZSFm1tMNwUKJ8P2UnuzSGY8ykG4NpGtwn6pX8jswW8oZrPfjhmJO8KMKmTEmGSbpkjKbzOZulBCuWJrhks3ye1TMaCnpEoUsHJEI6fAFvwqFuvgn_PwJeTiumSBakIIv4yIoFSbCw0aQ0T_JglmBLuXjdH6EqvcnjcNKWKbg2-o1pi89PHWI5Ij803AgsH_BU00EY8M0dG-aWrV-z4_pxFq4XrWsm7SwCQPfIeM0ZaDkouzIczEOfRulz-AWQdrd3>52788</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Segfault when clang run with empty llvm pass plugin -g and a specific source file
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
hoodmane
</td>
</tr>
</table>
<pre>
I am trying to run clang with a custom pass plugin. I am using
```sh
Debian clang version 13.0.1-++20211216073009+87ca22cba2fa-1~exp1~20211216193049.38
```
installed from apt https://apt.llvm.org/
My empty plugin is as follows:
```C++
#include "llvm/Passes/PassPlugin.h"
using namespace llvm;
extern "C" LLVM_ATTRIBUTE_WEAK ::llvm::PassPluginLibraryInfo
llvmGetPassPluginInfo() {
return {LLVM_PLUGIN_API_VERSION, "my-empty-plugin", LLVM_VERSION_STRING, [](PassBuilder &PB) {}};
}
```
clang crashes on the following input file:
```C
typedef void (*F)(int*);
int test(F f)
{
int d;
f(&d);
return 0;
}
```
when invoked as follows:
```sh
clang -O1 -g -fpass-plugin=myEmptyPlugin.so -c src/test.c -o src/test.o
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyFVNtu2zgQ_RrpZSBBoqqLH_Rg105gbJoaTdo-GjQ1srhLiQJJJfXfL0nJiVMUuwZhkTOcOXM5w5NsLvUeaA9GXfhwBiNBTQMwQe3hlZsOKLBJG9nDSLWGUUxnPsTgbSbtTIJkGyTroEjmpbtZsMUTp1dPL6g0lwOkWZzEaRSQjV0kIWlK0iIpsyRZWUFVMkoIO1HS0igNyh3-Gt3nejFdZcmnVZxVv0HORz5oQ4XABlplw6Wjgc6YUQfZOiB3dllJLMRLH0t1dpLZif__cgHsR3NZ8gOugWpopRDy1Tv4CPh5TmCRkowPTEwNQkCIA7DOD7ZYqJfNYS5aZ9WzyVy4gfaoR8oQvFG2uY0IfxlUg_NowQg8PPz4clw_P3_bb74_744_d-u_wMWVrWdbt3uHeuAnRdVlP7Ry9uYu3aN5v-FVpArICoJyAQb7U2gmB1tuPOLh4fv9_vG4PuyPP3bfnvZfHwPy2Q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