<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 --- - [fuzz] SEGV in/below ParseGNUAttributes"
   href="http://llvm.org/bugs/show_bug.cgi?id=21838">21838</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[fuzz] SEGV in/below ParseGNUAttributes
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </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>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>sami.liedes@iki.fi
          </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>Created <span class=""><a href="attachment.cgi?id=13479" name="attach_13479" title="test case">attachment 13479</a> <a href="attachment.cgi?id=13479&action=edit" title="test case">[details]</a></span>
test case

Fuzzing discovered that the attached test case, when given as input to

  clang -fno-crash-diagnostics -std=c++11 -xc++ -c -emit-llvm

causes a segmentation fault:

segv.cpp:1:34: error: expected a qualified name after 'typename'
struct { __attribute__((typename >
                                 ^
0  clang-3.6       0x0000000001ececae llvm::sys::PrintStackTrace(_IO_FILE*) +
46
1  clang-3.6       0x0000000001ecfa4b
2  clang-3.6       0x0000000001ed1ce3
3  libpthread.so.0 0x00007f5e4e8848d0
4  clang-3.6       0x0000000001fe7bd0
5  clang-3.6       0x0000000001fe0f15
6  clang-3.6       0x00000000033b810f
clang::AttributeList::getKind(clang::IdentifierInfo const*,
clang::IdentifierInfo const*, clang::AttributeList::Syntax) + 31
7  clang-3.6       0x00000000031c2fe8
8  clang-3.6       0x00000000031c2e5d
9  clang-3.6       0x00000000031a1e26
10 clang-3.6       0x00000000031a157b
clang::Parser::ParseGNUAttributes(clang::ParsedAttributes&,
clang::SourceLocation*, clang::Parser::LateParsedAttrList*, clang::Declarator*)
+ 683
11 clang-3.6       0x00000000031aaf0e
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 6014
12 clang-3.6       0x00000000031cee32
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::AttributeList*, clang::Parser::ParsedTemplateInfo const&,
clang::ParsingDeclRAIIObject*) + 2338
13 clang-3.6       0x00000000031ccb9a
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) + 4394
14 clang-3.6       0x00000000031cb4c8
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&) + 10552
15 clang-3.6       0x00000000031ac037
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 10407
16 clang-3.6       0x0000000003195511
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 97
17 clang-3.6       0x0000000003195023
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 147
18 clang-3.6       0x000000000319465d
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 3389
19 clang-3.6       0x00000000031936da
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 746
20 clang-3.6       0x000000000318eb83 clang::ParseAST(clang::Sema&, bool, bool)
+ 323
21 clang-3.6       0x0000000002106819 clang::ASTFrontendAction::ExecuteAction()
+ 345
22 clang-3.6       0x0000000002520221 clang::CodeGenAction::ExecuteAction() +
1521
23 clang-3.6       0x0000000002105fd0 clang::FrontendAction::Execute() + 112
24 clang-3.6       0x00000000020c4ef8
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 824
25 clang-3.6       0x00000000022598a8
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1048
26 clang-3.6       0x0000000000a1eb27 cc1_main(llvm::ArrayRef<char const*>,
char const*, void*) + 727
27 clang-3.6       0x0000000000a13513
28 clang-3.6       0x0000000000a12557 main + 1031
29 libc.so.6       0x00007f5e4dab0b45 __libc_start_main + 245
30 clang-3.6       0x0000000000a11ff4</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>