<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-cl coroutines crashed when exceptions are used with suspend_always from initial_suspend"
href="https://bugs.llvm.org/show_bug.cgi?id=45280">45280</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang-cl coroutines crashed when exceptions are used with suspend_always from initial_suspend
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>9.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</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>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>upplusloader@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=23273" name="attach_23273" title="source files and processed source files and run scripts">attachment 23273</a> <a href="attachment.cgi?id=23273&action=edit" title="source files and processed source files and run scripts">[details]</a></span>
source files and processed source files and run scripts
clang-cl (tested 8 and 9) encounter a backend crash while compiling a coroutine
that uses try catch blocks and the promise_type has an initial_suspend method
which returns suspend_always .
if initial_suspend method returns suspend_never no crash !
if no exceptions are used in the coroutine no crash !
sample files are attached and files asked to be attached in the output .
compilation command : clang-cl -Xclang -v -Xclang -fcoroutines-ts
test-clang.cpp /EHsc
output :
clang -cc1 version 9.0.0 based upon LLVM 9.0.0-r363781 default target
x86_64-pc-windows-msvc
#include "..." search starts here:
#include <...> search starts here:
C:\Program Files\LLVM\lib\clang\9.0.0\include
C:\Program Files (x86)\Microsoft Visual
Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt
End of search list.
Instruction does not dominate all uses!
%ex.reload.addr = getelementptr inbounds
%"?coro2@@YA?AUTask@@V?$vector@HV?$allocator@H@std@@@std@@@Z.Frame",
%"?coro2@@YA?AUTask@@V?$vector@HV?$allocator@H@std@@@std@@@Z.Frame"* %FramePtr,
i32 0, i32 9
%10 = catchpad within %9 [%rtti.TypeDescriptor19*
@"??_R0?AVexception@std@@@8", i32 8, %"class.std::exception"** %ex.reload.addr]
in function ?coro2@@YA?AUTask@@V?$vector@HV?$allocator@H@std@@@std@@@Z
fatal error: error in backend: Broken function found, compilation aborted!
Stack dump:
0. Program arguments: C:\Program Files\LLVM\bin\clang-cl.exe -cc1 -triple
x86_64-pc-windows-msvc19.25.28610 -emit-obj -mrelax-all
-mincremental-linker-compatible -disable-free -main-file-name test-clang.cpp
-mrelocation-model pic -pic-level 2 -mthread-model posix -relaxed-aliasing
-fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu
x86-64 -mllvm -x86-asm-syntax=intel -D_MT -flto-visibility-public-std
--dependent-lib=libcmt --dependent-lib=oldnames -stack-protector 2
-fcxx-exceptions -fexceptions -fexternc-nounwind -fms-volatile
-fdiagnostics-format msvc -dwarf-column-info -momit-leaf-frame-pointer
-resource-dir C:\Program Files\LLVM\lib\clang\9.0.0 -internal-isystem
C:\Program Files\LLVM\lib\clang\9.0.0\include -internal-isystem C:\Program
Files (x86)\Microsoft Visual
Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include -internal-isystem
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt
-internal-isystem C:\Program Files (x86)\Windows
Kits\10\include\10.0.18362.0\shared -internal-isystem C:\Program Files
(x86)\Windows Kits\10\include\10.0.18362.0\um -internal-isystem C:\Program
Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -fdeprecated-macro
-fdebug-compilation-dir E:\programs\projects\rad-lib\build\rad-lib.dir
-ferror-limit 19 -fmessage-length 150 -fno-use-cxa-atexit -fms-extensions
-fms-compatibility -fms-compatibility-version=19.25.28610 -std=c++14
-fdelayed-template-parsing -fobjc-runtime=gcc -fdiagnostics-show-option
-fcolor-diagnostics -v -fcoroutines-ts -faddrsig -o
C:\Users\userpc\AppData\Local\Temp\test-clang-90f8b1.obj -x c++ test-clang.cpp
1. <eof> parser at end of file
2. Per-module optimization passes
3. Running pass 'CallGraph Pass Manager' on module 'test-clang.cpp'.
4. Running pass 'Module Verifier' on function
'@"?coro2@@YA?AUTask@@V?$vector@HV?$allocator@H@std@@@std@@@Z"'
clang-cl: error: clang frontend command failed with exit code 70 (use -v to see
invocation)
clang version 9.0.0 (trunk)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
clang-cl: 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-cl: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-cl: note: diagnostic msg:
C:\Users\userpc\AppData\Local\Temp\test-clang-feb6dd.cpp
clang-cl: note: diagnostic msg:
C:\Users\userpc\AppData\Local\Temp\test-clang-feb6dd.sh
clang-cl: 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>