<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - Segmentation fault in clang::CodeGen::CodeGenFunction::EmitScalarExpr"
   href="https://bugs.llvm.org/show_bug.cgi?id=45311">45311</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Segmentation fault in clang::CodeGen::CodeGenFunction::EmitScalarExpr
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>8.0
          </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>LLVM Codegen
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>joe.sylve@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>As you can see here I'm testing my codebase against several versions of clang++
running on Linux: <a href="https://travis-ci.org/github/jtsylve/yatlib/builds/667081643">https://travis-ci.org/github/jtsylve/yatlib/builds/667081643</a>

Clang 5 and 6 fail to compile for unrelated reasons which I can mitigate. 
Clang 8, 9, 10, and 11 all crash with a similar Segmentation fault.  The code
that triggers the crash can be found by checking out commit
ef0cc1852c353cef024ea5cea0ea371e7259fde5 from 
<a href="https://github.com/jtsylve/yatlib">https://github.com/jtsylve/yatlib</a>

Clang 8 stacktrace below:

Stack dump:
0.      Program arguments: /usr/lib/llvm-8/bin/clang -cc1 -triple
x86_64-pc-linux-gnu -emit-obj -disable-free -disable-llvm-verifier
-discard-value-names -main-file-name format_test.cpp -mrelocation-model static
-mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info
-debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb
-momit-leaf-frame-pointer -coverage-notes-file
/home/travis/build/jtsylve/yatlib/tests/CMakeFiles/unittests.dir/format_test.cpp.gcno
-resource-dir /usr/lib/llvm-8/lib/clang/8.0.1 -I
/home/travis/build/jtsylve/yatlib/thirdparty/catch2/single_include -I
/home/travis/build/jtsylve/yatlib/include -D NDEBUG -internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/x86_64-linux-gnu/c++/7.5.0
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/x86_64-linux-gnu/c++/7.5.0
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/backward
-internal-isystem /usr/include/clang/8.0.1/include/ -internal-isystem
/usr/local/include -internal-isystem /usr/lib/llvm-8/lib/clang/8.0.1/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O2
-Wall -Wextra -Wshadow -Wnon-virtual-dtor -Wold-style-cast -Wcast-align
-Wunused -Woverloaded-virtual -Wpedantic -Wconversion -Wsign-conversion
-Wnull-dereference -Wdouble-promotion -Wformat=2 -std=gnu++17
-fdeprecated-macro -fdebug-compilation-dir
/home/travis/build/jtsylve/yatlib/tests -ferror-limit 19 -fmessage-length 80
-fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -vectorize-loops -vectorize-slp -o
CMakeFiles/unittests.dir/format_test.cpp.o -x c++
/home/travis/build/jtsylve/yatlib/tests/format_test.cpp -faddrsig 
1.      <eof> parser at end of file
2.      Per-file LLVM IR generation
3.      /home/travis/build/jtsylve/yatlib/tests/format_test.cpp:72:1
<Spelling=<scratch space>:185:1>: Generating code for declaration
'____C_A_T_C_H____T_E_S_T____4'
4.      /home/travis/build/jtsylve/yatlib/tests/format_test.cpp:86:3
<Spelling=/home/travis/build/jtsylve/yatlib/thirdparty/catch2/single_include/catch2/catch.hpp:2676:8>:
LLVM IR generation of compound statement ('{}')
 #0 0x00007fc6412cd59f llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/lib/x86_64-linux-gnu/libLLVM-8.so.1+0x97159f)
 #1 0x00007fc6412cb9f0 llvm::sys::RunSignalHandlers()
(/usr/lib/x86_64-linux-gnu/libLLVM-8.so.1+0x96f9f0)
 #2 0x00007fc6412cd9a8 (/usr/lib/x86_64-linux-gnu/libLLVM-8.so.1+0x9719a8)
 #3 0x00007fc6445b4890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
 #4 0x00000000008e4ed9 (/usr/lib/llvm-8/bin/clang+0x8e4ed9)
 #5 0x00000000008d6a8f
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool)
(/usr/lib/llvm-8/bin/clang+0x8d6a8f)
 #6 0x00000000008a4b06 clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr
const*, clang::CodeGen::AggValueSlot, bool)
(/usr/lib/llvm-8/bin/clang+0x8a4b06)
 #7 0x00000000008a4a59
clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*)
(/usr/lib/llvm-8/bin/clang+0x8a4a59)
 #8 0x00000000008e7cc8 (/usr/lib/llvm-8/bin/clang+0x8e7cc8)
 #9 0x00000000008e0c1b (/usr/lib/llvm-8/bin/clang+0x8e0c1b)
#10 0x00000000008d6a8f
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool)
(/usr/lib/llvm-8/bin/clang+0x8d6a8f)
#11 0x00000000008a4b06 clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr
const*, clang::CodeGen::AggValueSlot, bool)
(/usr/lib/llvm-8/bin/clang+0x8a4b06)
#12 0x00000000008a4a59
clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*)
(/usr/lib/llvm-8/bin/clang+0x8a4a59)
#13 0x0000000000712b92 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>)
(/usr/lib/llvm-8/bin/clang+0x712b92)
#14 0x000000000071ba70
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot)
(/usr/lib/llvm-8/bin/clang+0x71ba70)
#15 0x000000000071b048
clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&,
bool, clang::CodeGen::AggValueSlot) (/usr/lib/llvm-8/bin/clang+0x71b048)
#16 0x00000000007131df
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*)
(/usr/lib/llvm-8/bin/clang+0x7131df)
#17 0x0000000000712abb clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>)
(/usr/lib/llvm-8/bin/clang+0x712abb)
#18 0x00000000007146ae
clang::CodeGen::CodeGenFunction::EmitDoStmt(clang::DoStmt const&,
llvm::ArrayRef<clang::Attr const*>) (/usr/lib/llvm-8/bin/clang+0x7146ae)
#19 0x0000000000713056 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>)
(/usr/lib/llvm-8/bin/clang+0x713056)
#20 0x000000000071ba70
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot)
(/usr/lib/llvm-8/bin/clang+0x71ba70)
#21 0x000000000075545e
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*)
(/usr/lib/llvm-8/bin/clang+0x75545e)
#22 0x0000000000755cdf
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&)
(/usr/lib/llvm-8/bin/clang+0x755cdf)
#23 0x000000000076c512
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/usr/lib/llvm-8/bin/clang+0x76c512)
#24 0x0000000000766d0b
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/usr/lib/llvm-8/bin/clang+0x766d0b)
#25 0x000000000075ed8e clang::CodeGen::CodeGenModule::EmitDeferred()
(/usr/lib/llvm-8/bin/clang+0x75ed8e)
#26 0x000000000075e267 clang::CodeGen::CodeGenModule::Release()
(/usr/lib/llvm-8/bin/clang+0x75e267)
#27 0x0000000000d58944 (/usr/lib/llvm-8/bin/clang+0xd58944)
#28 0x0000000000d56438 (/usr/lib/llvm-8/bin/clang+0xd56438)
#29 0x00000000011dcbb3 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/lib/llvm-8/bin/clang+0x11dcbb3)
#30 0x0000000000add2bf clang::FrontendAction::Execute()
(/usr/lib/llvm-8/bin/clang+0xadd2bf)
#31 0x0000000000a9bde8
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/lib/llvm-8/bin/clang+0xa9bde8)
#32 0x0000000000b62d96
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/lib/llvm-8/bin/clang+0xb62d96)
#33 0x00000000006a2dec cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/lib/llvm-8/bin/clang+0x6a2dec)
#34 0x00000000006a1336 main (/usr/lib/llvm-8/bin/clang+0x6a1336)
#35 0x00007fc63fc4db97 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x21b97)
#36 0x000000000069ea5a _start (/usr/lib/llvm-8/bin/clang+0x69ea5a)
clang: error: unable to execute command: Segmentation fault (core dumped)</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>