[LLVMbugs] [Bug 720] NEW: Segfault when running hello world with invalid bytecode signature

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Mar 21 16:13:02 PST 2006


           Summary: Segfault when running hello world with invalid bytecode
           Product: tools
           Version: 1.6
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: lli
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: u3950692 at anu.edu.au


I wrote a Hello World program in c++, which compiled without errors on llvm-g++.
 When I run the resulting file, though, I get a segmentation fault.  Attempting
to use llvm-dis tells me about an invalid bytecode signature.  This happened
when using the provided ./hello script, and also when manually invoking lli on

I am on an x86 system running Gentoo linux, 
llvm-g++ version 
  llvm-g++ (GCC) 3.4-llvm 20051104 (LLVM 1.6)
g++ version 
  g++ (GCC) 3.4.5 (Gentoo 3.4.5, ssp-3.4.5-1.0, pie-8.7.9)

The code
#include <iostream>

int main(){
  std::cout<<"Hello World, via LLVM.\n";
  return 0;

The command line:
-I /usr/local/bin/llvm/cfrontend/x86/llvm-gcc/include/c++/3.4-llvm/ -L
/usr/local/bin/llvm/cfrontend/x86/llvm-gcc/lib/ -I
-o hello hello.cpp

The segfault:
lli((anonymous namespace)::PrintStackTrace()+0x1a)[0x85437a8]
lli((anonymous namespace)::SignalHandler(int)+0xe9)[0x8543a37]
std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char>
>, std::allocator<std::basic_string<char, std::char_traits<char>,
std::allocator<char> > > > const&, char const* const*)+0x2ee)[0x83760f0]
Segmentation fault

llvm-dis output:
llvm-dis: Invalid bytecode signature: 622F2123 (Vers=0, Pos=4)

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