<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 - clang::Parser::ParseDeclaratorInternal recursion crashing clang-4.0"
   href="https://bugs.llvm.org/show_bug.cgi?id=32590">32590</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang::Parser::ParseDeclaratorInternal recursion crashing clang-4.0
          </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=18255" name="attach_18255" title="Compiled file">attachment 18255</a> <a href="attachment.cgi?id=18255&action=edit" title="Compiled file">[details]</a></span>
Compiled file

The following command will crash clang-4.0 on ubuntu 16.04. (also 3.8 and 3.9)

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

Output of command: 

#0 0x00007f1d6bef55e8 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/lib/x86_64-linux-gnu/libLLVM-4.0.so.1+0x70e5e8)
#1 0x00007f1d6bef376e llvm::sys::RunSignalHandlers()
(/usr/lib/x86_64-linux-gnu/libLLVM-4.0.so.1+0x70c76e)
#2 0x00007f1d6bef38bc (/usr/lib/x86_64-linux-gnu/libLLVM-4.0.so.1+0x70c8bc)
#3 0x00007f1d6e747390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x0000000000efb36a clang::DeclSpec::Finish(clang::Sema&,
clang::PrintingPolicy const&) (/usr/lib/llvm-4.0/bin/clang+0xefb36a)
#5 0x0000000000d839b7
clang::Parser::ParseTypeQualifierListOpt(clang::DeclSpec&, unsigned int, bool,
bool) (/usr/lib/llvm-4.0/bin/clang+0xd839b7)
#6 0x0000000000d8442f
clang::Parser::ParseDeclaratorInternal(clang::Declarator&, void
(clang::Parser::*)(clang::Declarator&)) (/usr/lib/llvm-4.0/bin/clang+0xd8442f)
#7 0x0000000000d8445d
clang::Parser::ParseDeclaratorInternal(clang::Declarator&, void
(clang::Parser::*)(clang::Declarator&)) (/usr/lib/llvm-4.0/bin/clang+0xd8445d)
#8 0x0000000000d8445d
clang::Parser::ParseDeclaratorInternal(clang::Declarator&, void
(clang::Parser::*)(clang::Declarator&)) (/usr/lib/llvm-4.0/bin/clang+0xd8445d)
#9 0x0000000000d8445d
clang::Parser::ParseDeclaratorInternal(clang::Declarator&, void
(clang::Parser::*)(clang::Declarator&)) (/usr/lib/llvm-4.0/bin/clang+0xd8445d)
#10 0x0000000000d8445d
clang::Parser::ParseDeclaratorInternal(clang::Declarator&, void
(clang::Parser::*)(clang::Declarator&)) (/usr/lib/llvm-4.0/bin/clang+0xd8445d)
#11 0x0000000000d8445d
clang::Parser::ParseDeclaratorInternal(clang::Declarator&, void
(clang::Parser::*)(clang::Declarator&)) (/usr/lib/llvm-4.0/bin/clang+0xd8445d)
#12 0x0000000000d8445d
clang::Parser::ParseDeclaratorInternal(clang::Declarator&, void
(clang::Parser::*)(clang::Declarator&)) (/usr/lib/llvm-4.0/bin/clang+0xd8445d)
#13 0x0000000000d8445d
clang::Parser::ParseDeclaratorInternal(clang::Declarator&, void
(clang::Parser::*)(clang::Declarator&)) (/usr/lib/llvm-4.0/bin/clang+0xd8445d)
#14 0x0000000000d8445d
clang::Parser::ParseDeclaratorInternal(clang::Declarator&, void
(clang::Parser::*)(clang::Declarator&)) (/usr/lib/llvm-4.0/bin/clang+0xd8445d)
...
... (recursion output)
...
#255 0x0000000000d8445d
clang::Parser::ParseDeclaratorInternal(clang::Declarator&, void
(clang::Parser::*)(clang::Declarator&)) (/usr/lib/llvm-4.0/bin/clang+0xd8445d)
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-73a5ff.o -x c test.c 
1.      test.c:1:19371: current parser token '*'
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>