<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - llc segfaults on custom bc"
   href="http://llvm.org/bugs/show_bug.cgi?id=18704">18704</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>llc segfaults on custom bc
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.3
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>cplusplus328@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=11997" name="attach_11997" title="the file that causes the crash">attachment 11997</a> <a href="attachment.cgi?id=11997&action=edit" title="the file that causes the crash">[details]</a></span>
the file that causes the crash

I am tinkering with making my own compiler for my own language. Attached is a
bc file my frontend generates. This may be invalid input, but llc does not give
any error print besides a backtrace and segfault, so I can't figure out where
my error is if there is one.
I tried running the attached bc through llc and it crashed. bugpoint also
segfaults on the file.

Printed backtrace:
0  libLLVM-3.3.so.1 0x00002b843f3de382 llvm::sys::PrintStackTrace(_IO_FILE*) +
34
1  libLLVM-3.3.so.1 0x00002b843f3de711
2  libpthread.so.0  0x00002b843fe2fcb0
3  libLLVM-3.3.so.1 0x00002b843eae2a98
llvm::BitcodeReader::ParseFunctionBody(llvm::Function*) + 1672
4  libLLVM-3.3.so.1 0x00002b843eae7465
llvm::BitcodeReader::Materialize(llvm::GlobalValue*, std::string*) + 309
5  libLLVM-3.3.so.1 0x00002b843eae170d
llvm::BitcodeReader::MaterializeModule(llvm::Module*, std::string*) + 77
6  libLLVM-3.3.so.1 0x00002b843ed459fb
llvm::Module::MaterializeAllPermanently(std::string*) + 27
7  libLLVM-3.3.so.1 0x00002b843eae23e9
llvm::ParseBitcodeFile(llvm::MemoryBuffer*, llvm::LLVMContext&, std::string*) +
41
8  libLLVM-3.3.so.1 0x00002b843ede4b2c llvm::ParseIR(llvm::MemoryBuffer*,
llvm::SMDiagnostic&, llvm::LLVMContext&) + 396
9  libLLVM-3.3.so.1 0x00002b843ede51c9 llvm::ParseIRFile(std::string const&,
llvm::SMDiagnostic&, llvm::LLVMContext&) + 761
10 llc              0x000000000040a044
11 llc              0x0000000000409a81 main + 385
12 libc.so.6        0x00002b844036976d __libc_start_main + 237
13 llc              0x0000000000409af1
Stack dump:
0.    Program arguments: llc example.bc -o - 
Segmentation fault (core dumped)</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>