[llvm-bugs] [Bug 37250] New: crash when -load a .so file

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Apr 26 01:14:44 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=37250

            Bug ID: 37250
           Summary: crash when -load a .so file
           Product: clang
           Version: 5.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Modules
          Assignee: unassignedclangbugs at nondot.org
          Reporter: 790358237 at qq.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

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 ()

```

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180426/8a2feb41/attachment.html>


More information about the llvm-bugs mailing list