<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 --- - Segmentation fault caused by recursive template instantiations"
   href="http://llvm.org/bugs/show_bug.cgi?id=16662">16662</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Segmentation fault caused by recursive template instantiations
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>C++
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>_@adityaramesh.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, 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=10901" name="attach_10901" title="Source file that causes the error.">attachment 10901</a> <a href="attachment.cgi?id=10901&action=edit" title="Source file that causes the error.">[details]</a></span>
Source file that causes the error.

Hello everyone,

With a sufficiently large number of recursive template instantiations, clang++
(version 3.4 (trunk 185261), installed using Macports on OS X 10.8.4) crashes
with a segmentation fault, even when the "-ftemplate-depth-N" flag is used with
a large enough value of N.

$ clang++-mp-3.4 -std=c++11 -stdlib=libc++ -ftemplate-depth-10000 bug.cpp

clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.4 (trunk 185261)
Target: x86_64-apple-darwin12.4.0
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and
associated run script.
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg:
/var/folders/83/tjczqmxn1y9166m642_rxdlw0000gn/T/bug-d09d5f.cpp
clang: note: diagnostic msg:
/var/folders/83/tjczqmxn1y9166m642_rxdlw0000gn/T/bug-d09d5f.sh
clang: note: diagnostic msg: 

********************</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>