[LLVMbugs] [Bug 10150] New: [C] Segfault during compilation

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jun 17 12:51:59 PDT 2011


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

           Summary: [C] Segfault during compilation
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: pipping at exherbo.org
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=6745)
 --> (http://llvm.org/bugs/attachment.cgi?id=6745)
First test case

With a build from today (git 12189f573f5dafb7fa33e8dc32ff06cd6fd35963), I get
the following segfaults:

% clang -c noalias.c 
0  libLLVM-3.0svn.so 0x00007f550098b05f
1  libLLVM-3.0svn.so 0x00007f550098b7c0
2  libpthread.so.0   0x00007f55001f4ff0
3  clang             0x000000000089b91c
clang::Sema::MergeCompatibleFunctionDecls(clang::FunctionDecl*,
clang::FunctionDecl*) + 216
4  clang             0x00000000008a43b0
clang::Sema::MergeFunctionDecl(clang::FunctionDecl*, clang::Decl*) + 4692
5  clang             0x00000000008b0337
clang::Sema::CheckFunctionDeclaration(clang::Scope*, clang::FunctionDecl*,
clang::LookupResult&, bool, bool&) + 1117
6  clang             0x00000000008b4047
clang::Sema::ActOnFunctionDeclarator(clang::Scope*, clang::Declarator&,
clang::DeclContext*, clang::QualType, clang::TypeSourceInfo*,
clang::LookupResult&, clang::ASTMultiPtr<clang::TemplateParameterList*>, bool,
bool&) + 9413
7  clang             0x00000000008bc205
clang::Sema::HandleDeclarator(clang::Scope*, clang::Declarator&,
clang::ASTMultiPtr<clang::TemplateParameterList*>, bool) + 3841
8  clang             0x00000000008bc4cf
clang::Sema::ActOnStartOfFunctionDef(clang::Scope*, clang::Declarator&) + 297
9  clang             0x00000000007e16df
clang::Parser::ParseFunctionDefinition(clang::Parser::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&) + 2505
10 clang             0x00000000007ef599
clang::Parser::ParseDeclGroup(clang::Parser::ParsingDeclSpec&, unsigned int,
bool, clang::SourceLocation*, clang::Parser::ForRangeInit*) + 891
11 clang             0x00000000007dd34a
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsingDeclSpec&,
clang::AccessSpecifier) + 1026
12 clang             0x00000000007dd553
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&,
clang::AccessSpecifier) + 519
13 clang             0x00000000007dee61
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::Parser::ParsingDeclSpec*) + 4397
14 clang             0x00000000007def9d
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 225
15 clang             0x00000000007b2906 clang::ParseAST(clang::Sema&, bool) +
290
16 clang             0x000000000057ee80
clang::ASTFrontendAction::ExecuteAction() + 196
17 clang             0x0000000000664185 clang::CodeGenAction::ExecuteAction() +
2493
18 clang             0x000000000057f3bd clang::FrontendAction::Execute() + 389
19 clang             0x000000000056ce25
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 859
20 clang             0x0000000000546f70
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3680
21 clang             0x000000000053e06c cc1_main(char const**, char const**,
char const*, void*) + 6876
22 clang             0x0000000000544028 main + 751
23 libc.so.6         0x00007f54ff4fec7d __libc_start_main + 253
24 clang             0x000000000053c3b9
Stack dump:
0.      Program arguments: /usr/bin/clang -cc1 -triple x86_64-pc-linux-gnu
-emit-obj -mrelax-all -disable-free -main-file-name noalias.c
-mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -target-linker-version 2.21
-momit-leaf-frame-pointer -coverage-file noalias.o -resource-dir
/usr/bin/../lib/clang/3.0 -ferror-limit 19 -fmessage-length 118 -fgnu-runtime
-fdiagnostics-show-option -fcolor-diagnostics -o noalias.o -x c noalias.c 
1.      noalias.c:3:19: current parser token '{'
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal 2 (use -v to see
invocation)
% 

and

% clang -c alias.c 
Aliasing chain should end with function or global variable
void (...)* @foo1
Aliasing chain should end with function or global variable
void (...)* @foo
Broken module found, compilation aborted!
0  libLLVM-3.0svn.so 0x00007fc40336d05f
1  libLLVM-3.0svn.so 0x00007fc40336d7c0
2  libpthread.so.0   0x00007fc402bd6ff0
3  libc.so.6         0x00007fc401ef4605 gsignal + 53
4  libc.so.6         0x00007fc401ef5905 abort + 389
5  libLLVM-3.0svn.so 0x00007fc40396fdea
6  libLLVM-3.0svn.so 0x00007fc40394b34c
llvm::FPPassManager::doFinalization(llvm::Module&) + 142
7  libLLVM-3.0svn.so 0x00007fc40394b427
llvm::FunctionPassManagerImpl::doFinalization(llvm::Module&) + 173
8  libLLVM-3.0svn.so 0x00007fc40394b46f
llvm::FunctionPassManager::doFinalization() + 17
9  clang             0x0000000000667601
clang::EmitBackendOutput(clang::Diagnostic&, clang::CodeGenOptions const&,
clang::TargetOptions const&, llvm::Module*, clang::BackendAction,
llvm::raw_ostream*) + 5905
10 clang             0x0000000000664bfd
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 309
11 clang             0x00000000007b2960 clang::ParseAST(clang::Sema&, bool) +
380
12 clang             0x000000000057ee80
clang::ASTFrontendAction::ExecuteAction() + 196
13 clang             0x0000000000664185 clang::CodeGenAction::ExecuteAction() +
2493
14 clang             0x000000000057f3bd clang::FrontendAction::Execute() + 389
15 clang             0x000000000056ce25
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 859
16 clang             0x0000000000546f70
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3680
17 clang             0x000000000053e06c cc1_main(char const**, char const**,
char const*, void*) + 6876
18 clang             0x0000000000544028 main + 751
19 libc.so.6         0x00007fc401ee0c7d __libc_start_main + 253
20 clang             0x000000000053c3b9
Stack dump:
0.      Program arguments: /usr/bin/clang -cc1 -triple x86_64-pc-linux-gnu
-emit-obj -mrelax-all -disable-free -main-file-name alias.c -mrelocation-model
static -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables
-target-cpu x86-64 -target-linker-version 2.21 -momit-leaf-frame-pointer
-coverage-file alias.o -resource-dir /usr/bin/../lib/clang/3.0 -ferror-limit 19
-fmessage-length 118 -fgnu-runtime -fdiagnostics-show-option
-fcolor-diagnostics -o alias.o -x c alias.c 
1.      <eof> parser at end of file
2.      Per-function optimization
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal 2 (use -v to see
invocation)
%

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