[LLVMbugs] [Bug 12600] New: segfault after clang::runUninitializedVariablesAnalysis

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Apr 19 22:10:42 PDT 2012


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

             Bug #: 12600
           Summary: segfault after
                    clang::runUninitializedVariablesAnalysis
           Product: clang
           Version: 3.0
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: vk at vedantk.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 8412
  --> http://llvm.org/bugs/attachment.cgi?id=8412
Clang's preprocessed sources file

clang 3.0-3 segfaults during its runUnitializedVariablesAnalysis pass. GCC
compiles the same code without errors or warnings, even with -Wall and -Wextra
enabled.

I have attached the preprocessed source clang generated. Here is the error
message;

clang -Wall -Wextra -std=c99 -I. -Os -D_POSIX_C_SOURCE=200112L   -c -o util.o
util.c
0  libLLVM-3.0.so  0x00007f4613c2c3df
1  libLLVM-3.0.so  0x00007f4613c2c849
2  libpthread.so.0 0x00007f4612d70140
3  clang           0x0000000000c01982
4  clang           0x0000000000c02427
5  clang           0x0000000000c0421d
clang::runUninitializedVariablesAnalysis(clang::DeclContext const&, clang::CFG
const&, clang::AnalysisContext&, clang::UninitVariablesHandler&,
clang::UninitVariablesAnalysisStats&) + 1597
6  clang           0x0000000000aa32a2
clang::sema::AnalysisBasedWarnings::IssueWarnings(clang::sema::AnalysisBasedWarnings::Policy,
clang::sema::FunctionScopeInfo*, clang::Decl const*, clang::BlockExpr const*) +
914
7  clang           0x00000000008644fc
clang::Sema::PopFunctionOrBlockScope(clang::sema::AnalysisBasedWarnings::Policy
const*, clang::Decl const*, clang::BlockExpr const*) + 172
8  clang           0x00000000008e09ee
clang::Sema::ActOnFinishFunctionBody(clang::Decl*, clang::Stmt*, bool) + 334
9  clang           0x000000000080bc7d
clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 189
10 clang           0x000000000081ca73
clang::Parser::ParseFunctionDefinition(clang::Parser::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&) + 963
11 clang           0x000000000082a863
clang::Parser::ParseDeclGroup(clang::Parser::ParsingDeclSpec&, unsigned int,
bool, clang::SourceLocation*, clang::Parser::ForRangeInit*) + 739
12 clang           0x00000000008184b5
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsingDeclSpec&,
clang::AccessSpecifier) + 149
13 clang           0x0000000000818a9d
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&,
clang::AccessSpecifier) + 717
14 clang           0x000000000081a69b
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::Parser::ParsingDeclSpec*) + 2747
15 clang           0x000000000081abae
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 158
16 clang           0x00000000007f464d clang::ParseAST(clang::Sema&, bool) + 269
17 clang           0x00000000006e6a53 clang::CodeGenAction::ExecuteAction() +
51
18 clang           0x00000000005e9963
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 307
19 clang           0x00000000005d4981
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1041
20 clang           0x00000000005cdfaf cc1_main(char const**, char const**, char
const*, void*) + 815
21 clang           0x00000000005ccf6d main + 6957
22 libc.so.6       0x00007f46124c8455 __libc_start_main + 245
23 clang           0x00000000005cdae1
Stack dump:
0.    Program arguments: /usr/bin/clang -cc1 -triple x86_64-unknown-linux-gnu
-emit-obj -disable-free -disable-llvm-verifier -main-file-name util.c
-mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -target-linker-version 2.22.0.20120323
-momit-leaf-frame-pointer -coverage-file util.o -resource-dir
/usr/bin/../lib/clang/3.0 -D _POSIX_C_SOURCE=200112L -I . -fmodule-cache-path
/var/tmp/clang-module-cache -internal-isystem /usr/local/include
-internal-isystem /usr/bin/../lib/clang/3.0/include -internal-externc-isystem
/usr/include -Os -Wall -Wextra -std=c99 -ferror-limit 19 -fmessage-length 158
-fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi
-fdiagnostics-show-option -fcolor-diagnostics -o util.o -x c util.c 
1.    util.c:41:1: current parser token 'yajl_gen'
2.    util.c:27:1: parsing function body 'LOG'
clang: error: unable to execute command: Segmentation fault

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