<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 - Crash with template code and -fopenmp"
href="https://bugs.llvm.org/show_bug.cgi?id=44948">44948</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Crash with template code and -fopenmp
</td>
</tr>
<tr>
<th>Product</th>
<td>OpenMP
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</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>Keywords</th>
<td>compile-fail, regression
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Clang Compiler Support
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>v.reichelt@netcologne.de
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>The following code snippet triggers a segfault when compiled with "-fopenmp"
(although the code does not contain any OpenMP pragma at all):
=====================================
template<typename T> struct A
{
~A();
T t;
};
template<typename T> A<T>::~A()
{
delete t.p;
}
=====================================
This is a recent regression that was introduced between commits 65e843c9e0b
(OK) and 377b0e2b06f (broken).
Stack dump:
0. Program arguments: /LLVM-trunk/bin/clang++ -fopenmp -c CLbug.cc
1. <eof> parser at end of file
#0 0x00000000027b066a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/LLVM-trunk/bin/clang+++0x27b066a)
#1 0x00000000027ae1d4 llvm::sys::RunSignalHandlers()
(/LLVM-trunk/bin/clang+++0x27ae1d4)
#2 0x00000000027ae42b llvm::sys::CleanupOnSignal(unsigned long)
(/LLVM-trunk/bin/clang+++0x27ae42b)
#3 0x0000000002728978 CrashRecoverySignalHandler(int)
(/LLVM-trunk/bin/clang+++0x2728978)
#4 0x00007f6debd23680 __restore_rt (/lib64/libpthread.so.0+0xf680)
#5 0x0000000004b1b413 clang::QualType::getSplitDesugaredType(clang::QualType)
(/LLVM-trunk/bin/clang+++0x4b1b413)
#6 0x00000000047ea768 clang::ASTContext::getBaseElementType(clang::QualType)
const (/LLVM-trunk/bin/clang+++0x47ea768)
#7 0x0000000003ff7dc2 clang::StmtVisitorBase<std::add_pointer, (anonymous
namespace)::DeferredDiagnosticsEmitter, void>::Visit(clang::Stmt*)
(/LLVM-trunk/bin/clang+++0x3ff7dc2)
#8 0x0000000003ff8202 clang::EvaluatedExprVisitorBase<std::add_pointer,
(anonymous namespace)::DeferredDiagnosticsEmitter>::VisitStmt(clang::Stmt*)
(/LLVM-trunk/bin/clang+++0x3ff8202)
#9 0x0000000003ff7e3b clang::StmtVisitorBase<std::add_pointer, (anonymous
namespace)::DeferredDiagnosticsEmitter, void>::Visit(clang::Stmt*)
(/LLVM-trunk/bin/clang+++0x3ff7e3b)
#10 0x0000000003ff4cf4 (anonymous
namespace)::DeferredDiagnosticsEmitter::visitUsedDecl(clang::SourceLocation,
clang::Decl*) (/LLVM-trunk/bin/clang+++0x3ff4cf4)
#11 0x0000000003ff49c7 (anonymous
namespace)::DeferredDiagnosticsEmitter::visitUsedDecl(clang::SourceLocation,
clang::Decl*) (/LLVM-trunk/bin/clang+++0x3ff49c7)
#12 0x0000000003ff512b clang::Sema::emitDeferredDiags()
(/LLVM-trunk/bin/clang+++0x3ff512b)
#13 0x0000000003ff536a
clang::Sema::ActOnEndOfTranslationUnitFragment(clang::Sema::TUFragmentKind)
(.part.1636) (/LLVM-trunk/bin/clang+++0x3ff536a)
#14 0x0000000003ff5a6e clang::Sema::ActOnEndOfTranslationUnit()
(/LLVM-trunk/bin/clang+++0x3ff5a6e)
#15 0x0000000003f1e063
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
(/LLVM-trunk/bin/clang+++0x3f1e063)
#16 0x0000000003f141b9 clang::ParseAST(clang::Sema&, bool, bool)
(/LLVM-trunk/bin/clang+++0x3f141b9)
#17 0x000000000352ca28 clang::CodeGenAction::ExecuteAction()
(/LLVM-trunk/bin/clang+++0x352ca28)
#18 0x0000000002f3d309 clang::FrontendAction::Execute()
(/LLVM-trunk/bin/clang+++0x2f3d309)
#19 0x0000000002f00c42
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/LLVM-trunk/bin/clang+++0x2f00c42)
#20 0x0000000003002940
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/LLVM-trunk/bin/clang+++0x3002940)
#21 0x00000000008f5371 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/LLVM-trunk/bin/clang+++0x8f5371)
#22 0x00000000008f15b7 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(/LLVM-trunk/bin/clang+++0x8f15b7)
#23 0x0000000002de1035 void llvm::function_ref<void
()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
<span class="quote">>, std::__cxx11::basic_string<char, std::char_traits<char>,</span >
std::allocator<char> >*, bool*) const::'lambda'()>(long)
(/LLVM-trunk/bin/clang+++0x2de1035)
#24 0x0000000002728ae2
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/LLVM-trunk/bin/clang+++0x2728ae2)
#25 0x0000000002de1b15
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
<span class="quote">>, std::__cxx11::basic_string<char, std::char_traits<char>,</span >
std::allocator<char> >*, bool*) const (.part.168)
(/LLVM-trunk/bin/clang+++0x2de1b15)
#26 0x0000000002dbe607
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const (/LLVM-trunk/bin/clang+++0x2dbe607)
#27 0x0000000002dbeee7
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/LLVM-trunk/bin/clang+++0x2dbeee7)
#28 0x0000000002dc71a1
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/LLVM-trunk/bin/clang+++0x2dc71a1)
#29 0x000000000085b7c3 main (/LLVM-trunk/bin/clang+++0x85b7c3)
clang-11: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 11.0.0 (<a href="https://github.com/llvm/llvm-project.git">https://github.com/llvm/llvm-project.git</a>
0863f6757953684400162f2ad418f3e8e28af278)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /LLVM-trunk/bin</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>