[LLVMbugs] [Bug 10743] New: JIT compiler crashes on bitcode from clang

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Aug 25 05:00:16 PDT 2011


           Summary: JIT compiler crashes on bitcode from clang
           Product: new-bugs
           Version: trunk
          Platform: PC
               URL: http://pastebin.com/rLHpyprY
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: Lars.Rasmusson at sics.se
                CC: llvmbugs at cs.uiuc.edu

I have discovered a case where the JIT compiler
(ExecutionEnginge::getPointerToFunction(Function*)) aborts with 

program: /home/larsr/src/llvm/lib/ExecutionEngine/JIT/JIT.cpp:616: void
llvm::JIT::runJITOnFunctionUnlocked(llvm::Function*, const llvm::MutexGuard&):
Assertion `!isAlreadyCodeGenerating && "Error: Recursive compilation
detected!"' failed.

Here is example code that breaks the JIT when asking it to get the function

  #include <iostream>

  class C {

  C::C(void) {
          std::cout << "CCC\n";

  extern "C" {
    void makeit() { C(); }

It crashes when:

1) I have compiled a C++ class into bitcode with clang, and
2) the constructor is declared OUTSIDE the type definition, and
3) I compile WITHOUT optimization.

I have attached a script that compiles and runs the code and crashes when the
above criteria are met.  (Look at it at pastebin http://pastebin.com/rLHpyprY )

I use 
clang version 3.0 (http://llvm.org/git/clang.git
Target: i386-pc-linux-gnu


Low Level Virtual Machine (http://llvm.org/):
  llvm version 3.0svn
commit 3c0e5dc40f48eaec7c02d30a1da96858f7f46bec
Date:   Mon Aug 22 10:32:09 2011 +0000

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