<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW " title="NEW --- - non-deterministic Codegen crash for function static initializer_list" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D24289&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=0YKJR8vo3kfgG92MxIe9WDxu5PQqPHFa_F9ZxNbOqw8&s=JpL55hldM8Ym7zRsjMYb7nhv3E3HuDJRyXCoq_NXbRg&e=">24289</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>non-deterministic Codegen crash for function static initializer_list
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.6
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>arvo@me.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=14657" name="attach_14657" title="Source files (prerprocessed and original reduced version) and clang invocation">attachment 14657</a> <a href="attachment.cgi?id=14657&action=edit" title="Source files (prerprocessed and original reduced version) and clang invocation">[details]</a></span>
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
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__bugs.debian.org_&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=0YKJR8vo3kfgG92MxIe9WDxu5PQqPHFa_F9ZxNbOqw8&s=j1cSBnSK-4dz7T0LmbpMkqhcqcP00eY5ApZXKaCk6AI&e=">http://bugs.debian.org/</a> 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 ***</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>