[LLVMbugs] [Bug 3494] New: assertion thrown in codegen of debug info "Multiple main"

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Feb 5 21:49:05 PST 2009


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

           Summary: assertion thrown in codegen of debug info "Multiple
                    main"
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: nicholas at mxc.ca
                CC: dpatel at apple.com, llvmbugs at cs.uiuc.edu


Created an attachment (id=2503)
 --> (http://llvm.org/bugs/attachment.cgi?id=2503)
testcase

When building these with LLVMgold:

  $ cat test.c
  extern int foo(void);
  int main (void) {
   return foo();
  }
  $ cat test2.c
  int foo (void) {
   return 0;
  }

we get an assertion failure. Note that there's only one main.

$ llc linked.bc
llc: DwarfWriter.cpp:2786: void llvm::DwarfDebug::ConstructCompileUnits():
Assertion `!MainCU && "Multiple main compile units are found!"' failed.
[New Thread 0xf7c296c0 (LWP 23830)]

Program received signal SIGABRT, Aborted.
[Switching to Thread 0xf7c296c0 (LWP 23830)]
0xffffe425 in __kernel_vsyscall ()
(gdb) bt
#0  0xffffe425 in __kernel_vsyscall ()
#1  0xf7c56640 in raise () from /lib/i686/cmov/libc.so.6
#2  0xf7c58018 in abort () from /lib/i686/cmov/libc.so.6
#3  0xf7c4f5be in __assert_fail () from /lib/i686/cmov/libc.so.6
#4  0x08a9412a in llvm::DwarfDebug::ConstructCompileUnits (this=0x8f983a8)
    at DwarfWriter.cpp:2786
#5  0x08a946e5 in llvm::DwarfDebug::SetDebugInfo (this=0x8f983a8, 
    mmi=0x8f94a88) at DwarfWriter.cpp:2893
#6  0x08a729a0 in llvm::DwarfWriter::BeginModule (this=0x8f8c1d0, M=0x8f73840, 
    MMI=0x8f94a88, OS=@0x8f786b8, A=0x8f965b0, T=0x8f7e028)
    at DwarfWriter.cpp:4233
#7  0x0872868b in llvm::X86ATTAsmPrinter::doInitialization (this=0x8f965b0, 
    M=@0x8f73840) at X86ATTAsmPrinter.cpp:742
#8  0x08cdbe0c in llvm::FPPassManager::doInitialization (this=0x8f76f68, 
    M=@0x8f73840) at PassManager.cpp:1356
#9  0x08cdc043 in llvm::FunctionPassManagerImpl::doInitialization (
    this=0x8f74138, M=@0x8f73840) at PassManager.cpp:1250
#10 0x08cd2d54 in llvm::FunctionPassManager::doInitialization (this=0xffe2c5b8)
    at PassManager.cpp:1233
#11 0x08414c01 in main (argc=2, argv=0xffe2c6d4) at llc.cpp:311

The intermediate result is 'linked.bc' attached. I've decided not to bugpoint
it in case that discards useful information. (Is the .bc bad? Or is it a bug in
dwarf emission?)


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