<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/65511>65511</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            LLVM opt segfaults parsing arguments
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          mauro-balades
      </td>
    </tr>
</table>

<pre>
    ```
$ opt-15 -load /home/mauro/Downloads/alive2/build/tv/tv.so -load-pass-plugin=/home/mauro/Downloads/alive2/build/tv/tv.so -p tv -instcombine -o /dev/null foo.ll
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: opt-15 -load /home/mauro/Downloads/alive2/build/tv/tv.so -load-pass-plugin=/home/mauro/Downloads/alive2/build/tv/tv.so -p tv -instcombine -o /dev/null foo.ll
 #0 0x00007f6cdf3043b1 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1+0xf043b1)
 #1 0x00007f6cdf3020fe llvm::sys::RunSignalHandlers() (/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1+0xf020fe)
 #2 0x00007f6cdf3048d6 (/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1+0xf048d6)
 #3 0x00007f6cddc42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007f6cdf2985f7 llvm::StringMapImpl::LookupBucketFor(llvm::StringRef) (/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1+0xe985f7)
 #5 0x00007f6cdf22092c (/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1+0xe2092c)
 #6 0x00007f6cdf220b6e (/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1+0xe20b6e)
 #7 0x00007f6cdf213e19 (/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1+0xe13e19)
 #8 0x00007f6cdf2127bb llvm::cl::Option::addArgument() (/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1+0xe127bb)
 #9 0x00007f6cdba9562f llvm::cl::list<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, llvm::cl::parser<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>::list<char [8], llvm::cl::desc, llvm::cl::NumOccurrencesFlag, llvm::cl::value_desc, llvm::cl::cat>(char const (&) [8], llvm::cl::desc const&, llvm::cl::NumOccurrencesFlag const&, llvm::cl::value_desc const&, llvm::cl::cat const&) (/home/mauro/Downloads/alive2/build/tv/tv.so+0x8462f)
#10 0x00007f6cdba84dff __static_initialization_and_destruction_0(int, int) (.constprop.0) tv.cpp:0:0
#11 0x00007f6ce549847e call_init ./elf/dl-init.c:69:21
#12 0x00007f6ce5498568 _dl_init ./elf/dl-init.c:116:14
#13 0x00007f6cddd74c85 _dl_catch_exception ./elf/dl-error-skeleton.c:184:18
#14 0x00007f6ce549fff6 dl_open_worker ./elf/dl-open.c:812:6
#15 0x00007f6ce549fff6 dl_open_worker ./elf/dl-open.c:771:1
#16 0x00007f6cddd74c28 _dl_catch_exception ./elf/dl-error-skeleton.c:209:18
#17 0x00007f6ce54a034e _dl_open ./elf/dl-open.c:883:17
#18 0x00007f6cddc906bc dlopen_doit ./dlfcn/dlopen.c:56:13
#19 0x00007f6cddd74c28 _dl_catch_exception ./elf/dl-error-skeleton.c:209:18
#20 0x00007f6cddd74cf3 _dl_catch_error ./elf/dl-error-skeleton.c:228:12
#21 0x00007f6cddc901ae _dlerror_run ./dlfcn/dlerror.c:145:17
#22 0x00007f6cddc90748 dlopen_implementation ./dlfcn/dlopen.c:71:51
#23 0x00007f6cddc90748 dlopen ./dlfcn/dlopen.c:81:12
#24 0x00007f6cdf2ee439 llvm::sys::DynamicLibrary::getPermanentLibrary(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*) (/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1+0xeee439)
#25 0x00007f6cdf276cc1 llvm::PluginLoader::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) (/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1+0xe76cc1)
#26 0x0000558b8a0150a5 (/usr/lib/llvm-15/bin/opt+0x360a5)
#27 0x00007f6cdf2150a6 (/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1+0xe150a6)
#28 0x00007f6cdf2187bb llvm::cl::ParseCommandLineOptions(int, char const* const*, llvm::StringRef, llvm::raw_ostream*, char const*, bool) (/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1+0xe187bb)
#29 0x0000558b8a0113a9 main (/usr/lib/llvm-15/bin/opt+0x323a9)
#30 0x00007f6cddc29d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#31 0x00007f6cddc29e40 call_init ./csu/../csu/libc-start.c:128:20
#32 0x00007f6cddc29e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#33 0x0000558b89ffa905 _start (/usr/lib/llvm-15/bin/opt+0x1b905)
Segmentation fault

```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcWN1z4ygS_2vwC2UXQl_owQ-eybjuqrK3qc3VvaoQIJsLAhWgTHJ__RXIiT7Gc7Ob9c3DphzZ4uPXv26a7gbqnDxpIfYg_wTyuw0d_NnYfUcHa7YNVZQLt2kMf92DAl0-6A6gA8AZNL3fJjncKkM5BPh4Np0A-BgnA3y8M1916HIAH6mSzwIDfGwGqTjAR_8cHztnxvnbnjq37dVwkhqkd38CrYf-GW6ldp6ZrpFawK0J7LgIg_SgFGyN2Sk1KvJw_-Xw-AW6oemkhxQ2wwla0RvroTfw7H3vQHoA-Ajw8ST9eWh2zHQAH5V6fvva9tb8WzAP8FE6N4jAEVLNodRMDVxAfxaQWerOsKHsyVvKxG4U_-gpe4J86PogJTahHYx_D9acLO0gtaehE9oH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