[LLVMbugs] [Bug 1730] New: lli segmentation fault

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sat Oct 13 07:27:28 PDT 2007


http://llvm.org/bugs/show_bug.cgi?id=1730

           Summary: lli segmentation fault
           Product: tools
           Version: 2.1
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: lli
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: edwintorok at gmail.com
                CC: llvmbugs at cs.uiuc.edu


$ lli -load=/usr/lib/libz.so -load=/usr/lib/libbz2.so -load=/usr/lib/libnsl.so
-load=/usr/lib/libgmp.so clamscan.bc -ddaily.pdb
lli[0x8551ab]
/lib/libc.so.6[0x31c6c31710]
[0x2ac206fc8303]
Segmentation fault


Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x2b60324b5ea0 (LWP 29729)]
0x00002b6032a3b623 in ?? ()
(gdb) bt
#0  0x00002b6032a3b623 in ?? ()
#1  0x0000000001d94800 in ?? ()
#2  0x0000000001627358 in ?? ()
#3  0x00000000000000bc in ?? ()
#4  0x00000031c6c7563c in free () from /lib/libc.so.6
#5  0x0000000001cbc1d0 in ?? ()
#6  0x0000000001c9c1e0 in ?? ()
#7  0x0000000000000010 in ?? ()
#8  0x0000000001c9c1d0 in ?? ()
#9  0x0000000000020010 in ?? ()
#10 0x00020010016273e8 in ?? ()
#11 0x0010000000000010 in ?? ()
#12 0x00007fff7860b770 in ?? ()
#13 0x00000000005c203d in ?? ()
#14 0x000000000058fc53 in X86CompilationCallback2 ()
#15 0x000000000058fbaa in X86CompilationCallback ()
#16 0x0000000000000007 in ?? ()
#17 0x00002b6032a3a92a in ?? ()
#18 0x0000000001626ca0 in ?? ()
#19 0x00000000005c937b in llvm::ExecutionEngine::EmitGlobalVariable ()
#20 0x00000031c6c7563c in free () from /lib/libc.so.6
#21 0x00000000005c4312 in std::_Rb_tree<llvm::Function*,
std::pair<llvm::Function* const, void*>,
std::_Select1st<std::pair<llvm::Function* const, void*> >,
std::less<llvm::Function*>, std::allocator<std::pair<llvm::Function* const,
void*> > >::erase ()
#22 0x00000000005c203d in ?? ()
#23 0x000000000058fc53 in X86CompilationCallback2 ()
#24 0x000000000058fbaa in X86CompilationCallback ()
#25 0x0000000000000007 in ?? ()
---Type <return> to continue, or q <return> to quit---
#26 0x00002b6032a38c00 in ?? ()
#27 0x0000000000000000 in ?? ()

If I use llc -march=x86-64 to compile it to native code, I get no segmentation
faults (and no valgrind warnings).

$ llvm-gcc -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../llvm-gcc4.2-2.1.source/configure
--prefix=/home/edwin/obj/../install --enable-llvm=/home/edwin/llvm-2.1/
--enable-languages=c --disable-multilib --disable-shared
Thread model: posix
gcc version 4.2.1(llvm) (Based on Apple Inc. build 5530)

$ lvm-link -version
Low Level Virtual Machine (http://llvm.org/):
  llvm version 2.1
  Optimized build with assertions.

$ lli -version
Low Level Virtual Machine (http://llvm.org/):
  llvm version 2.1
  Optimized build with assertions


I tried to get a backtrace by using a Debug build of latest SVN (r42921),
but I got nothing useful.


Starting program: /home/edwin/llvm-svn/llvm/Debug/bin/lli
-load=/usr/lib/libz.so -load=/usr/lib/libbz2.so -load=/usr/lib/libnsl.so
-load=/usr/lib/libgmp.so clamscan.bc -ddaily.pdb
warning: no loadable sections found in added symbol-file system-supplied DSO at
0x7fffb81fd000
[Thread debugging using libthread_db enabled]
[New Thread 0x2b81f2aafea0 (LWP 30005)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x2b81f2aafea0 (LWP 30005)]
0x00002b81f3022ade in ?? ()
(gdb) bt
#0  0x00002b81f3022ade in ?? ()
#1  0x0000000001882c8f in ?? ()
#2  0x0000000000000000 in ?? ()
(gdb)  

If i use -force-interpreter: 

Starting program: /home/edwin/llvm-svn/llvm/Debug/bin/lli
-force-interpreter=true -load=/usr/lib/libz.so -load=/usr/lib/libbz2.so
-load=/usr/lib/libnsl.so -load=/usr/lib/libgmp.so clamscan.bc -ddaily.pdb
warning: no loadable sections found in added symbol-file system-supplied DSO at
0x7ffffd9fd000
[Thread debugging using libthread_db enabled]
[New Thread 0x2b63ad177ea0 (LWP 30021)]
lli: APInt.cpp:99: llvm::APInt::APInt(const llvm::APInt&): Assertion `BitWidth
<= IntegerType::MAX_INT_BITS && "bitwidth too large"' failed.

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x2b63ad177ea0 (LWP 30021)]
0x00000031c6c316a5 in raise () from /lib/libc.so.6
(gdb) bt
#0  0x00000031c6c316a5 in raise () from /lib/libc.so.6
#1  0x00000031c6c33100 in abort () from /lib/libc.so.6
#2  0x00000031c6c2ac2f in __assert_fail () from /lib/libc.so.6
#3  0x0000000000b1c801 in APInt (this=0x7ffffd9567a8, that=@0x7ffffd9566e8) at
APInt.cpp:99
#4  0x0000000000723ef1 in GenericValue (this=0x7ffffd9567a0)
    at /home/edwin/llvm-svn/llvm/include/llvm/ExecutionEngine/GenericValue.h:26
#5  0x000000000084a134 in llvm::Interpreter::callExternalFunction
(this=0xf94350, F=0x10d83b0, ArgVals=@0x7ffffd956930)
    at ExternalFunctions.cpp:112
#6  0x00000000008445a0 in llvm::Interpreter::callFunction (this=0xf94350,
F=0x10d83b0, ArgVals=@0x7ffffd956930)
    at Execution.cpp:1318
#7  0x0000000000844c64 in llvm::Interpreter::visitCallSite (this=0xf94350,
CS=@0x7ffffd956a50) at Execution.cpp:916
#8  0x000000000085183c in llvm::Interpreter::visitCallInst (this=0xf94350,
I=@0x2a0c6f0) at Interpreter.h:164
#9  0x000000000085185b in llvm::InstVisitor<llvm::Interpreter, void>::visitCall
(this=0xf94350, I=@0x2a0c6f0)
    at /home/edwin/llvm-svn/llvm/include/llvm/Instruction.def:159
#10 0x0000000000851de4 in llvm::InstVisitor<llvm::Interpreter, void>::visit
(this=0xf94350, I=@0x2a0c6f0)
    at /home/edwin/llvm-svn/llvm/include/llvm/Instruction.def:159
#11 0x00000000008465a3 in llvm::Interpreter::run (this=0xf94350) at
Execution.cpp:1354
#12 0x000000000084a3fa in llvm::Interpreter::runFunction (this=0xf94350,
F=0x10d85f0, ArgValues=@0x7ffffd956bd0)
    at Interpreter.cpp:102
#13 0x0000000000869c07 in llvm::ExecutionEngine::runFunctionAsMain
(this=0xf94350, Fn=0x10d85f0, argv=@0xf8d3b8,
    envp=0x7ffffd956ee0) at ExecutionEngine.cpp:284
#14 0x0000000000720efa in main (argc=8, argv=0x7ffffd956e98,
envp=0x7ffffd956ee0) at lli.cpp:141

Any tips on how to debug this further?


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list