<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - crash when -load a .so file"
   href="https://bugs.llvm.org/show_bug.cgi?id=37250">37250</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>crash when -load a .so file
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>5.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Modules
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>790358237@qq.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>when i use llvm Compile a afl, it crash like this

clang -cc1  -load ./afl-llvm-pass.so   -o test.o -x c test.c

Segmentation fault (core dumped)


gdb log

```
[----------------------------------registers-----------------------------------]
RAX: 0x7ffff7ff3ee0 
RBX: 0x21b62f8 --> 0x6 
RCX: 0x0 
RDX: 0x3 
RSI: 0x21b6300 --> 0x7ffff7ff2f30 
RDI: 0x21b6300 --> 0x7ffff7ff2f30 
RBP: 0x21b6258 --> 0x1 
RSP: 0x7fffffffc818 --> 0x7ffff5928d3b (cmp    rbp,rbx)
RIP: 0x7ffff7ff3ee0 
R8 : 0x21b8f20 --> 0x21b8f50 --> 0x61616369736162 ('basicaa')
R9 : 0x0 
R10: 0x7ffff7ff6148 
R11: 0x206 
R12: 0x21b6240 --> 0x21b6258 --> 0x1 
R13: 0x7fffffffd4f0 --> 0x7fffffffe209 --> 0x6f6c2d003163632d ('-cc1')
R14: 0x7fffffffd4e8 --> 0x7fffffffe1fa ("/usr/bin/clang")
R15: 0x0
EFLAGS: 0x10202 (carry parity adjust zero sign trap INTERRUPT direction
overflow)
[-------------------------------------code-------------------------------------]
Invalid $PC address: 0x7ffff7ff3ee0
[------------------------------------stack-------------------------------------]
0000| 0x7fffffffc818 --> 0x7ffff5928d3b (cmp    rbp,rbx)
0008| 0x7fffffffc820 --> 0x7ffff7b843a0 --> 0x21b6240 --> 0x21b6258 --> 0x1 
0016| 0x7fffffffc828 --> 0x0 
0024| 0x7fffffffc830 --> 0x9 ('\t')
0032| 0x7fffffffc838 --> 0x7ffff4d9f22d
(<_ZNK4llvm17ManagedStaticBase7destroyEv+29>:   mov    QWORD PTR [rbx],0x0)
0040| 0x7fffffffc840 --> 0x2197c20 --> 0x2197c40 --> 0x100000001 
0048| 0x7fffffffc848 --> 0x7ffff4d9f3d5 (<_ZN4llvm13llvm_shutdownEv+53>:       
mov    rdi,QWORD PTR [rip+0x2dc8294]        # 0x7ffff7b67670)
0056| 0x7fffffffc850 --> 0x7fffffffca80 --> 0x0 
[------------------------------------------------------------------------------]
Legend: code, data, rodata, value
Stopped reason: SIGSEGV
0x00007ffff7ff3ee0 in ?? ()
gdb-peda$ bt
#0  0x00007ffff7ff3ee0 in ?? ()
#1  0x00007ffff5928d3b in ?? () from /usr/lib/x86_64-linux-gnu/libLLVM-5.0.so.1
#2  0x00007ffff4d9f22d in llvm::ManagedStaticBase::destroy() const () from
/usr/lib/x86_64-linux-gnu/libLLVM-5.0.so.1
#3  0x00007ffff4d9f3d5 in llvm::llvm_shutdown() () from
/usr/lib/x86_64-linux-gnu/libLLVM-5.0.so.1
#4  0x00000000007e840b in main ()
#5  0x00007ffff3784830 in __libc_start_main (main=0x7e8370 <main>, argc=0x9,
argv=0x7fffffffde08, init=<optimized out>, fini=<optimized out>,
rtld_fini=<optimized out>, stack_end=0x7fffffffddf8)
    at ../csu/libc-start.c:291
#6  0x00000000007f9b39 in _start ()

```</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>