<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 (segmentation fault) in clang::Sema::DiagnoseUnexpandedParameterPack"
href="https://bugs.llvm.org/show_bug.cgi?id=45239">45239</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Crash (segmentation fault) in clang::Sema::DiagnoseUnexpandedParameterPack
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>9.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>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>t.priesner@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>Created <span class=""><a href="attachment.cgi?id=23252" name="attach_23252" title="Preprocessed source file">attachment 23252</a> <a href="attachment.cgi?id=23252&action=edit" title="Preprocessed source file">[details]</a></span>
Preprocessed source file
While compiling a source file containing an incorrect include (file not found),
if ran into the following segementation fault.
I reduced the source with creduce and attached it to this bug.
I also still have the original (unreduced) file if needed.
Note: the unreduced file crashes in another function
(clang::NestedNameSpecifier::isDependent())
$ clang --version
clang version 9.0.1
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
$ cat /etc/os-release
NAME="openSUSE Tumbleweed"
# VERSION="20200314"
...
Stack dump:
0. Program arguments: /usr/bin/clang-9.0.1 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -discard-value-names -main-file-name bug.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/lib64/clang/9.0.1 -internal-isystem
/usr/bin/../lib64/gcc/x86_64-suse-linux/9/../../../../include/c++/9
-internal-isystem
/usr/bin/../lib64/gcc/x86_64-suse-linux/9/../../../../include/c++/9/x86_64-suse-linux
-internal-isystem
/usr/bin/../lib64/gcc/x86_64-suse-linux/9/../../../../include/c++/9/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/lib64/clang/9.0.1/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -fdeprecated-macro
-fdebug-compilation-dir /dev/shm -ferror-limit 19 -fmessage-length 0
-fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -faddrsig -o /tmp/bug-e490fe.o -x c++ bug.cpp
1. <eof> parser at end of file
#0 0x00007f62c06c3ced llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/bin/../lib64/libLLVM.so.9+0xa9dced)
#1 0x00007f62c06c1790 llvm::sys::RunSignalHandlers()
(/usr/bin/../lib64/libLLVM.so.9+0xa9b790)
#2 0x00007f62c06c4234 (/usr/bin/../lib64/libLLVM.so.9+0xa9e234)
#3 0x00007f62c723e1e0 __restore_rt (/lib64/libpthread.so.0+0x141e0)
#4 0x00007f62c5b100e9
clang::Sema::DiagnoseUnexpandedParameterPack(clang::CXXScopeSpec const&,
clang::Sema::UnexpandedParameterPackContext)
(/usr/bin/../lib64/libclang-cpp.so.9+0x14850e9)
#5 0x00007f62c552dd80 clang::Sema::HandleDeclarator(clang::Scope*,
clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>)
(/usr/bin/../lib64/libclang-cpp.so.9+0xea2d80)
#6 0x00007f62c552db58 clang::Sema::ActOnDeclarator(clang::Scope*,
clang::Declarator&) (/usr/bin/../lib64/libclang-cpp.so.9+0xea2b58)
#7 0x00007f62c4e05234
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*)
(/usr/bin/../lib64/libclang-cpp.so.9+0x77a234)
#8 0x00007f62c4e03c00 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/usr/bin/../lib64/libclang-cpp.so.9+0x778c00)
#9 0x00007f62c4eaf497
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/usr/bin/../lib64/libclang-cpp.so.9+0x824497)
#10 0x00007f62c4eaedd4
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
(/usr/bin/../lib64/libclang-cpp.so.9+0x823dd4)
#11 0x00007f62c4eadbdc
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) (/usr/bin/../lib64/libclang-cpp.so.9+0x822bdc)
#12 0x00007f62c4eab7ad
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
(/usr/bin/../lib64/libclang-cpp.so.9+0x8207ad)
#13 0x00007f62c4debbbd clang::ParseAST(clang::Sema&, bool, bool)
(/usr/bin/../lib64/libclang-cpp.so.9+0x760bbd)
#14 0x00007f62c5e18c13 clang::CodeGenAction::ExecuteAction()
(/usr/bin/../lib64/libclang-cpp.so.9+0x178dc13)
#15 0x00007f62c6691964 clang::FrontendAction::Execute()
(/usr/bin/../lib64/libclang-cpp.so.9+0x2006964)
#16 0x00007f62c664e0d0
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/bin/../lib64/libclang-cpp.so.9+0x1fc30d0)
#17 0x00007f62c6705c0e
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/bin/../lib64/libclang-cpp.so.9+0x207ac0e)
#18 0x000000000049a069 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/bin/clang-9.0.1+0x49a069)
#19 0x0000000000498562 main (/usr/bin/clang-9.0.1+0x498562)
#20 0x00007f62bf76aceb __libc_start_main (/lib64/libc.so.6+0x26ceb)
#21 0x000000000049546a _start (/usr/bin/clang-9.0.1+0x49546a)
clang-9.0: error: unable to execute command: Segmentation fault (core dumped)
clang-9.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 9.0.1
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang-9.0: 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-9.0: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-9.0: note: diagnostic msg: /tmp/bug-ebedc8.cpp
clang-9.0: note: diagnostic msg: /tmp/bug-ebedc8.sh
clang-9.0: 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>