<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 --- - tools/clang/test/CXX/drs/dr4xx.cpp fails under asa in use-after-return mode"
   href="http://llvm.org/bugs/show_bug.cgi?id=19722">19722</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>tools/clang/test/CXX/drs/dr4xx.cpp fails under asa in use-after-return mode
          </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>richard-llvm@metafoo.co.uk
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>kcc@google.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>The following test fails on the asan bootstrap bot
(which uses ASAN_OPTIONS="detect_stack_use_after_return=1)

Exit Code: 1

Command Output (stderr):
--
error: 'note' diagnostics seen but not expected: 
  File
/home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/test/CXX/drs/dr4xx.cpp
Line 39: in instantiation of default argument for 'A<dr401::D>' required here
1 error generated.

Richard Smith says: 
==================
The 'Converted' SmallVector of template arguments lives on the stack.
We choose whether to emit the note based on whether the template instantiation
context is equal to the previous one. 
That compares the (stack) addresses of the arrays of template arguments.

So we don't get the note in normal runs because the stack addresses happen to
be exactly the same, and we do get the note in any use-after-return run.
This is sort of a use-after-return bug, but it doesn't actually access the
stack memory, so ASan doesn't catch it.

This will incidentally be fixed by a patch I'm working on for a different
issue. 
==================

I am going to disable the faulty line in the test for now.</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>