<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - Crashing clang-4.0 on ubuntu"
   href="https://bugs.llvm.org/show_bug.cgi?id=32589">32589</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Crashing clang-4.0 on ubuntu
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>4.0
          </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>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>mrdvlpr.xnu@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=18254" name="attach_18254" title="C generated file">attachment 18254</a> <a href="attachment.cgi?id=18254&action=edit" title="C generated file">[details]</a></span>
C generated file

The following command will crash clang-4.0 on ubuntu 16.04 (note that this also
crashes 3.8 and 3.9)

$ python -c "print('{' * 99999)" > test.c && clang-4.0 test.c

Output of the command: 

test.c:1:1: error: expected identifier or '('
#0 0x00007ffa3a2205e8 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/lib/x86_64-linux-gnu/libLLVM-4.0.so.1+0x70e5e8)
#1 0x00007ffa3a21e76e llvm::sys::RunSignalHandlers()
(/usr/lib/x86_64-linux-gnu/libLLVM-4.0.so.1+0x70c76e)
#2 0x00007ffa3a21e8bc (/usr/lib/x86_64-linux-gnu/libLLVM-4.0.so.1+0x70c8bc)
#3 0x00007ffa3ca72390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x00000000018e5ed2 clang::Lexer::LexTokenInternal(clang::Token&, bool)
(/usr/lib/llvm-4.0/bin/clang+0x18e5ed2)
#5 0x000000000194f218 clang::Preprocessor::Lex(clang::Token&)
(/usr/lib/llvm-4.0/bin/clang+0x194f218)
#6 0x0000000000d63807
clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>,
clang::Parser::SkipUntilFlags) (/usr/lib/llvm-4.0/bin/clang+0xd63807)
#7 0x0000000000d63a9a
clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>,
clang::Parser::SkipUntilFlags) (/usr/lib/llvm-4.0/bin/clang+0xd63a9a)
#8 0x0000000000d63a9a
clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>,
clang::Parser::SkipUntilFlags) (/usr/lib/llvm-4.0/bin/clang+0xd63a9a)
#9 0x0000000000d63a9a
clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>,
clang::Parser::SkipUntilFlags) (/usr/lib/llvm-4.0/bin/clang+0xd63a9a)
#10 0x0000000000d63a9a
clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>,
clang::Parser::SkipUntilFlags) (/usr/lib/llvm-4.0/bin/clang+0xd63a9a)
#11 0x0000000000d63a9a
clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>,
clang::Parser::SkipUntilFlags) (/usr/lib

.... (Recursion output)
.... (Recursion output)
.... (Recursion output)

#255 0x0000000000d63a9a
clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>,
clang::Parser::SkipUntilFlags) (/usr/lib/llvm-4.0/bin/clang+0xd63a9a)
Stack dump:
0.      Program arguments: /usr/lib/llvm-4.0/bin/clang -cc1 -triple
x86_64-pc-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier
-discard-value-names -main-file-name test.c -mrelocation-model static
-mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-dwarf-column-info -debugger-tuning=gdb -resource-dir
/usr/lib/llvm-4.0/bin/../lib/clang/4.0.0 -internal-isystem /usr/local/include
-internal-isystem /usr/lib/llvm-4.0/bin/../lib/clang/4.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdebug-compilation-dir /tmp -ferror-limit 19 -fmessage-length 174
-fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o
/tmp/test-a00671.o -x c test.c 
1.      <unknown> parser at unknown location
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 4.0.0-svn297204-1~exp1 (branches/release_40)
Target: x86_64-pc-linux-gnu</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>