<html>
    <head>
      <base href="https://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 --- - Assertion in GlobalVariable::setInitializer fires on .ll file"
   href="https://llvm.org/bugs/show_bug.cgi?id=24656">24656</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion in GlobalVariable::setInitializer fires on .ll file
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </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>kschimpf@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=14805" name="attach_14805" title="Test file">attachment 14805</a> <a href="attachment.cgi?id=14805&action=edit" title="Test file">[details]</a></span>
Test file

This bug was found using lib/Fuzzer (using llvm-as-fuzzer).

When you run llvm-as compiled with ASAN:

llvm-as bug.ll -o /dev/null

You get:

llvm-as-fuzzer: /workspace/llvm-dev/llvm/lib/IR/Globals.cpp:209: void
llvm::GlobalVariable::setInitializer(llvm::Constant *): Assertion
`InitVal->getType() == getType()->getElementType() && "Initializer type must
match GlobalVariable type"' failed.
ASAN:DEADLYSIGNAL
=================================================================
==24287==ERROR: AddressSanitizer: SEGV on unknown address 0xbe0f00005edf (pc
0x7f23824cdcc9 bp 0x7f2382617830 sp 0x7ffec4a1ead8 T0)
    #0 0x7f23824cdcc8  (/lib/x86_64-linux-gnu/libc.so.6+0x36cc8)
    #1 0x7f23824d10d7  (/lib/x86_64-linux-gnu/libc.so.6+0x3a0d7)
    #2 0x7f23824c6b85  (/lib/x86_64-linux-gnu/libc.so.6+0x2fb85)
    #3 0x7f23824c6c31  (/lib/x86_64-linux-gnu/libc.so.6+0x2fc31)
    #4 0x90a97f 
(/workspace/llvm-dev/build-as-test/bin/llvm-as-fuzzer+0x90a97f)
    #5 0x521c61 
(/workspace/llvm-dev/build-as-test/bin/llvm-as-fuzzer+0x521c61)
    #6 0x51aac0 
(/workspace/llvm-dev/build-as-test/bin/llvm-as-fuzzer+0x51aac0)
    #7 0x50cc94 
(/workspace/llvm-dev/build-as-test/bin/llvm-as-fuzzer+0x50cc94)
    #8 0x50c891 
(/workspace/llvm-dev/build-as-test/bin/llvm-as-fuzzer+0x50c891)
    #9 0x4edfb1 
(/workspace/llvm-dev/build-as-test/bin/llvm-as-fuzzer+0x4edfb1)
    #10 0x4eee30 
(/workspace/llvm-dev/build-as-test/bin/llvm-as-fuzzer+0x4eee30)
    #11 0x4ec7d1 
(/workspace/llvm-dev/build-as-test/bin/llvm-as-fuzzer+0x4ec7d1)
    #12 0xd39071 
(/workspace/llvm-dev/build-as-test/bin/llvm-as-fuzzer+0xd39071)
    #13 0xd38900 
(/workspace/llvm-dev/build-as-test/bin/llvm-as-fuzzer+0xd38900)
    #14 0xd397e5 
(/workspace/llvm-dev/build-as-test/bin/llvm-as-fuzzer+0xd397e5)
    #15 0xd39c83 
(/workspace/llvm-dev/build-as-test/bin/llvm-as-fuzzer+0xd39c83)
    #16 0xd342da 
(/workspace/llvm-dev/build-as-test/bin/llvm-as-fuzzer+0xd342da)
    #17 0xd33650 
(/workspace/llvm-dev/build-as-test/bin/llvm-as-fuzzer+0xd33650)
    #18 0x7f23824b8ec4  (/lib/x86_64-linux-gnu/libc.so.6+0x21ec4)
    #19 0x424ac7 
(/workspace/llvm-dev/build-as-test/bin/llvm-as-fuzzer+0x424ac7)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/lib/x86_64-linux-gnu/libc.so.6+0x36cc8) 
==24287==ABORTING</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>