[LLVMbugs] [Bug 12657] New: Segfault on -Wuninitialized

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 25 11:38:10 PDT 2012


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

             Bug #: 12657
           Summary: Segfault on -Wuninitialized
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: willdtz at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 8449
  --> http://llvm.org/bugs/attachment.cgi?id=8449
Reduced source test that triggers crash

Seeing segfault with -Wuninitialized on the attached reduced test case.

$ clang -v
clang version 3.2 (git at github.com:llvm-mirror/clang.git
d80d484168c8b12f2c09fdecf43999478fcb4348) (http://llvm.org/git/llvm.git
b856d555b0336234cb4d5e2d77c3d506efa17550)
Target: x86_64-unknown-linux-gnu
Thread model: posix

(These git revisions correspond to Clang r155550 and LLVM r155568, latest ATM)

Log of the crash:

$ clang++ test.cpp -o test_build -c -Wuninitialized                            
                                                                    13:34:40 on
12-04-25
0  clang           0x0000000001d9f09f
1  clang           0x0000000001d9f589
2  libpthread.so.0 0x00007f5adf2c3d20
3  clang           0x0000000000ebe162
4  clang           0x0000000000ebf621
5  clang           0x0000000000ec186b
clang::runUninitializedVariablesAnalysis(clang::DeclContext const&, clang::CFG
const&, clang::AnalysisDeclContext&, clang::UninitVariablesHandler&,
clang::UninitVariablesAnalysisStats&) + 1515
6  clang           0x0000000000cc6971
clang::sema::AnalysisBasedWarnings::IssueWarnings(clang::sema::AnalysisBasedWarnings::Policy,
clang::sema::FunctionScopeInfo*, clang::Decl const*, clang::BlockExpr const*) +
913
7  clang           0x0000000000a26830
clang::Sema::PopFunctionScopeInfo(clang::sema::AnalysisBasedWarnings::Policy
const*, clang::Decl const*, clang::BlockExpr const*) + 320
8  clang           0x0000000000ab44e5
clang::Sema::ActOnFinishFunctionBody(clang::Decl*, clang::Stmt*, bool) + 501
9  clang           0x0000000000a04bb1
clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 193
10 clang           0x00000000009afc78
clang::Parser::ParseFunctionDefinition(clang::Parser::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&,
llvm::SmallVector<clang::Parser::LateParsedAttribute*, 2u>*) + 1096
11 clang           0x00000000009ba842
clang::Parser::ParseDeclGroup(clang::Parser::ParsingDeclSpec&, unsigned int,
bool, clang::SourceLocation*, clang::Parser::ForRangeInit*) + 1026
12 clang           0x00000000009aa1f8
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsingDeclSpec&,
clang::AccessSpecifier) + 152
13 clang           0x00000000009aa7de
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&,
clang::AccessSpecifier) + 798
14 clang           0x00000000009aeb74
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::Parser::ParsingDeclSpec*) + 2036
15 clang           0x00000000009aed3f
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 191
16 clang           0x00000000009a7b3d clang::ParseAST(clang::Sema&, bool, bool)
+ 285
17 clang           0x0000000000875e14 clang::CodeGenAction::ExecuteAction() +
68
18 clang           0x000000000072e3b1
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 337
19 clang           0x000000000071558a
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1098
20 clang           0x000000000070eabd cc1_main(char const**, char const**, char
const*, void*) + 8973
21 clang           0x00000000006fede9 main + 7641
22 libc.so.6       0x00007f5ade501aa5 __libc_start_main + 245
23 clang           0x000000000070bbbd
Stack dump:
0.      Program arguments: /home/will/llvm/tot/install/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
test.cpp -mrelocation-model static -mdisable-fp-elim -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version
2.22.52.0.1.20120131 -momit-leaf-frame-pointer -coverage-file test_build
-resource-dir /home/will/llvm/tot/install/bin/../lib/clang/3.2
-fmodule-cache-path /var/tmp/clang-module-cache -cxx-isystem
/usr/lib64/qt/include -internal-isystem
/usr/lib64/gcc/x86_64-slackware-linux/4.7.0/../../../../include/c++/4.7.0
-internal-isystem
/usr/lib64/gcc/x86_64-slackware-linux/4.7.0/../../../../include/c++/4.7.0/x86_64-slackware-linux
-internal-isystem
/usr/lib64/gcc/x86_64-slackware-linux/4.7.0/../../../../include/c++/4.7.0/backward
-internal-isystem /usr/local/include -internal-isystem
/home/will/llvm/tot/install/bin/../lib/clang/3.2/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-Wuninitialized -fdeprecated-macro -fdebug-compilation-dir /home/will
-ferror-limit 19 -fmessage-length 191 -mstackrealign -fgnu-runtime
-fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o
test_build -x c++ test.cpp
1.      <eof> parser at end of file
2.      test.cpp:8:50: parsing function body 'trackgethostbyname'
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal (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) and associated run
script(s) are located at:
clang: note: diagnostic msg: /tmp/test/BjdEgP.ii
clang: note: diagnostic msg: /tmp/test/BjdEgP.sh

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