[LLVMbugs] [Bug 10691] New: Segfault

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Aug 17 10:26:36 PDT 2011


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

           Summary: Segfault
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++0x
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: pipping at exherbo.org
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Created an attachment (id=7088)
 --> (http://llvm.org/bugs/attachment.cgi?id=7088)
delta-reduced input (not valid code but manages to make clang++ crash)

pipping at bogus /home/pipping/reduce % clang++ -c -std=c++0x cc-MJgC6J-clean.ii
cc-MJgC6J-clean.ii:10:3: error: no template named 'MakeFormatStringFetcher';
did you mean
      'MakeMakeFormatStringFetcher'?
  MakeFormatStringFetcher<cs_...> operator<< (MakeFormatStringFetcher<cs_...>
&& f, const std::string & s)
  ^~~~~~~~~~~~~~~~~~~~~~~
  MakeMakeFormatStringFetcher
cc-MJgC6J-clean.ii:5:10: note: 'MakeMakeFormatStringFetcher' declared here
  struct MakeMakeFormatStringFetcher
         ^
cc-MJgC6J-clean.ii:10:47: error: no template named 'MakeFormatStringFetcher';
did you mean
      'MakeMakeFormatStringFetcher'?
  MakeFormatStringFetcher<cs_...> operator<< (MakeFormatStringFetcher<cs_...>
&& f, const std::string & s)
                                              ^~~~~~~~~~~~~~~~~~~~~~~
                                              MakeMakeFormatStringFetcher
cc-MJgC6J-clean.ii:5:10: note: 'MakeMakeFormatStringFetcher' declared here
  struct MakeMakeFormatStringFetcher
         ^
cc-MJgC6J-clean.ii:10:96: error: no type named 'string' in namespace 'std'
  MakeFormatStringFetcher<cs_...> operator<< (MakeFormatStringFetcher<cs_...>
&& f, const std::string & s)
                                                                               
          ~~~~~^
cc-MJgC6J-clean.ii:12:5: error: no template named 'MakeFormatStringFetcher';
did you mean
      'MakeMakeFormatStringFetcher'?
    MakeFormatStringFetcher<cs_...> result{std::move(f.user_key),
f.user_key_version, std::move(f.text)};
    ^~~~~~~~~~~~~~~~~~~~~~~
    MakeMakeFormatStringFetcher
cc-MJgC6J-clean.ii:5:10: note: 'MakeMakeFormatStringFetcher' declared here
  struct MakeMakeFormatStringFetcher
         ^
clang: SemaInit.cpp:4119: ExprResult
clang::InitializationSequence::Perform(clang::Sema &, const
clang::InitializedEntity &, const clang::InitializationKind &, MultiExprArg,
clang::QualType *): Assertion `Kind.getKind() == InitializationKind::IK_Copy ||
Kind.isExplicitCast()' failed.
0  libLLVM-3.0svn.so 0x00007f6afa29adcf
1  libLLVM-3.0svn.so 0x00007f6afa29b279
2  libpthread.so.0   0x00007f6af9492f10
3  libc.so.6         0x00007f6af87b15c5 gsignal + 53
4  libc.so.6         0x00007f6af87b28c5 abort + 389
5  libc.so.6         0x00007f6af87aa235 __assert_fail + 245
6  clang             0x00000000008dd679
clang::InitializationSequence::Perform(clang::Sema&, clang::InitializedEntity
const&, clang::InitializationKind const&, clang::ASTMultiPtr<clang::Expr*>,
clang::QualType*) + 8137
7  clang             0x000000000081fbea
clang::Sema::AddInitializerToDecl(clang::Decl*, clang::Expr*, bool, bool) +
2730
8  clang             0x000000000076da61
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&) + 1809
9  clang             0x000000000076cf36
clang::Parser::ParseDeclGroup(clang::Parser::ParsingDeclSpec&, unsigned int,
bool, clang::SourceLocation*, clang::Parser::ForRangeInit*) + 1366
10 clang             0x000000000076abe5
clang::Parser::ParseSimpleDeclaration(clang::ASTOwningVector<clang::Stmt*,
32u>&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, bool,
clang::Parser::ForRangeInit*) + 661
11 clang             0x000000000076a7d2
clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&,
unsigned int, clang::SourceLocation&,
clang::Parser::ParsedAttributesWithRange&) + 242
12 clang             0x000000000075298a
clang::Parser::ParseStatementOrDeclaration(clang::ASTOwningVector<clang::Stmt*,
32u>&, bool) + 1594
13 clang             0x0000000000756c73
clang::Parser::ParseCompoundStatementBody(bool) + 1187
14 clang             0x00000000007578fe
clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 174
15 clang             0x0000000000762816
clang::Parser::ParseFunctionDefinition(clang::Parser::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&) + 1558
16 clang             0x000000000075939f
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&,
clang::Parser::ParsingDeclRAIIObject&, clang::SourceLocation&,
clang::AccessSpecifier) + 2031
17 clang             0x00000000007589e3
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier) + 723
18 clang             0x0000000000758660
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier) + 304
19 clang             0x000000000076a827
clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&,
unsigned int, clang::SourceLocation&,
clang::Parser::ParsedAttributesWithRange&) + 327
20 clang             0x000000000076106b
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::Parser::ParsingDeclSpec*) + 1643
21 clang             0x00000000007766da
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::SourceLocation&, clang::ParsedAttributes&, clang::SourceLocation&) + 218
22 clang             0x000000000077628e clang::Parser::ParseNamespace(unsigned
int, clang::SourceLocation&, clang::SourceLocation) + 3342
23 clang             0x000000000076a89a
clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&,
unsigned int, clang::SourceLocation&,
clang::Parser::ParsedAttributesWithRange&) + 442
24 clang             0x000000000076106b
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::Parser::ParsingDeclSpec*) + 1643
25 clang             0x0000000000760984
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 244
26 clang             0x0000000000749b3e clang::ParseAST(clang::Sema&, bool) +
318
27 clang             0x0000000000651c00 clang::CodeGenAction::ExecuteAction() +
768
28 clang             0x0000000000558c17
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 983
29 clang             0x0000000000543aab
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2779
30 clang             0x000000000053bb2c cc1_main(char const**, char const**,
char const*, void*) + 6124
31 clang             0x0000000000540008 main + 632
32 libc.so.6         0x00007f6af879dc7d __libc_start_main + 253
33 clang             0x000000000053a279
Stack dump:
0.      Program arguments: /usr/bin/clang -cc1 -triple x86_64-pc-linux-gnu
-emit-obj -mrelax-all -disable-free -main-file-name cc-MJgC6J-clean.ii
-mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -target-linker-version 2.21.1
-momit-leaf-frame-pointer -coverage-file cc-MJgC6J-clean.o -resource-dir
/usr/bin/../lib/clang/3.0 -std=c++0x -fdeprecated-macro -ferror-limit 19
-fmessage-length 118 -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -o cc-MJgC6J-clean.o -x c++-cpp-output cc-MJgC6J-clean.ii 
1.      cc-MJgC6J-clean.ii:12:105: current parser token ';'
2.      cc-MJgC6J-clean.ii:1:1: parsing namespace 'std'
3.      cc-MJgC6J-clean.ii:11:3: parsing function body 'operator<<'
4.      cc-MJgC6J-clean.ii:11:3: in compound statement ('{}')
clang: error: unable to execute command: Aborted
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: Error generating preprocessed source(s) - no
preprocessable inputs.
pipping at bogus /home/pipping/reduce % 

This issue is related to bug #10599 in that it is derived from the same file
but reduced differently. The resulting assertion failure and backtrace are
different, too.


This is with clang 3.0-git-a47027bbd8443593cec15bd7f1fc0eed38d4f904.

-- 
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