<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 --- - Method Verifier::visitAliaseeSubExpr stack overflows"
   href="https://llvm.org/bugs/show_bug.cgi?id=24644">24644</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Method Verifier::visitAliaseeSubExpr stack overflows
          </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=14800" name="attach_14800" title="Assembly file">attachment 14800</a> <a href="attachment.cgi?id=14800&action=edit" title="Assembly file">[details]</a></span>
Assembly file

See attached for test case (<a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Need to add product version numbers"
   href="show_bug.cgi?id=1">bug1</a>.ll).

This bug was found using afl-fuzz.

To see error: build llvm-as using the following steps:

% cmake -GNinja  -DLLVM_USE_SANITIZER=Address -DLLVM_USE_SANITIZE_COVERAGE=YES
-DCMAKE_BUILD_TYPE=Release /path/to/llvm

% ninja bin/llvm-as

Then run:

bin/llvm-as <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Need to add product version numbers"
   href="show_bug.cgi?id=1">bug1</a>.ll -o /dev/null

The output is:

ASAN:DEADLYSIGNAL
=================================================================
==24746==ERROR: AddressSanitizer: stack-overflow on address 0x7ffef9709fa0 (pc
0x000000b0c4e5 bp 0x7ffef970a090 sp 0x7ffef9709fa0 T0)
    #0 0xb0c4e4 in (anonymous
namespace)::Verifier::VerifyConstantExprBitcastType(llvm::ConstantExpr const*)
/workspace/llvm-dev/llvm/lib/IR/Verifier.cpp:1500
    #1 0xb48d23 in (anonymous
namespace)::Verifier::visitAliaseeSubExpr(llvm::SmallPtrSetImpl<llvm::GlobalAlias
const*>&, llvm::GlobalAlias const&, llvm::Constant const&)
/workspace/llvm-dev/llvm/lib/IR/Verifier.cpp:584:5
    #2 0xb491df in (anonymous
namespace)::Verifier::visitAliaseeSubExpr(llvm::SmallPtrSetImpl<llvm::GlobalAlias
const*>&, llvm::GlobalAlias const&, llvm::Constant const&)
/workspace/llvm-dev/llvm/lib/IR/Verifier.cpp:591:7
...
    #249 0xb491df in (anonymous
namespace)::Verifier::visitAliaseeSubExpr(llvm::SmallPtrSetImpl<llvm::GlobalAlias
const*>&, llvm::GlobalAlias const&, llvm::Constant const&)
/workspace/llvm-dev/llvm/lib/IR/Verifier.cpp:591:7
    #250 0xb491df in (anonymous
namespace)::Verifier::visitAliaseeSubExpr(llvm::SmallPtrSetImpl<llvm::GlobalAlias
const*>&, llvm::GlobalAlias const&, llvm::Constant const&)
/workspace/llvm-dev/llvm/lib/IR/Verifier.cpp:591:7 
    #251 0xb491df in (anonymous
namespace)::Verifier::visitAliaseeSubExpr(llvm::SmallPtrSetImpl<llvm::GlobalAlias
const*>&, llvm::GlobalAlias const&, llvm::Constant const&)
/workspace/llvm-dev/llvm/lib/IR/Verifier.cpp:591:7

SUMMARY: AddressSanitizer: stack-overflow
/workspace/llvm-dev/llvm/lib/IR/Verifier.cpp:1500 in (anonymous
namespace)::Verifier::VerifyConstantExprBitcastType(llvm::ConstantExpr const*)
==24746==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>