<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 --- - alloc/dealloc mismatch caught by ASAN"
   href="https://llvm.org/bugs/show_bug.cgi?id=29060">29060</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>alloc/dealloc mismatch caught by ASAN
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.8
          </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>All Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>alex.zavodny@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=17006" name="attach_17006" title="Test code that reproduces the error.">attachment 17006</a> <a href="attachment.cgi?id=17006&action=edit" title="Test code that reproduces the error.">[details]</a></span>
Test code that reproduces the error.

This simple code produces an alloc-dealloc-mismatch report when run with
address sanitization enabled:

#include <stdexcept>
int main()
{
    try {
    throw std::runtime_error("");
    } catch (std::exception const&) {
    }
}

Command line used for compilation:

clang++ -fsanitize=address --stdlib=libc++ alloc_dealloc_mismatch_repro.cpp


Produces, on execution:

=================================================================
==11344==ERROR: AddressSanitizer: alloc-dealloc-mismatch (operator new [] vs
operator delete) on 0x60300000efe0
    #0 0x4f2740  (/tmp/repro/a.out+0x4f2740)
    #1 0x7ff6d213cf00  (/usr/lib/x86_64-linux-gnu/libc++.so.1+0xc3f00)
    #2 0x7ff6d20f6a30  (/usr/lib/x86_64-linux-gnu/libc++.so.1+0x7da30)
    #3 0x4f5028  (/tmp/repro/a.out+0x4f5028)
    #4 0x7ff6d118ff44  (/lib/x86_64-linux-gnu/libc.so.6+0x21f44)
    #5 0x419d65  (/tmp/repro/a.out+0x419d65)
0x60300000efe0 is located 0 bytes inside of 25-byte region
[0x60300000efe0,0x60300000eff9)
allocated by thread T0 here:
    #0 0x4f2290  (/tmp/repro/a.out+0x4f2290)
    #1 0x7ff6d213194c  (/usr/lib/x86_64-linux-gnu/libc++.so.1+0xb894c)
    #2 0x7ff6d118ff44  (/lib/x86_64-linux-gnu/libc.so.6+0x21f44)
SUMMARY: AddressSanitizer: alloc-dealloc-mismatch (/tmp/repro/a.out+0x4f2740) 
==11344==HINT: if you don't care about these errors you may set
ASAN_OPTIONS=alloc_dealloc_mismatch=0
==11344==ABORTING



This reproduces reliably using clang-3.8, on Ubuntu 14.04.



NOTE: the problem does not reproduce with --stdlib=libstdc++.

NOTE: this appears to be a duplicate of bug ID 17379, which is marked as fixed,
but as mentioned still repros on clang-3.8.</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>