[LLVMbugs] [Bug 24289] New: non-deterministic Codegen crash for function static initializer_list

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jul 28 09:50:06 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=24289

            Bug ID: 24289
           Summary: non-deterministic Codegen crash for function static
                    initializer_list
           Product: new-bugs
           Version: 3.6
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: arvo at me.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 14657
  --> https://llvm.org/bugs/attachment.cgi?id=14657&action=edit
Source files (prerprocessed and original reduced version) and clang invocation

For the attached sources, clang may crash non-deterministically. Example crash
output. This happens with clang++-3.6 and clang++-3.5 (Kubuntu 15.04 on
GNU/Linux x86_64):

0  libLLVM-3.6.so.1 0x00007faad9f96cf2 llvm::sys::PrintStackTrace(_IO_FILE*) +
50
1  libLLVM-3.6.so.1 0x00007faad9f95341
2  libpthread.so.0  0x00007faad8d01d10
3  clang            0x00000000013bffda
4  clang            0x00000000013c9f50
5  clang            0x00000000006c3796
6  clang            0x00000000013cb007
7  clang            0x00000000013c9f24
8  clang            0x00000000013d0d96
9  clang            0x00000000006c3ae1
10 clang            0x00000000013c98f0
11 clang            0x00000000013c9f7c
12 clang            0x00000000013e8996
clang::Expr::EvaluateAsInitializer(clang::APValue&, clang::ASTContext const&,
clang::VarDecl const*, llvm::SmallVectorImpl<std::pair<clang::SourceLocation,
clang::PartialDiagnostic> >&) const + 662
13 clang            0x000000000135d0f5
clang::VarDecl::evaluateValue(llvm::SmallVectorImpl<std::pair<clang::SourceLocation,
clang::PartialDiagnostic> >&) const + 165
14 clang            0x000000000135d26d clang::VarDecl::evaluateValue() const +
77
15 clang            0x00000000008f42dc
clang::CodeGen::CodeGenModule::EmitConstantInit(clang::VarDecl const&,
clang::CodeGen::CodeGenFunction*) + 156
16 clang            0x00000000009da953
clang::CodeGen::CodeGenFunction::AddInitializerToStaticVarDecl(clang::VarDecl
const&, llvm::GlobalVariable*) + 51
17 clang            0x00000000009dce9c
clang::CodeGen::CodeGenFunction::EmitStaticVarDecl(clang::VarDecl const&,
llvm::GlobalValue::LinkageTypes) + 268
18 clang            0x0000000000903d9f
clang::CodeGen::CodeGenFunction::EmitDeclStmt(clang::DeclStmt const&) + 95
19 clang            0x000000000090f655
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) + 229
20 clang            0x000000000090b20b
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 171
21 clang            0x000000000090b620
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot) + 96
22 clang            0x000000000090b8b8
clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&,
bool, clang::CodeGen::AggValueSlot) + 328
23 clang            0x000000000090f604
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) + 148
24 clang            0x000000000090b20b
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 171
25 clang            0x000000000090e883
clang::CodeGen::CodeGenFunction::EmitCaseStmt(clang::CaseStmt const&) + 403
26 clang            0x000000000090f615
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) + 165
27 clang            0x000000000090b20b
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 171
28 clang            0x000000000090b620
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot) + 96
29 clang            0x000000000090b8b8
clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&,
bool, clang::CodeGen::AggValueSlot) + 328
30 clang            0x000000000090f604
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) + 148
31 clang            0x000000000090b20b
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 171
32 clang            0x000000000090fa45
clang::CodeGen::CodeGenFunction::EmitSwitchStmt(clang::SwitchStmt const&) + 981
33 clang            0x000000000090b32e
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 462
34 clang            0x000000000090b620
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot) + 96
35 clang            0x0000000000924d92
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&,
clang::Stmt const*) + 306
36 clang            0x000000000092be4b
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 763
37 clang            0x00000000009490d9
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) + 393
38 clang            0x00000000009498b8
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) + 408
39 clang            0x00000000009499d1
clang::CodeGen::CodeGenModule::EmitDeferred() + 129
40 clang            0x0000000000949a29 clang::CodeGen::CodeGenModule::Release()
+ 9
41 clang            0x00000000008c2d4e
42 clang            0x0000000000aa0665 clang::ParseAST(clang::Sema&, bool,
bool) + 789
43 clang            0x000000000071d6d6 clang::FrontendAction::Execute() + 118
44 clang            0x00000000006f8c99
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 313
45 clang            0x00000000006e0893
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1843
46 clang            0x00000000006dad58 cc1_main(llvm::ArrayRef<char const*>,
char const*, void*) + 1288
47 clang            0x00000000006da32e main + 9966
48 libc.so.6        0x00007faad83aea40 __libc_start_main + 240
49 clang            0x00000000006da39d
Stack dump:
0.      Program arguments: /usr/lib/llvm-3.6/bin/clang -cc1 -triple
x86_64-pc-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier
-main-file-name clang-initializer_list-crash.cxx -mrelocation-model static
-mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-target-linker-version 2.25 -dwarf-column-info -coverage-file
/home/arne/C++Test/clang-initializer_list-crash.cxx -resource-dir
/usr/lib/llvm-3.6/bin/../lib/clang/3.6.0 -internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.1.1/../../../../include/c++/5.1.1
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.1.1/../../../../include/x86_64-linux-gnu/c++/5.1.1
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.1.1/../../../../include/x86_64-linux-gnu/c++/5.1.1
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.1.1/../../../../include/c++/5.1.1/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/lib/llvm-3.6/bin/../lib/clang/3.6.0/include -internal-externc-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.1.1/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -std=c++11 -fdeprecated-macro
-fdebug-compilation-dir /home/arne/C++Test -ferror-limit 19 -fmessage-length
195 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o clang-initializer_list-crash.o
-x c++ clang-initializer_list-crash.cxx 
1.      <eof> parser at end of file
2.      Per-file LLVM IR generation
3.      clang-initializer_list-crash.cxx:9:13: Generating code for declaration
'f'
4.      clang-initializer_list-crash.cxx:13:5: LLVM IR generation of compound
statement ('{}')
5.      clang-initializer_list-crash.cxx:76:9: LLVM IR generation of compound
statement ('{}')
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
Ubuntu clang version 3.6.0-2ubuntu1 (tags/RELEASE_360/final) (based on LLVM
3.6.0)
Target: x86_64-pc-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
http://bugs.debian.org/ and include the crash backtrace, preprocessed source,
and associated run script.
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/clang-initializer_list-crash-c9f98f.cpp
clang: note: diagnostic msg: /tmp/clang-initializer_list-crash-c9f98f.sh
clang: note: diagnostic msg: 

********************

Note that clang only sometimes crashes with a stack trace, often there is no
apparent error, and sometimes only a brief fatal message such as:

*** Error in `/usr/lib/llvm-3.6/bin/clang': malloc(): memory corruption:
0x0000000003b28c60 ***

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150728/18ed1223/attachment.html>


More information about the llvm-bugs mailing list