[llvm-bugs] [Bug 45280] New: clang-cl coroutines crashed when exceptions are used with suspend_always from initial_suspend
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon Mar 23 04:31:57 PDT 2020
https://bugs.llvm.org/show_bug.cgi?id=45280
Bug ID: 45280
Summary: clang-cl coroutines crashed when exceptions are used
with suspend_always from initial_suspend
Product: new-bugs
Version: 9.0
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: new bugs
Assignee: unassignedbugs at nondot.org
Reporter: upplusloader at gmail.com
CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org
Created attachment 23273
--> https://bugs.llvm.org/attachment.cgi?id=23273&action=edit
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 at HV?$allocator at H@std@@@std@@@Z.Frame",
%"?coro2@@YA?AUTask@@V?$vector at HV?$allocator at H@std@@@std@@@Z.Frame"* %FramePtr,
i32 0, i32 9
%10 = catchpad within %9 [%rtti.TypeDescriptor19*
@"??_R0?AVexception at std@@@8", i32 8, %"class.std::exception"** %ex.reload.addr]
in function ?coro2@@YA?AUTask@@V?$vector at HV?$allocator at 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 at HV?$allocator at 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
https://bugs.llvm.org/ 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:
********************
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200323/cb467b62/attachment-0001.html>
More information about the llvm-bugs
mailing list