<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 - Clang 8.0 crashes during compilation"
href="https://bugs.llvm.org/show_bug.cgi?id=43928">43928</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang 8.0 crashes during compilation
</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>C++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>aaron.pohle@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=22782" name="attach_22782" title="Preprocessed source(s) and associated run script(s)">attachment 22782</a> <a href="attachment.cgi?id=22782&action=edit" title="Preprocessed source(s) and associated run script(s)">[details]</a></span>
Preprocessed source(s) and associated run script(s)
During the compilation of the following Code clash 8.0 crashes:
#include <cstdint>
template<typename type, typename unitenum, unitenum DefaultUnit>
class CommonUnit
{
public:
typedef unitenum eUnit;
typedef type DataType;
template<typename settype>
inline void set(settype Value = 0, unitenum theUnit = DefaultUnit)
{
m_Value = static_cast<type>(Value * static_cast<settype>(theUnit));
}
private:
type m_Value;
};
enum eSpeedUnit
{
CentimetersPerSecond = 1,
};
typedef CommonUnit<int32_t, eSpeedUnit, CentimetersPerSecond> Speed;
template<>
template<typename settype>
inline void Speed::set(settype Value, eSpeedUnit theUnit)
{
}
int main(void)
{
Speed s;
s.set(1);
}
$ clang++-8 main.cpp
Stack dump:
0. Program arguments: /usr/lib/llvm-8/bin/clang -cc1 -triple
x86_64-pc-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier
-discard-value-names -main-file-name main.cpp -mrelocation-model static
-mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-dwarf-column-info -debugger-tuning=gdb -resource-dir
/usr/lib/llvm-8/lib/clang/8.0.0 -internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/x86_64-linux-gnu/c++/7.4.0
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/x86_64-linux-gnu/c++/7.4.0
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/backward
-internal-isystem /usr/include/clang/8.0.0/include/ -internal-isystem
/usr/local/include -internal-isystem /usr/lib/llvm-8/lib/clang/8.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdeprecated-macro -fdebug-compilation-dir /home/aaron/src/test/DEFECT-45956/v2
-ferror-limit 19 -fmessage-length 244 -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o
/tmp/main-2af4bd.o -x c++ main.cpp -faddrsig
1. <eof> parser at end of file
2. main.cpp:35:5: LLVM IR generation of declaration 'main'
3. main.cpp:35:5: Generating code for declaration 'main'
#0 0x00007f55c9ed34bf llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/lib/x86_64-linux-gnu/libLLVM-8.so.1+0x9724bf)
#1 0x00007f55c9ed1910 llvm::sys::RunSignalHandlers()
(/usr/lib/x86_64-linux-gnu/libLLVM-8.so.1+0x970910)
#2 0x00007f55c9ed38c8 (/usr/lib/x86_64-linux-gnu/libLLVM-8.so.1+0x9728c8)
#3 0x00007f55cd1c0890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
#4 0x00000000009489e9 (/usr/lib/llvm-8/bin/clang+0x9489e9)
#5 0x00000000008b5236
clang::CodeGen::CodeGenFunction::EmitLoadOfLValue(clang::CodeGen::LValue,
clang::SourceLocation) (/usr/lib/llvm-8/bin/clang+0x8b5236)
#6 0x00000000008dfd42 (/usr/lib/llvm-8/bin/clang+0x8dfd42)
#7 0x00000000008dfe28 (/usr/lib/llvm-8/bin/clang+0x8dfe28)
#8 0x00000000008d7d8f
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool)
(/usr/lib/llvm-8/bin/clang+0x8d7d8f)
#9 0x00000000008a5e06 clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr
const*, clang::CodeGen::AggValueSlot, bool)
(/usr/lib/llvm-8/bin/clang+0x8a5e06)
#10 0x00000000008a667d
clang::CodeGen::CodeGenFunction::EmitAnyExprToTemp(clang::Expr const*)
(/usr/lib/llvm-8/bin/clang+0x8a667d)
#11 0x0000000000874b60
clang::CodeGen::CodeGenFunction::EmitCallArg(clang::CodeGen::CallArgList&,
clang::Expr const*, clang::QualType) (/usr/lib/llvm-8/bin/clang+0x874b60)
#12 0x0000000000873eef
clang::CodeGen::CodeGenFunction::EmitCallArgs(clang::CodeGen::CallArgList&,
llvm::ArrayRef<clang::QualType>,
llvm::iterator_range<clang::Stmt::ConstExprIterator>,
clang::CodeGen::CodeGenFunction::AbstractCallee, unsigned int,
clang::CodeGen::CodeGenFunction::EvaluationOrder)
(/usr/lib/llvm-8/bin/clang+0x873eef)
#13 0x00000000007e0c11 (/usr/lib/llvm-8/bin/clang+0x7e0c11)
#14 0x00000000008c7c07 (/usr/lib/llvm-8/bin/clang+0x8c7c07)
#15 0x00000000008c7832
clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorCall(clang::CXXMethodDecl
const*, clang::CodeGen::CGCallee const&, clang::CodeGen::ReturnValueSlot,
llvm::Value*, llvm::Value*, clang::QualType, clang::CallExpr const*,
clang::CodeGen::CallArgList*) (/usr/lib/llvm-8/bin/clang+0x8c7832)
#16 0x00000000008c9a79
clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr(clang::CallExpr
const*, clang::CXXMethodDecl const*, clang::CodeGen::ReturnValueSlot, bool,
clang::NestedNameSpecifier*, bool, clang::Expr const*)
(/usr/lib/llvm-8/bin/clang+0x8c9a79)
#17 0x00000000008c804f
clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(clang::CXXMemberCallExpr
const*, clang::CodeGen::ReturnValueSlot) (/usr/lib/llvm-8/bin/clang+0x8c804f)
#18 0x00000000008bc56f
clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*,
clang::CodeGen::ReturnValueSlot) (/usr/lib/llvm-8/bin/clang+0x8bc56f)
#19 0x00000000008e626f (/usr/lib/llvm-8/bin/clang+0x8e626f)
#20 0x00000000008d7d8f
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool)
(/usr/lib/llvm-8/bin/clang+0x8d7d8f)
#21 0x00000000008a5e06 clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr
const*, clang::CodeGen::AggValueSlot, bool)
(/usr/lib/llvm-8/bin/clang+0x8a5e06)
#22 0x00000000008a5d59
clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*)
(/usr/lib/llvm-8/bin/clang+0x8a5d59)
#23 0x00000000007134c2 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>)
(/usr/lib/llvm-8/bin/clang+0x7134c2)
#24 0x000000000071c4d0
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot)
(/usr/lib/llvm-8/bin/clang+0x71c4d0)
#25 0x0000000000755f3e
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*)
(/usr/lib/llvm-8/bin/clang+0x755f3e)
#26 0x00000000007567bf
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&)
(/usr/lib/llvm-8/bin/clang+0x7567bf)
#27 0x000000000076d032
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/usr/lib/llvm-8/bin/clang+0x76d032)
#28 0x000000000076782b
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/usr/lib/llvm-8/bin/clang+0x76782b)
#29 0x000000000076f682
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*)
(/usr/lib/llvm-8/bin/clang+0x76f682)
#30 0x0000000000d5ab2f (/usr/lib/llvm-8/bin/clang+0xd5ab2f)
#31 0x0000000000d585a2 (/usr/lib/llvm-8/bin/clang+0xd585a2)
#32 0x00000000011df363 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/lib/llvm-8/bin/clang+0x11df363)
#33 0x0000000000addfcf clang::FrontendAction::Execute()
(/usr/lib/llvm-8/bin/clang+0xaddfcf)
#34 0x0000000000a9bb18
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/lib/llvm-8/bin/clang+0xa9bb18)
#35 0x0000000000b644c6
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/lib/llvm-8/bin/clang+0xb644c6)
#36 0x00000000006a32e7 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/lib/llvm-8/bin/clang+0x6a32e7)
#37 0x00000000006a17d6 main (/usr/lib/llvm-8/bin/clang+0x6a17d6)
#38 0x00007f55c8852b97 __libc_start_main
/build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#39 0x000000000069eeca _start (/usr/lib/llvm-8/bin/clang+0x69eeca)
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 8.0.0-3~ubuntu18.04.1 (tags/RELEASE_800/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang: note: diagnostic msg: PLEASE submit a bug report to
<a href="https://bugs.llvm.org/">https://bugs.llvm.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/main-ba60e7.cpp
clang: note: diagnostic msg: /tmp/main-ba60e7.sh
clang: note: diagnostic msg:
********************</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>