Skip to content

Segmentation fault with C++0x lambda #11315

@llvmbot

Description

@llvmbot
Bugzilla Link 10943
Resolution FIXED
Resolved on Feb 16, 2012 16:32
Version trunk
OS Linux
Attachments Preprocessed source
Reporter LLVM Bugzilla Contributor
CC @DougGregor,@efriedma-quic

Extended Description

clang version 3.0 (trunk 139933)
Target: x86_64-unknown-linux-gnu
Thread model: posix

Compiled with: g++ (GCC) 4.6.1 20110819 (prerelease)

Command line: clang++ -pipe -Wall -g -I../../Prelude/include -Wno-invalid-offsetof -std=gnu++0x -c Canvas.cpp -o debug/Canvas.o

Output:

0 clang 0x0000000002afcdd2
1 clang 0x0000000002afcbce
2 libpthread.so.0 0x00007f83087fc800
3 clang 0x0000000001406c88 clang::Expr::isTypeDependent() const + 12
4 clang 0x0000000001db8808 clang::CallExpr::CallExpr(clang::ASTContext&, clang::Expr*, clang::Expr**, unsigned int, clang::QualType, clang::ExprValueKind, clang::SourceLocation) + 264
5 clang 0x00000000016f7290 clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, clang::ASTMultiPtrclang::Expr*, clang::SourceLocation, clang::Expr*) + 978
6 clang 0x00000000015d42c4 clang::Parser::ParsePostfixExpressionSuffix(clang::ActionResult<clang::Expr*, true>) + 2576
7 clang 0x00000000015d38a1 clang::Parser::ParseCastExpression(bool, bool, bool&, bool) + 7369
8 clang 0x00000000015d1b95 clang::Parser::ParseCastExpression(bool, bool, bool) + 55
9 clang 0x00000000015d1f70 clang::Parser::ParseCastExpression(bool, bool, bool&, bool) + 920
10 clang 0x00000000015d1b95 clang::Parser::ParseCastExpression(bool, bool, bool) + 55
11 clang 0x00000000015d2997 clang::Parser::ParseCastExpression(bool, bool, bool&, bool) + 3519
12 clang 0x00000000015d1b95 clang::Parser::ParseCastExpression(bool, bool, bool) + 55
13 clang 0x00000000015d1114 clang::Parser::ParseAssignmentExpression() + 168
14 clang 0x00000000015d0f1a clang::Parser::ParseExpression() + 24
15 clang 0x000000000159c007 clang::Parser::ParseReturnStatement(clang::ParsedAttributes&) + 473
16 clang 0x0000000001597866 clang::Parser::ParseStatementOrDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&, bool) + 2794
17 clang 0x0000000001599599 clang::Parser::ParseCompoundStatementBody(bool) + 1123
18 clang 0x000000000159d2e4 clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) + 240
19 clang 0x00000000015b285f clang::Parser::ParseLexedMethodDef(clang::Parser::LexedMethod&) + 907
20 clang 0x00000000015b1cfb clang::Parser::LexedMethod::ParseLexedMethodDefs() + 35
21 clang 0x00000000015b2494 clang::Parser::ParseLexedMethodDefs(clang::Parser::ParsingClass&) + 236
22 clang 0x00000000015cc37c clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, unsigned int, clang::Decl*) + 2442
23 clang 0x00000000015c9235 clang::Parser::ParseClassSpecifier(clang::tok::TokenKind, clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, bool) + 6031
24 clang 0x00000000015bad20 clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Parser::DeclSpecContext) + 7156
25 clang 0x000000000159f5c0 clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ParsingDeclRAIIObject&, clang::SourceLocation&, clang::AccessSpecifier) + 420
26 clang 0x000000000159f3cf clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int, clang::SourceLocation&, clang::AccessSpecifier) + 1015
27 clang 0x000000000159ef31 clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int, clang::SourceLocation&, clang::AccessSpecifier) + 189
28 clang 0x00000000015b7106 clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&, unsigned int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 230
29 clang 0x00000000015a9d20 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::Parser::ParsingDeclSpec*) + 1580
30 clang 0x00000000015c54ec clang::Parser::ParseInnerNamespace(std::vector<clang::SourceLocation, std::allocatorclang::SourceLocation >&, std::vector<clang::IdentifierInfo*, std::allocatorclang::IdentifierInfo* >&, std::vector<clang::SourceLocation, std::allocatorclang::SourceLocation >&, unsigned int, clang::SourceLocation&, clang::SourceLocation&, clang::ParsedAttributes&, clang::SourceLocation&) + 180
31 clang 0x00000000015c537f clang::Parser::ParseNamespace(unsigned int, clang::SourceLocation&, clang::SourceLocation) + 3147
32 clang 0x00000000015b7232 clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&, unsigned int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 530
33 clang 0x00000000015a9d20 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::Parser::ParsingDeclSpec*) + 1580
34 clang 0x00000000015a9645 clang::Parser::ParseTopLevelDecl(clang::OpaquePtrclang::DeclGroupRef&) + 309
35 clang 0x0000000001589542 clang::ParseAST(clang::Sema&, bool) + 461
36 clang 0x00000000012bf2ff clang::ASTFrontendAction::ExecuteAction() + 265
37 clang 0x0000000001415d73 clang::CodeGenAction::ExecuteAction() + 975
38 clang 0x00000000012bef59 clang::FrontendAction::Execute() + 325
39 clang 0x00000000012a15ea clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 740
40 clang 0x0000000001273907 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 999
41 clang 0x0000000001264b11 cc1_main(char const**, char const**, char const*, void*) + 921
42 clang 0x000000000126ef37 main + 481
43 libc.so.6 0x00007f8307b0813d __libc_start_main + 237
44 clang 0x00000000012641f9
Stack dump:
0. Program arguments: /home/zoxc/llvm-build/build/Debug+Asserts/bin/clang -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name Canvas.cpp -mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version 2.21.1.20110627 -momit-leaf-frame-pointer -g -coverage-file debug/Canvas.o -resource-dir /home/zoxc/llvm-build/build/Debug+Asserts/bin/../lib/clang/3.0 -I ../../Prelude/include -fmodule-cache-path /var/tmp/clang-module-cache -Wall -Wno-invalid-offsetof -std=gnu++0x -fdeprecated-macro -ferror-limit 19 -fmessage-length 141 -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o debug/Canvas.o -x c++ Canvas.cpp

  1. ./Common.hpp:48:5: current parser token ')'
  2. ./Common.hpp:13:1: parsing namespace 'Reindeer'
  3. ./Common.hpp:33:68: parsing struct/union/class body 'Map'
  4. ./Common.hpp:44:3: parsing function body 'get_create'
  5. ./Common.hpp:44:3: in compound statement ('{}')
    clang: error: unable to execute command: Segmentation fault
    clang: error: clang frontend command failed due to signal 2 (use -v to see invocation)
    clang: note: diagnostic msg: Please submit a bug report to http://llvm.org/bugs/ and include command line arguments and all diagnostic information.
    clang: note: diagnostic msg: Preprocessed source(s) are located at:
    clang: note: diagnostic msg: /tmp/Canvas-V23lKw.ii

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclangClang issues not falling into any other category

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions