<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 - Assertion `isa<Argument>(Val) && "Unknown live-in to the entry block"' failed, crash on release"
href="https://bugs.llvm.org/show_bug.cgi?id=46125">46125</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Assertion `isa<Argument>(Val) && "Unknown live-in to the entry block"' failed, crash on release
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>release blocker
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>changochen1@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>We found an bug in optimizer that crashes clang (release version) and triggers
an assertion on debug version. Clang version started from 9 is affected.
CMD:
---
clang -O3 poc.c
---
POC:
---
int a, b;
int main() {
switch (a)
case 4:
case 7:
return a;
a = b;
main();
}
---
Stack dump:
---
Stack dump:
0. Program arguments: /usr/lib/llvm-9/bin/clang -cc1 -triple
x86_64-pc-linux-gnu -emit-obj -disable-free -disable-llvm-verifier
-discard-value-names -main-file-name crash.c -mrelocation-model static
-mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info
-debugger-tuning=gdb -momit-leaf-frame-pointer -resource-dir
/usr/lib/llvm-9/lib/clang/9.0.0 -internal-isystem /usr/local/include
-internal-isystem /usr/lib/llvm-9/lib/clang/9.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O3
-fdebug-compilation-dir /home/yongheng -ferror-limit 19 -fmessage-length 0
-fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics
-vectorize-loops -vectorize-slp -faddrsig -o /tmp/crash-577133.o -x c crash.c
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module 'crash.c'.
4. Running pass 'Simple Register Coalescing' on function '@main'
#0 0x00007fa30f10a35f llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1+0xa3835f)
#1 0x00007fa30f108780 llvm::sys::RunSignalHandlers()
(/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1+0xa36780)
#2 0x00007fa30f10a761 (/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1+0xa38761)
#3 0x00007fa314d8f890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
#4 0x00007fa30f489134 (/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1+0xdb7134)
#5 0x00007fa30f4826ed (/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1+0xdb06ed)
#6 0x00007fa30f481076 (/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1+0xdaf076)
#7 0x00007fa30f4803cd (/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1+0xdae3cd)
#8 0x00007fa30f392988
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1+0xcc0988)
#9 0x00007fa30f209246 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1+0xb37246)
#10 0x00007fa30f2094f3 llvm::FPPassManager::runOnModule(llvm::Module&)
(/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1+0xb374f3)
#11 0x00007fa30f2099a0 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1+0xb379a0)
#12 0x00007fa313b115f6 EmitAssembly
/build/llvm-toolchain-9-uSl4bC/llvm-toolchain-9-9/tools/clang/lib/CodeGen/BackendUtil.cpp:899:3
#13 0x00007fa313b115f6 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
/build/llvm-toolchain-9-uSl4bC/llvm-toolchain-9-9/tools/clang/lib/CodeGen/BackendUtil.cpp:1498:15
#14 0x00007fa313d47ead ~unique_ptr
/usr/lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/bits/unique_ptr.h:267:6
#15 0x00007fa313d47ead HandleTranslationUnit
/build/llvm-toolchain-9-uSl4bC/llvm-toolchain-9-9/tools/clang/lib/CodeGen/CodeGenAction.cpp:303:7
#16 0x00007fa313077a03 __normal_iterator
/usr/lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/bits/stl_iterator.h:783:20
#17 0x00007fa313077a03 begin
/usr/lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/bits/stl_vector.h:564:16
#18 0x00007fa313077a03
finalize<std::vector<std::unique_ptr<clang::TemplateInstantiationCallback,
std::default_delete<clang::TemplateInstantiationCallback> >,
std::allocator<std::unique_ptr<clang::TemplateInstantiationCallback,
std::default_delete<clang::TemplateInstantiationCallback> > > > >
/build/llvm-toolchain-9-uSl4bC/llvm-toolchain-9-9/tools/clang/include/clang/Sema/TemplateInstCallback.h:54:16
#19 0x00007fa313077a03 clang::ParseAST(clang::Sema&, bool, bool)
/build/llvm-toolchain-9-uSl4bC/llvm-toolchain-9-9/tools/clang/lib/Parse/ParseAST.cpp:178:3
#20 0x00007fa3143194c8 clang::FrontendAction::Execute()
/build/llvm-toolchain-9-uSl4bC/llvm-toolchain-9-9/tools/clang/lib/Frontend/FrontendAction.cpp:938:10
#21 0x00007fa3142d8ce0 getPtr
/build/llvm-toolchain-9-uSl4bC/llvm-toolchain-9-9/include/llvm/Support/Error.h:273:42
#22 0x00007fa3142d8ce0 operator bool
/build/llvm-toolchain-9-uSl4bC/llvm-toolchain-9-9/include/llvm/Support/Error.h:236:16
#23 0x00007fa3142d8ce0
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/build/llvm-toolchain-9-uSl4bC/llvm-toolchain-9-9/tools/clang/lib/Frontend/CompilerInstance.cpp:944:23
#24 0x00007fa31437c210
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/build/llvm-toolchain-9-uSl4bC/llvm-toolchain-9-9/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:291:25
#25 0x0000000000498a5b cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/lib/llvm-9/bin/clang+0x498a5b)
#26 0x0000000000496d71 main (/usr/lib/llvm-9/bin/clang+0x496d71)
#27 0x00007fa30d9c3b97 __libc_start_main
/build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#28 0x00000000004941ea _start (/usr/lib/llvm-9/bin/clang+0x4941ea)
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 9.0.0-2~ubuntu18.04.2 (tags/RELEASE_900/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/crash-73e483.c
clang: note: diagnostic msg: /tmp/crash-73e483.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>