[LLVMbugs] [Bug 14768] New: front-end c++ crash when parsing armadillo headers

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Dec 31 16:22:35 PST 2012


http://llvm.org/bugs/show_bug.cgi?id=14768

             Bug #: 14768
           Summary: front-end c++ crash when parsing armadillo headers
           Product: clang
           Version: 3.1
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: sean.michael.farley at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 9783
  --> http://llvm.org/bugs/attachment.cgi?id=9783
reduced example

This crash happens for me with Armadillo (http://arma.sourceforge.net) version
3.2.0 - 3.6.1 (both with or without boost). Also, failed versions of clang are
3.1, 3.2, and 3.3-svn. Surprisingly, clang 3.0 compiles this test file just
fine. Here is the error message:

$ clang++-mp-3.2 test.cxx -I./local/include 
Assertion failed: (ResultKind != FoundUnresolvedValue ||
sanityCheckUnresolved()), function sanityImpl, file SemaLookup.cpp, line 316.
0  libLLVM-3.2svn.dylib 0x0000000108980e52 PrintStackTrace(void*) + 34
1  libLLVM-3.2svn.dylib 0x0000000108981379 SignalHandler(int) + 713
2  libsystem_c.dylib    0x00007fff959838ea _sigtramp + 26
3  libsystem_c.dylib    0x00007fff58ffc870 _sigtramp + 18446744072692928416
4  libLLVM-3.2svn.dylib 0x0000000108981096 abort + 22
5  libLLVM-3.2svn.dylib 0x0000000108981055 __assert_rtn + 53
6  clang                0x00000001070ed3a7 clang::LookupResult::sanityImpl()
const + 455
7  clang                0x0000000106fc0f39
clang::Sema::HandleDeclarator(clang::Scope*, clang::Declarator&,
llvm::MutableArrayRef<clang::TemplateParameterList*>) + 2345
8  clang                0x0000000106ffe11c
clang::Sema::ActOnCXXMemberDeclarator(clang::Scope*, clang::AccessSpecifier,
clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>,
clang::Expr*, clang::VirtSpecifiers const&, clang::InClassInitStyle) + 1452
9  clang                0x0000000106eca237
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::AttributeList*, clang::Parser::ParsedTemplateInfo const&,
clang::ParsingDeclRAIIObject*) + 7255
10 clang                0x0000000106ec7398
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, unsigned int,
clang::Decl*) + 4040
11 clang                0x0000000106ec5bed
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext) + 7213
12 clang                0x0000000106eaf471
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 6977
13 clang                0x0000000106f04926
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 742
14 clang                0x0000000106f0421b
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 843
15 clang                0x0000000106f03d25
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 389
16 clang                0x0000000106ead3ed
clang::Parser::ParseDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, unsigned
int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 461
17 clang                0x0000000106f107dd
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 1597
18 clang                0x0000000106ebfe78
clang::Parser::ParseInnerNamespace(std::vector<clang::SourceLocation,
std::allocator<clang::SourceLocation> >&, std::vector<clang::IdentifierInfo*,
std::allocator<clang::IdentifierInfo*> >&, std::vector<clang::SourceLocation,
std::allocator<clang::SourceLocation> >&, unsigned int, clang::SourceLocation&,
clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) + 264
19 clang                0x0000000106ebf8e1
clang::Parser::ParseNamespace(unsigned int, clang::SourceLocation&,
clang::SourceLocation) + 5217
20 clang                0x0000000106ead565
clang::Parser::ParseDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, unsigned
int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 837
21 clang                0x0000000106f107dd
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 1597
22 clang                0x0000000106f10117
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 311
23 clang                0x0000000106ea3915 clang::ParseAST(clang::Sema&, bool,
bool) + 325
24 clang                0x0000000106e67212
clang::CodeGenAction::ExecuteAction() + 1298
25 clang                0x0000000106c5bc5d clang::FrontendAction::Execute() +
109
26 clang                0x0000000106c3dccf
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 1007
27 clang                0x0000000106c06831
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3569
28 clang                0x0000000106bfe438 cc1_main(char const**, char const**,
char const*, void*) + 872
29 clang                0x0000000106c02714 main + 708
30 libdyld.dylib        0x00007fff8f3c57e1 start + 0
31 libdyld.dylib        0x0000000000000032 start + 18446603338113067089
Stack dump:
0.    Program arguments: /opt/local/libexec/llvm-3.2/bin/clang -cc1 -triple
x86_64-apple-macosx10.8.0 -emit-obj -mrelax-all -disable-free -main-file-name
test.cxx -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose
-munwind-tables -target-cpu core2 -target-linker-version 134.9 -resource-dir
/opt/local/libexec/llvm-3.2/bin/../lib/clang/3.2 -I ./local/include
-fmodule-cache-path
/var/folders/q2/lwgvz7q928d42t51jxw7kpg80000gn/T/clang-module-cache
-fdeprecated-macro -fdebug-compilation-dir /Users/sean/sandbox -ferror-limit 19
-fmessage-length 204 -stack-protector 1 -mstackrealign -fblocks
-fobjc-runtime=macosx-10.8.0 -fobjc-dispatch-method=mixed
-fobjc-default-synthesize-properties -fencode-extended-block-signature
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o
/var/folders/q2/lwgvz7q928d42t51jxw7kpg80000gn/T/test-19gfev.o -x c++ test.cxx 
1.    ./local/include/armadillo_bits/Col_bones.hpp:191:62: current parser token
';'
2.    ./local/include/armadillo:97:1: parsing namespace 'arma'
3.    ./local/include/armadillo_bits/Col_bones.hpp:131:1: parsing
struct/union/class body 'fixed'
clang: error: unable to execute command: Illegal instruction: 4
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.2 (tags/RELEASE_32/final)
Target: x86_64-apple-darwin12.2.1
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ 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/q2/lwgvz7q928d42t51jxw7kpg80000gn/T/test-F8koJc.cpp
clang: note: diagnostic msg:
/var/folders/q2/lwgvz7q928d42t51jxw7kpg80000gn/T/test-F8koJc.sh
clang: note: diagnostic msg: 

********************

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list