[LLVMbugs] [Bug 721] NEW: llc segfaults on creating a simple native hello world application.

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun Mar 26 05:06:57 PST 2006


http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=721

           Summary: llc segfaults on creating a simple native hello world
                    application.
           Product: tools
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: llc
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: ramana.radhakrishnan at codito.com


Using llvmgcc c frontend from 1.6 and today's trunk for the llvm tools : these
are the steps I followed. 

ramana at zirakzigil:~/fsf/llvm/myexamples$ cat hello.c

#include <stdio.h>
void main (void)
{
  printf ("hello world\n");
}

ramana at zirakzigil:~/fsf/llvm/myexamples$ llvm-gcc hello.c
ramana at zirakzigil:~/fsf/llvm/myexamples$ llc -f -march=x86 a.out.bc -o a.out.s
llc((anonymous namespace)::PrintStackTrace()+0x18)[0x8c9fea8]
llc((anonymous namespace)::SignalHandler(int)+0xfa)[0x8ca012a]
[0xffffe420]
llc(llvm::GlobalVariable::hasInitializer() const+0xc)[0x860aa4a]
llc[0x89e6141]
llc(llvm::DebugInfoDesc::TagFromGlobal(llvm::GlobalVariable*)+0x13)[0x89e61f5]
llc(llvm::DIVerifier::Verify(llvm::GlobalVariable*)+0x33)[0x89e9ad1]
llc(llvm::DIVerifier::Verify(llvm::Value*)+0x20)[0x89e9a94]
llc(llvm::MachineDebugInfo::Verify(llvm::Value*)+0x18)[0x89ea804]
llc(llvm::SelectionDAGLowering::visitIntrinsicCall(llvm::CallInst&, unsigned
int)+0x627)[0x8972227]
llc(llvm::SelectionDAGLowering::visitCall(llvm::CallInst&)+0x71)[0x8973105]
llc(llvm::SelectionDAGLowering::visit(unsigned int, llvm::User&)+0x2a9)[0x89b598f]
llc(llvm::SelectionDAGLowering::visit(llvm::Instruction&)+0x23)[0x89b657d]
llc(llvm::SelectionDAGISel::BuildSelectionDAG(llvm::SelectionDAG&,
llvm::BasicBlock*, std::vector<std::pair<llvm::MachineInstr*, unsigned int>,
std::allocator<std::pair<llvm::MachineInstr*, unsigned int> > >&,
llvm::FunctionLoweringInfo&)+0x15d)[0x89793e7]
llc(llvm::SelectionDAGISel::SelectBasicBlock(llvm::BasicBlock*,
llvm::MachineFunction&, llvm::FunctionLoweringInfo&)+0xc4)[0x8979c42]
llc(llvm::SelectionDAGISel::runOnFunction(llvm::Function&)+0x2d0)[0x8978aba]
llc((anonymous
namespace)::X86DAGToDAGISel::runOnFunction(llvm::Function&)+0x21)[0x887d44b]
llc(llvm::FunctionPassManagerT::runPass(llvm::FunctionPass*,
llvm::Function*)+0x1b)[0x8ba00f1]
llc(llvm::PassManagerT<llvm::FTraits>::runPasses(llvm::Function*,
std::map<llvm::Pass*, std::vector<llvm::Pass*, std::allocator<llvm::Pass*> >,
std::less<llvm::Pass*>, std::allocator<std::pair<llvm::Pass* const,
std::vector<llvm::Pass*, std::allocator<llvm::Pass*> > > > >&)+0x11b)[0x8b9e203]
llc(llvm::PassManagerT<llvm::FTraits>::runOnUnit(llvm::Function*)+0x16a)[0x8b9e09e]
llc(llvm::FunctionPassManagerT::runOnFunction(llvm::Function&)+0x22)[0x8ba0196]
llc(llvm::FunctionPass::runOnModule(llvm::Module&)+0xaa)[0x8ad7cb0]
llc(llvm::ModulePassManager::runPass(llvm::ModulePass*,
llvm::Module*)+0x1b)[0x8ba1d07]
llc(llvm::PassManagerT<llvm::MTraits>::runPasses(llvm::Module*,
std::map<llvm::Pass*, std::vector<llvm::Pass*, std::allocator<llvm::Pass*> >,
std::less<llvm::Pass*>, std::allocator<std::pair<llvm::Pass* const,
std::vector<llvm::Pass*, std::allocator<llvm::Pass*> > > > >&)+0x11b)[0x8ba0b53]
llc(llvm::PassManagerT<llvm::MTraits>::runOnUnit(llvm::Module*)+0x16a)[0x8ba09ee]
llc(llvm::ModulePassManager::runOnModule(llvm::Module&)+0x22)[0x8ad6cae]
llc(llvm::PassManager::run(llvm::Module&)+0x1f)[0x8ad7053]
llc(main+0xe70)[0x85f4b78]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xd2)[0xb7cf2ea2]
llc(__gxx_personality_v0+0x14d)[0x85f3b61]
Segmentation fault


Is this a bug or is there something else I should do ? I guess I will try and
build llvm-gcc, the bandwidth's slow : so i thought I would use the 1.6 released
cfrontend to play around. 

>From a gdb session I figured that the value of GetGlobalVariable(V)  is a NULL
ptr. MachineDebugInfo.cpp : Verify has the segfault. The reason appears to be
the prior getGlobalVariable call returning a null ptr for the variable V.



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




More information about the llvm-bugs mailing list