[LLVMbugs] [Bug 10379] New: Infinite loop when compiling with -Wall
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sat Jul 16 12:06:13 PDT 2011
http://llvm.org/bugs/show_bug.cgi?id=10379
Summary: Infinite loop when compiling with -Wall
Product: new-bugs
Version: trunk
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: new bugs
AssignedTo: unassignedbugs at nondot.org
ReportedBy: niclas.zeising at gmail.com
CC: llvmbugs at cs.uiuc.edu
Created an attachment (id=6887)
--> (http://llvm.org/bugs/attachment.cgi?id=6887)
preprocessed test case to trigger bug
Clang goes into an infinite loop when compiling attached preprocessed reduced
test case with -Wall. Any other warning flags works, it seems, including
-Wextra -pedantic. As soon as -Wall is added, the infinite loop occurs. The
code is originally from libX11 1.3.6. -Wall can be added by itself or together
with other warning flags, it does not matter.
This is with clang/llvm r135344 and confirmed on FreeBSD and Linux (Ubuntu
10.04). Clang has to be killed with either ^C or a signal. When sending the
abort signal it displays the following on FreeBSD:
Stack dump:
0. Program arguments:
/usr/home/llvm-build/build/obj-llvm.3/Release+Asserts/bin/clang -cc1 -triple
x86_64-unknown-freebsd9.0 -emit-obj -disable-free -main-file-name
imRmAttr.changed.2.i -pic-level 2 -mdisable-fp-elim -relaxed-aliasing
-masm-verbose -mconstructor-aliases -munwind-tables -target-cpu core2
-target-linker-version 2.17.50 -momit-leaf-frame-pointer -coverage-file
imRmAttr.o -resource-dir
/usr/home/llvm-build/build/obj-llvm.3/Release+Asserts/bin/../lib/clang/3.0 -O2
-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -Wnested-externs -Wbad-function-cast -Wformat=2
-Wold-style-definition -Wdeclaration-after-statement -ferror-limit 19
-fmessage-length 130 -fdiagnostics-show-option -fcolor-diagnostics -o
imRmAttr.o -x cpp-output imRmAttr.testcase.i
1. <eof> parser at end of file
2. imRmAttr.changed.2.i:72:1: parsing function body '_XimMakeICAttrIDList'
and then hangs again with 100% CPU usage. A second abort signal then terminates
clang.
On Linux it prints the same message when sent the abort signal as well as a
more elaborate stack trace:
0 clang 0x000000000186f35f
1 clang 0x000000000186f8c9
2 libpthread.so.0 0x00007fbfb6bfd8f0
3 clang 0x0000000000c6cbc8 void std::__rotate<clang::CFGBlock
const**>(clang::CFGBlock const**, clang::CFGBlock const**, clang::CFGBlock
const**, std::random_access_iterator_tag) + 136
4 clang 0x0000000000c6a4da
clang::runUninitializedVariablesAnalysis(clang::DeclContext const&, clang::CFG
const&, clang::AnalysisContext&, clang::UninitVariablesHandler&,
clang::UninitVariablesAnalysisStats&) + 1146
5 clang 0x0000000000b7a60c
clang::sema::AnalysisBasedWarnings::IssueWarnings(clang::sema::AnalysisBasedWarnings::Policy,
clang::sema::FunctionScopeInfo*, clang::Decl const*, clang::BlockExpr const*) +
3516
6 clang 0x0000000000904088
clang::Sema::PopFunctionOrBlockScope(clang::sema::AnalysisBasedWarnings::Policy
const*, clang::Decl const*, clang::BlockExpr const*) + 88
7 clang 0x00000000009a0af9
clang::Sema::ActOnFinishFunctionBody(clang::Decl*, clang::Stmt*, bool) + 1177
8 clang 0x00000000008bbe57
clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 247
9 clang 0x00000000008c75be
clang::Parser::ParseFunctionDefinition(clang::Parser::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&) + 1854
10 clang 0x00000000008d185f
clang::Parser::ParseDeclGroup(clang::Parser::ParsingDeclSpec&, unsigned int,
bool, clang::SourceLocation*, clang::Parser::ForRangeInit*) + 975
11 clang 0x00000000008c69b3
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsingDeclSpec&,
clang::AccessSpecifier) + 675
12 clang 0x00000000008c6b7c
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&,
clang::AccessSpecifier) + 380
13 clang 0x00000000008c60dc
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::Parser::ParsingDeclSpec*) + 2508
14 clang 0x00000000008c5694
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 244
15 clang 0x00000000008ae45e clang::ParseAST(clang::Sema&, bool) + 318
16 clang 0x000000000079cad4 clang::CodeGenAction::ExecuteAction() +
804
17 clang 0x0000000000699817
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 983
18 clang 0x0000000000685a77
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2743
19 clang 0x000000000067d702 cc1_main(char const**, char const**, char
const*, void*) + 5970
20 clang 0x0000000000681ce4 main + 772
21 libc.so.6 0x00007fbfb5ed7c4d __libc_start_main + 253
22 clang 0x000000000067bee9
--
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